building arm64 images on amd64 fails

Bug #1699536 reported by Amrith Kumar on 2017-06-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Undecided
Unassigned

Bug Description

I'm attempting to build an arm64 ubuntu image on an x86-64 ubuntu machine.

My command is:

amrith@amrith-virtual-machine:~/images$ disk-image-create -o u64-arm64 -t qcow2 -a arm64 -x ubuntu

Initially I ran into to an error about 'exec format error'. I found:

https://bugs.launchpad.net/diskimage-builder/+bug/1332458

and installed qemu-user and qemu-user-static. It now fails, but in a different way ... So I guess there's still (or maybe again) something wrong. Complete log file is attached.

+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_in_target:64 : HOME=/root
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_in_target:70 : sudo -E chroot /tmp/dib_build.XMCBrayl/mnt env -u TMPDIR -u VIRTUAL_ENV 'PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' sh -c '/tmp/in_target.d/dib-run-parts /tmp/in_target.d/pre-install.d'
chroot: failed to run command 'env': No such file or directory
++ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_in_target:70 : check_break after-error run_in_target bash
++ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:check_break:123 : egrep -e '(,|^)after-error(,|$)' -q
++ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:check_break:123 : echo ''
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_in_target:1 : trap_cleanup
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:trap_cleanup:47 : exitval=127
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:trap_cleanup:48 : cleanup
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:cleanup:53 : dib-block-device umount

Amrith Kumar (amrith) wrote :
Ian Wienand (iwienand) wrote :

> sudo -E chroot /tmp/dib_build.98HoVIqX/mnt env

this would probably be the first time it tries to run inside the chroot

the "no such file or directory" is quite possibly a red-herring, I feel like it's more likely to be the interpreter missing...

But can we confirm the "bin/env" binary is there? via a manual poke in the /mnt directory (can check the the downloaded cloud image ... but it must be, it's part of coreutils? unless it's some busybox thing and not there?)

Amrith Kumar (amrith) wrote :
Download full text (4.1 KiB)

Ian, I instrumented diskimage_builder/lib/img-functions and dropped into a shell in the run_in_target() function.

I was able to positively confirm that env did in fact exist in /usr/bin/env and that is in fact one of the elements being added to path.

See below from a brief debug session.

dib-run-parts Sat Jun 24 06:20:36 EDT 2017 --------------------- END PROFILING ---------------------
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:run_d:239 : check_break after-extra-data bash
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:check_break:123 : egrep -e '(,|^)after-extra-data(,|$)' -q
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:check_break:123 : echo ''
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/disk-image-create:main:303 : run_d_in_target pre-install
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:77 : check_element
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:check_element:134 : '[' -d /tmp/dib_build.P474LCge/hooks ']'
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:80 : '[' -d /tmp/dib_build.P474LCge/hooks/pre-install.d ']'
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:81 : sudo mkdir /tmp/dib_build.P474LCge/mnt/tmp/in_target.d
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:82 : sudo mount --bind /tmp/dib_build.P474LCge/hooks /tmp/dib_build.P474LCge/mnt/tmp/in_target.d
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:88 : sudo cp /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/dib-run-parts /tmp/dib_build.P474LCge/mnt/tmp/in_target.d
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:89 : sudo mount -o remount,ro,bind /tmp/dib_build.P474LCge/hooks /tmp/dib_build.P474LCge/mnt/tmp/in_target.d
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:90 : check_break before-pre-install run_in_target bash
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:check_break:123 : egrep -e '(,|^)before-pre-install(,|$)' -q
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/common-functions:check_break:123 : echo ''
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:91 : '[' -z '' ']'
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:91 : in_target_arg=run_in_target
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:92 : trap 'check_break after-error run_in_target bash' ERR
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_d_in_target:95 : run_in_target /tmp/in_target.d/dib-run-parts /tmp/in_target.d/pre-install.d
+ /usr/local/lib/python2.7/dist-packages/diskimage_builder/lib/img-functions:run_in_target:61 : cmd='/tmp/in_target.d/dib-run-parts /tmp/in_tar...

Read more...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments