Public bug reported: == Comment: #0 - YOGANANTH SUBRAMANIAN <anant...@in.ibm.com> - 2015-06-29 07:41:58 == ---Problem Description--- chroot with qemu-ppc64-static fails on x86 Contact Information = anant...@in.ibm.com ---uname output--- Linux ubuntu 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Machine Type = x86 VM ---Debugger--- A debugger is not configured ---Steps to Reproduce--- Set TARGET_PATH to root of chroot mount --bind /dev $TARGET_PATH/dev mount --bind /dev/pts $TARGET_PATH/dev/pts mount --bind /dev/shm $TARGET_PATH/dev/shm mount --bind /proc $TARGET_PATH/proc mount --bind /sys $TARGET_PATH/sys
copy cp /usr/bin/qemu-ppc* $TARGET_PATH/usr/bin/ chroot $TARGET_PATH For ppc64 feroa root, above steps fails with below error Invalid instruction NIP 0000004000808ca8 LR 0000004000804d10 CTR 0000000000000000 XER 0000000000000000 MSR 8000000002006000 HID0 0000000060000000 HF 0000000002006000 idx 0 TB 00000000 00000000 GPR00 0000004000804d10 0000004000800130 0000004000849bc0 0000004000800710 GPR04 0000000000000027 0000000000000000 0000000000000000 0000000000000000 GPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24 0000004000800710 0000000000000000 0000000000000000 0000000000000000 GPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 CR 00000000 [ - - - - - - - - ] RES ffffffffffffffff FPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPSCR 0000000000000000 qemu: uncaught target signal 4 (Illegal instruction) - core dumped Illegal instruction (core dumped) For ubuntu ppc64el, above steps fail with below error chroot: failed to run command ?/bin/bash?: Exec format error Userspace tool common name: qemu-ppc64-static The userspace tool has the following bit modes: 64 Userspace rpm: qemu-user-static Userspace tool obtained from project website: na *Additional Instructions for anant...@in.ibm.com: -Post a private note with access information to the machine that the bug is occuring on. -Attach ltrace and strace of userspace application. == Comment: #3 - David Heller <helle...@us.ibm.com> - 2015-06-29 10:46:56 == Please provide some background as to what you are doing here. Looks like it's emulating a ppc env on x86 somehow but I'm not sure if anyone on the screen team is familiar with this. You can provide some example of what the working case is supposed to look like or just attach your test scenario to the bug. I see you are running on the 3.13 kernel. Have you tried this on 3.16 (14.04.2) or 3.19 (14.04.3) kernels? Is the x86 box running bare metal or is this itself running under KVM? == Comment: #4 - YOGANANTH SUBRAMANIAN <anant...@in.ibm.com> - 2015-07-02 05:36:07 == (In reply to comment #3) > Please provide some background as to what you are doing here. Looks like > it's emulating a ppc env on x86 somehow but I'm not sure if anyone on the > screen team is familiar with this. You can provide some example of what the > working case is supposed to look like or just attach your test scenario to > the bug. Hi, I am trying to chroot into filesystem of different architecture. Below is are the working steps for arm arch 1) get a root fileystem of arm, from https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-armhf.tar.gz, and extract it 2) install qemu-user-static 3) chroot preparations Set TARGET_PATH to root of chroot mount --bind /dev $TARGET_PATH/dev mount --bind /dev/pts $TARGET_PATH/dev/pts mount --bind /dev/shm $TARGET_PATH/dev/shm mount --bind /proc $TARGET_PATH/proc mount --bind /sys $TARGET_PATH/sys copy cp /usr/bin/qemu-ppc* $TARGET_PATH/usr/bin/ 4)chroot into the file system chroot $TARGET_PATH inside chroot, you should able to run any command, install packages Following the above step, does not work for power. > > I see you are running on the 3.13 kernel. Have you tried this on 3.16 > (14.04.2) or 3.19 (14.04.3) kernels? > > Is the x86 box running bare metal or is this itself running under KVM? The host mentioned in comment 1 is baremetal and the VM is running under kvm. so the chroot is done in a ubuntu VM . ** Affects: ubuntu Importance: Undecided Status: New ** Tags: architecture-x8664 bugnameltc-126993 severity-medium targetmilestone-inin14043 ** Tags added: architecture-x8664 bugnameltc-126993 severity-medium targetmilestone-inin14043 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1477052 Title: chroot with qemu-ppc64-static fails on x86 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+bug/1477052/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs