mattes
July 11, 2020, 5:46pm
1
trying to setup my build my own image.
P: Running debootstrap second stage under QEMU
chroot: failed to run command ‘/usr/bin/env’: Exec format error
Pretty much followed the ‘docker based’ instructions from here:
https://github.com/radxa/rockchip-bsp
and replaced ‘rockpi4b’ with ‘rockpis’
(see instruction rockpis here: https://wiki.radxa.com/RockpiS/dev/Debian )
after running the docker, I am able to build successfully u-boot and the kernel for the rk3308.
./build/mk-uboot.sh rockpis
./build/mk-kernel.sh rockpis
Building the image gets me an error:
export ARCH=arm64
cd rootfs
sudo apt-get install binfmt-support qemu-user-static cpio gdisk
sudo dpkg -i ubuntu-build-service/packages/*
sudo apt-get install -f
RELEASE=stretch TARGET=base ARCH=$ARCH ./mk-base-debian.sh
…
I: Extracting libsmartcols1…
I: Extracting libuuid1…
I: Extracting mount…
I: Extracting util-linux…
I: Extracting liblzma5…
I: Extracting zlib1g…
P: Running debootstrap second stage under QEMU
chroot: failed to run command ‘/usr/bin/env’: Exec format error
P: Begin unmounting filesystems…
P: Saving caches…
if [ -f binary-tar.tar.gz ]; then
tar -jcf linaro-stretch-alip-date +%Y%m%d-1.config.tar.bz2 auto/ config/ configure;
sudo mv binary.contents linaro-stretch-alip-date +%Y%m%d-1.contents;
sudo mv chroot.packages.live linaro-stretch-alip-date +%Y%m%d-1.packages;
sudo mv binary-tar.tar.gz linaro-stretch-alip-date +%Y%m%d-1.tar.gz;
md5sum linaro-stretch-alip-date +%Y%m%d-1.build-log.txt linaro-stretch-alip-date +%Y%m%d-1.config.tar.bz2 linaro-stretch-alip-date +%Y%m%d-1.contents linaro-stretch-alip-date +%Y%m%d-1.packages linaro-stretch-alip-date +%Y%m%d-1.tar.gz > linaro-stretch-alip-date +%Y%m%d-1.md5sums.txt;
sha1sum linaro-stretch-alip-date +%Y%m%d-1.build-log.txt linaro-stretch-alip-date +%Y%m%d-1.config.tar.bz2 linaro-stretch-alip-date +%Y%m%d-1.contents linaro-stretch-alip-date +%Y%m%d-1.packages linaro-stretch-alip-date +%Y%m%d-1.tar.gz > linaro-stretch-alip-date +%Y%m%d-1.sha1sums.txt;
fi
Failed to run livebuild, please check your network connection.
-------eoq----------------------
Does any body know a fix for this?
The error msg is not telling me much?
any package missing that needs to be installed?
PS: I tried building a rockpi4 image and the same error happens. so it does not seem to be rockpis specific.
igorp
July 11, 2020, 7:02pm
2
mattes
July 14, 2020, 3:46pm
3
thanks igorp,
I will look into that. Does armbian allow you to build minimal images?
mattes
July 14, 2020, 3:54pm
4
I tried to build everything on a fedora 31 system, when I hit the issue with
chroot: failed to run command ‘/usr/bin/env’: Exec format error
I think the build script inside the docker instance tries to execute something that is missing on my fedora machine. does someone has some insides how to debug it so I can find the culprit.
Anyhow, I installed virtualbox running Ubuntu16.04, then followed pretty much the build README step by step. and now everything builds with problem. Finally I have a new system.img. and it works too. Boots the rock PIS board just fine.
c
1 Like
igorp
July 14, 2020, 5:08pm
5
Huh. In theory it should work. Did you come further than:
opened 10:36PM - 15 Mar 20 UTC
closed 10:15PM - 17 Mar 20 UTC
hi, i cloned repository on Fedora 31 where i have docker running just fine.
on… the 1st run:
`./compile docker`
i get message that repo.aptly.info has invalid signature.
I hope there is a solution for non-ubuntu users ?
`
zh@acus:~/git/armbian-build$ sudo ./compile.sh docker
[ o.k. ] This script will try to update
Already up to date.
Already on 'master'
Your branch is up to date with 'origin/master'.
which: no dialog in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
sudo: apt: command not found
sudo: apt: command not found
[ o.k. ] Create example config file using template [ config-default.conf ]
[ o.k. ] Using config file [ /home/zh/git/armbian-build/userpatches/config-docker.conf ]
[ .... ] Docker container not found or out of date
[ .... ] Building a Docker container
Sending build context to Docker daemon 16.38kB
Step 1/10 : FROM ubuntu:18.04
---> 72300a873c2c
Step 2/10 : RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y gnupg gnupg1 gpgv1 --no-install-recommends
---> Using cache
---> 7f5777d6b838
Step 3/10 : RUN sh -c "if [ x"" != x$http_proxy ]; then apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-options http-proxy=$http_proxy --recv-keys ED75B5A4483DA07C >/dev/null 2>&1; else apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ED75B5A4483DA07C >/dev/null 2>&1; fi"
---> Using cache
---> e8dbb94fdc5d
Step 4/10 : RUN echo "deb http://repo.aptly.info/ nightly main" > /etc/apt/sources.list.d/aptly.list
---> Using cache
---> 0e9b15115947
Step 5/10 : RUN dpkg --add-architecture i386
---> Using cache
---> 5febf5db445c
Step 6/10 : RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y upgrade && DEBIAN_FRONTEND=noninteractive apt install -y 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 qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev parted pkg-config libncurses5-dev whiptail debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev nfs-kernel-server btrfs-progs ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross fakeroot xxd curl patchutils python liblz4-tool libpython2.7-dev linux-base swig libpython-dev python3-dev systemd-container udev g++-5-arm-linux-gnueabihf lib32stdc++6 cpio tzdata psmisc acl libc6-i386 lib32ncurses5 lib32tinfo5 locales ncurses-base zlib1g:i386 pixz bison libbison-dev flex libfl-dev pigz aptly aria2 cryptsetup cryptsetup-bin python3-distutils --no-install-recommends
---> Running in c2f02aec48b4
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:5 http://security.ubuntu.com/ubuntu bionic-security/restricted i386 Packages [5385 B]
Get:6 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [567 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/main i386 Packages [1328 kB]
Get:8 http://repo.aptly.info nightly InRelease [7495 B]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/multiverse i386 Packages [4513 B]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [785 kB]
Err:8 http://repo.aptly.info nightly InRelease
The following signatures were invalid: EXPKEYSIG ED75B5A4483DA07C Andrey Smirnov <[email protected] >
Get:11 http://archive.ubuntu.com/ubuntu bionic/restricted i386 Packages [13.5 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/multiverse i386 Packages [177 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages [11.3 MB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/restricted i386 Packages [14.1 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [1296 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [843 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages [8174 B]
Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main i386 Packages [2493 B]
Get:19 http://archive.ubuntu.com/ubuntu bionic-backports/universe i386 Packages [4240 B]
Reading package lists...
W: GPG error: http://repo.aptly.info nightly InRelease: The following signatures were invalid: EXPKEYSIG ED75B5A4483DA07C Andrey Smirnov <[email protected] >
E: The repository 'http://repo.aptly.info nightly InRelease' is not signed.
The command '/bin/sh -c apt update && DEBIAN_FRONTEND=noninteractive apt -y upgrade && DEBIAN_FRONTEND=noninteractive apt install -y 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 qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev parted pkg-config libncurses5-dev whiptail debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev nfs-kernel-server btrfs-progs ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross fakeroot xxd curl patchutils python liblz4-tool libpython2.7-dev linux-base swig libpython-dev python3-dev systemd-container udev g++-5-arm-linux-gnueabihf lib32stdc++6 cpio tzdata psmisc acl libc6-i386 lib32ncurses5 lib32tinfo5 locales ncurses-base zlib1g:i386 pixz bison libbison-dev flex libfl-dev pigz aptly aria2 cryptsetup cryptsetup-bin python3-distutils --no-install-recommends' returned a non-zero code: 100
[ error ] Docker container build exited with code: [ 0 ]
zh@acus:~/git/armbian-build$`
Thank you !
mattes:
Anyhow, I installed virtualbox running Ubuntu16.04, then followed pretty much the build README step by step. and now everything builds with problem. Finally I have a new system.img. and it works too. Boots the rock PIS board just fine.
Great. Now also works on Ubuntu 20.04 … is there 16.04 still in the docs somewhere?
mattes
July 14, 2020, 7:03pm
6
PS: i just used 16.04 because I already had that setup with virtualbox.
FYI: docker itself just run fine on fedora (was installed using dnf/rpm). I was able to build the uboot and kernel without problem. It is only build-rootfs that runs into some debootstrap issues.
missing executable I assume? just don’t know what exactly. Looking at the error msg it could 32/64 bit issue?
igorp
July 14, 2020, 7:37pm
7
Not sure if this error is proper but for building images and writing image directly to SD card you need to enable privileged mode.
Host system must be 64bit for sure.