ppc64le (+ ppcle) magic is missing in debian/binfmt-update-in

Bug #1358268 reported by jaejunh
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Fix Released
High
Unassigned

Bug Description

1. binfmt-update-in doesn't have definition for ppc64le_{magic,mask}.

I temporarily created one using hexdump output:

hexdump -C /bin/bash | head -n 2
00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
00000010 02 00 15 00 01 00 00 00 70 14 02 10 00 00 00 00 |........p.......|

hexdump -C /bin/sh | head -n 2
00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
00000010 03 00 15 00 01 00 00 00 ac 4e 00 00 00 00 00 00 |.........N......|

2. I added a small patch of 32-bit usermode "qemu-ppcle" (being subarch of ppc64le)

I am in the porting powerpcel (32bit ppc LE) ubuntu 14.04, and
got successfully chroot with this qemu-ppcle patch and it looks very promising (i.e.
build perl looks ok)

3. I am attaching patch for above two. You can ignore/reject if necessary.

Thanks.

Tags: patch
Revision history for this message
jaejunh (jaejunh) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch for ppc64le magic + qemu-ppcle" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for submitting this patch. I'll aim to get it into 14.10 and 14.04. Is there a particular way you'd recommend testing this, or should i simply download the ppc64le 14.10 cd image and try chrooting into it?

Changed in qemu (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
jaejunh (jaejunh) wrote :

Hi, Serge,

1. You can do "full" test by downloading ppc64le 14.10 iso, but quick test is also possible by following:

In your host pc(amd64?) 14.10, where you've installed above qemu-user-static (qemu-ppc64le),

  apt-get download coreutils:ppc64el bash-static:ppc64el
  # or just wget those two from launchpad 14.10
  dpkg-deb -x coreutils*.deb /tmp/ppc64el
  dpkg-deb -x bash-static*.deb /tmp/ppc64el
  ln -s /tmp/ppc64el/bin/bash-static /tmp/ppc64el/bin/bash
  cp /usr/bin/qemu-ppc64le-static /tmp/ppc64el/usr/bin

2. Now really tiny/broken chroot env is setup by 1. Now chroot,
 sudo su chroot /tmp/ppc64el

  If you see, "bash-4.3#" prompt, now you know it's successfully executed "ppc64el binary"
  using binfmt_misc.

Note: FYI, you can try: "ls" in chroot environment, yet it would not work since it cannot find
/lib64/ld64.so.2. However, static binary "echo" would work without problem!

If you get into any problem, please let me know.

Thank you!

PS. I still want "powerpcel" patch part committed too, although no community (known) is working on this
except me since I rely on this patch to work on my current porting of "powerpcel". Since nobody is
using "powerpcel" at this point, it's safe to do so I believe. Thanks!

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

On the qemu-ppc and qemu-devel mailing lists the following query was made about
the non-packaging changes:

> So before we add anything to QEMU, I would like to first see someone
> point me to kernel patches that actually enable LE on Linux for 32bit
> user space. So far I'm not aware of any (and I doubt it makes much sense)

In the original description you had said

> I am in the porting powerpcel (32bit ppc LE) ubuntu 14.04, and got
> successfully chroot with this qemu-ppcle patch and it looks very promising
> (i.e. build perl looks ok)

To be sure I am understanding you right, are you in fact working on the kernel
patches that would be needed for this to be useful?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu - 2.1+dfsg-3ubuntu3

---------------
qemu (2.1+dfsg-3ubuntu3) utopic; urgency=medium

  * replace d/p/revert-acpi-table-size-bump with
    pc-reserve-more-memory-for-acpi.patch from upstream
  * debian/binfmt-update-in
    - don't run in a container
    - add ppc64le as target (LP: #1358268)
  * Add experimental ppcle support (LP: #1358268)
 -- Serge Hallyn <email address hidden> Wed, 27 Aug 2014 18:24:32 -0500

Changed in qemu (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.