Closed darren closed 6 years ago
The actual command fails is:
root@f3031c7d94df:/home/khadas/fenix# chroot /home/khadas/fenix/build/images/.tmp/rootfs-VIM2-stretch-server /bin/bash -c '/debootstrap/debootstrap --second-stage'
chroot: failed to run command ‘/bin/bash’: Exec format error
Hello Darren,
What's the system of your host PC?
Do you use the dockerfile we provided to create the docker environment?
Thanks.
@numbqq
Many Thanks for your great work that makes building the image easy for us.
I think I may have found the problem: something's wrong with qemu and binfmt support. And I made these changes(switch to debian, because I can not find libc:arm64 for ubuntu bionic)
diff --git a/Dockerfile b/Dockerfile
index f150c29..8694695 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
-FROM ubuntu:18.04
-RUN dpkg --add-architecture i386
+FROM debian
+RUN dpkg --add-architecture arm64
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -y sudo git dialog lsb-release binutils wget ca-certificates device-tree-compiler \
pv bc lzop zip binfmt-support build-essential ccache debootstrap ntpdate gawk gcc-arm-linux-gnueabihf \
@@ -7,8 +7,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade &&
debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev nfs-kernel-server btrfs-tools \
ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross fakeroot \
curl patchutils python liblz4-tool libpython2.7-dev linux-base swig libpython-dev aptly acl\
- systemd-container udev g++-5-arm-linux-gnueabihf lib32stdc++6 \
- libc6-i386 lib32ncurses5 lib32tinfo5 locales ncurses-base zlib1g:i386 pixz bison libbison-dev flex libfl-dev lib32z1 tzdata cpio
+ systemd-container udev g++-6-arm-linux-gnueabihf lib32stdc++6 \
+ libc6:arm64 lib32ncurses5 lib32tinfo5 locales ncurses-base zlib1g pixz bison libbison-dev flex libfl-dev lib32z1 tzdata cpio apt-utils
RUN locale-gen en_US.UTF-8
and Now I met another problem:
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
mount: /home/khadas/fenix/build/images/rootfs.img: failed to setup loop device: No such file or directory
Cleanup...
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 32
root@f34268c07bc7:/home/khadas/fenix# mount -o loop /home/khadas/fenix/build/images/rootfs.img /mnt
mount: /home/khadas/fenix/build/images/rootfs.img: failed to setup loop device: No such file or directory
It seems that loop is not working in docker, I shall dig it further.
the loop problem can be fixed by running:
mknod /dev/loop0 -m0660 b 7 0
finally got the image:
Pack image[/home/khadas/fenix/build/images/VIM2_Debian-server-stretch_Linux-4.9_arm64_EMMC_2018-08-04.img] OK
Info: IMAGE: /home/khadas/fenix/build/images/VIM2_Debian-server-stretch_Linux-4.9_arm64_EMMC_2018-08-04.img
Cleanup...
Done.
My Host PC is Debian 9.5 on intel NUC
OK. Haven't tried on Debian build host yet.
Glad to see you fixup it. Can you boot the image well?
Thanks.
@numbqq
hmmm, no luck, the image built in docker can not boot, do not know why...
Then I tried building in a Ubuntu Xenial 16.04 x64
host, burn the image, and it boots ok..
hmmm, no luck, the image built in docker can not boot, do not know why...
OK. I will look into this issue...
Hello @Darren ,
This issue has been fixed https://github.com/khadas/fenix/commit/5e3bd927671716c6e7c2f3696d3eee39944188ce
You don't need to modify the Dockerfile
, just install qemu-user-static
on your Debian host.
$ sudo apt-get install qemu-user-static
And try to build in Docker.
Thanks.
FYI I got the same issue even though qemu-user-static was installed on the host. I am not using docker.
===========================================
#VERSION: 0.4
#KHADAS_BOARD=VIM2
#VENDOR=Amlogic
#CHIP=S912
#LINUX=4.9
#UBOOT=2015.01
#DISTRIBUTION=Ubuntu
#DISTRIB_RELEASE=xenial
#DISTRIB_TYPE=server
#DISTRIB_ARCH=arm64
#INSTALL_TYPE=EMMC
===========================================
The problem seems to be that I don't have the binfmt_misc module installed (or available) on my host.
The problem seems to be that I don't have the binfmt_misc module installed (or available) on my host.
What's your host OS?
When you install the binfmt_misc module
does it works?
fixup https://github.com/khadas/fenix/commit/ffd5759c26f8a2af9c319b98917d82dba3d25012
Try to build on NUC, it fails when running
/home/khadas/fenix/scripts/rootfs_stage.sh
part of the logs:Any clues?