mwarning / docker-openwrt-build-env Goto Github PK
View Code? Open in Web Editor NEWA Docker container to build OpenWrt images
A Docker container to build OpenWrt images
When using the alpine branch, I'm seeing (may also affect master branch):
Build dependency: Please install 'rsync'
Prerequisite check failed. Use FORCE=1 to override.
make: *** [/home/user/openwrt/include/toplevel.mk:180: staging_dir/host/.prereq-build] Error 1
IMHO rsync is missing in your Dockerfile
Hi,
First of all, thanks :)
I've been using your docker image for building succesfully an openwrt image under linux (well, technically is BurmillaOS).
Today I tried under MacOS since I've got some CPU to spare and I wanted to see if it was faster, but I'm hitting a blocking issue I'd like to address.
I follower the instruction, created an image with hdutil (with the only difference I created a sparsebundle image instead of a thick preallocated one) and set up the environment.
I've been using the very same script I use in the linux cointainer, and the build fails. Basically, it looks like that when the build script finds the a patch to apply, the patch command creates a temporary file in ./tmp that has a blank permissions mask, thus stopping because it cannot read/write the file.
It first stopped on the sed
build, I got rid manually of that file (just in case there was something wrong on that patch), and it stopped at the subsequent patch, on the tar
build.
Here is the error:
user@baeabdcd8196:~/openwrt-armor-g5-nbg7815$ make -j1 V=s
make[2]: Entering directory '/home/user/openwrt-armor-g5-nbg7815/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815/scripts/config'
make[1]: Entering directory '/home/user/openwrt-armor-g5-nbg7815'
make[2]: Entering directory '/home/user/openwrt-armor-g5-nbg7815'
+ mkdir -p /home/user/openwrt-armor-g5-nbg7815/staging_dir/target-aarch64_cortex-a53_musl
+ cd /home/user/openwrt-armor-g5-nbg7815/staging_dir/target-aarch64_cortex-a53_musl
+ mkdir -p bin lib stamp usr/include usr/lib
mkdir -p /home/user/openwrt-armor-g5-nbg7815/build_dir/target-aarch64_cortex-a53_musl/stamp
touch /home/user/openwrt-armor-g5-nbg7815/staging_dir/target-aarch64_cortex-a53_musl/.prepared
+ mkdir -p /home/user/openwrt-armor-g5-nbg7815/staging_dir/host
+ cd /home/user/openwrt-armor-g5-nbg7815/staging_dir/host
+ mkdir -p bin lib stamp usr/include usr/lib
mkdir -p /home/user/openwrt-armor-g5-nbg7815/build_dir/host/stamp /home/user/openwrt-armor-g5-nbg7815/staging_dir/host/include/sys
install -m0644 /home/user/openwrt-armor-g5-nbg7815/tools/include/*.h /home/user/openwrt-armor-g5-nbg7815/staging_dir/host/include/
install -m0644 /home/user/openwrt-armor-g5-nbg7815/tools/include/sys/*.h /home/user/openwrt-armor-g5-nbg7815/staging_dir/host/include/sys/
ln -snf lib /home/user/openwrt-armor-g5-nbg7815/staging_dir/host/lib64
touch /home/user/openwrt-armor-g5-nbg7815/staging_dir/host/.prepared
make[3]: Entering directory '/home/user/openwrt-armor-g5-nbg7815/tools/flock'
make[3]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815/tools/flock'
time: tools/flock/compile#0.04#0.08#0.15
make[3]: Entering directory '/home/user/openwrt-armor-g5-nbg7815/tools/xz'
make[3]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815/tools/xz'
time: tools/xz/compile#0.07#0.14#0.26
make[3]: Entering directory '/home/user/openwrt-armor-g5-nbg7815/tools/sed'
make[3]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815/tools/sed'
time: tools/sed/compile#0.06#0.25#0.44
make[3]: Entering directory '/home/user/openwrt-armor-g5-nbg7815/tools/libdeflate'
make[3]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815/tools/libdeflate'
time: tools/libdeflate/compile#0.06#0.11#0.20
make[3]: Entering directory '/home/user/openwrt-armor-g5-nbg7815/tools/patch'
. /home/user/openwrt-armor-g5-nbg7815/include/shell.sh; xzcat /home/user/openwrt-armor-g5-nbg7815/dl/patch-2.7.6.tar.xz | tar -C /home/user/openwrt-armor-g5-nbg7815/build_dir/host/patch-2.7.6/.. -xf -
[ ! -d ./src/ ] || cp -fpR ./src/* /home/user/openwrt-armor-g5-nbg7815/build_dir/host/patch-2.7.6
Applying ./patches/010-CVE-2018-6951.patch using plaintext:
patch: **** Can't create temporary file /home/user/openwrt-armor-g5-nbg7815/tmp/ppENAy41 : Permission denied
Patch failed! Please fix ./patches/010-CVE-2018-6951.patch!
make[3]: *** [Makefile:35: /home/user/openwrt-armor-g5-nbg7815/build_dir/host/patch-2.7.6/.prepared933ecb9275b73ed93ed986e01f2d7a35_6664517399ebbbc92a37c5bb081b5c53] Error 1
make[3]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815/tools/patch'
time: tools/patch/compile#0.20#0.81#1.74
ERROR: tools/patch failed to build.
make[2]: *** [tools/Makefile:226: tools/patch/compile] Error 1
make[2]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815'
make[1]: *** [tools/Makefile:222: /home/user/openwrt-armor-g5-nbg7815/staging_dir/host/stamp/.tools_compile_nyyynyynnnyyynynyyyyyyynyyynnynyynnynnyyyyyyyyyyyyyyyyynynnyyyyyyy] Error 2
make[1]: Leaving directory '/home/user/openwrt-armor-g5-nbg7815'
make: *** [/home/user/openwrt-armor-g5-nbg7815/include/toplevel.mk:232: world] Error 2
Looking in the ./tmp directory can be found the bad files. If I delete them manually, a new one will be created on the next build run.
user@baeabdcd8196:~/openwrt-armor-g5-nbg7815$ ls -l /home/user/openwrt-armor-g5-nbg7815/tmp/
ls: cannot access '/home/user/openwrt-armor-g5-nbg7815/tmp/ppENAy41': Permission denied
total 20
-rwxr-xr-x 1 user user 16448 Jun 18 14:35 a.out
drwxr-xr-x 2 user user 65416 Jun 18 15:46 info
-????????? ? ? ? ? ? ppENAy41
-rw-r--r-- 1 user user 0 Jun 18 14:34 test.fs
From outside the cointainer, the file is visible, with an empty mask, but at least the owner seems correct...
➜ tmp git:(nbg7815-test) ✗ ls -l
total 40
-rwxr-xr-x@ 1 gg staff 16448 Jun 18 16:35 a.out
drwxr-xr-x@ 2 gg staff 65416 Jun 18 17:46 info
---------- 1 gg staff 0 Jun 18 17:46 ppENAy41
-rw-r--r--@ 1 gg staff 0 Jun 18 16:34 test.fs
Any ideas?
TIA
Hey,
first of all, thanks for this. Whenever I have to compile the kernel or parts of any project, I always have to jump through multiple hoops in order to get the build process to work only to notice that after an hour it still fails. This image helped me so much to speed up the process.
I only have one issue when trying to build the v23.05.2 image for my Raspberry Pi 4B
Similar to here, here and here I'm getting this error:
make[3]: Entering directory '/home/user/openwrt/package/network/utils/xdp-tools'
rm -f /home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9/.built
touch /home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9/.built_check
CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9=xdp-tools-1.2.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/usr/include -I/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/include/fortify -I/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/include " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9=xdp-tools-1.2.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/usr/include -I/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/include/fortify -I/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/include " LDFLAGS="-L/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/usr/lib -L/home/user/openwrt/staging_dir/toolchain-aarch64_cortex-a72_gcc-12.3.0_musl/lib -znow -zrelro " PREFIX=/usr RUNDIR=/tmp/run make -C /home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9/. AR="aarch64-openwrt-linux-musl-gcc-ar" AS="aarch64-openwrt-linux-musl-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9=xdp-tools-1.2.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " LD=aarch64-openwrt-linux-musl-ld NM="aarch64-openwrt-linux-musl-gcc-nm" CC="aarch64-openwrt-linux-musl-gcc" GCC="aarch64-openwrt-linux-musl-gcc" CXX="aarch64-openwrt-linux-musl-g++" RANLIB="aarch64-openwrt-linux-musl-gcc-ranlib" STRIP=aarch64-openwrt-linux-musl-strip OBJCOPY=aarch64-openwrt-linux-musl-objcopy OBJDUMP=aarch64-openwrt-linux-musl-objdump SIZE=aarch64-openwrt-linux-musl-size CROSS="aarch64-openwrt-linux-musl-" ARCH="aarch64" ;
make[4]: Entering directory '/home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9'
lib
libxdp
CC staticobjs/libxdp.o
CC staticobjs/xsk.o
CLANG xdp-dispatcher.o
In file included from xdp-dispatcher.c:3:
In file included from ../../headers/linux/bpf.h:11:
/usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
#include <asm/types.h>
^~~~~~~~~~~~~
1 error generated.
make[6]: *** [Makefile:139: xdp-dispatcher.o] Error 1
make[5]: *** [Makefile:20: libxdp] Error 2
make[4]: *** [Makefile:25: lib] Error 2
make[4]: Leaving directory '/home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9'
make[3]: *** [Makefile:139: /home/user/openwrt/build_dir/target-aarch64_cortex-a72_musl/xdp-tools-1.2.9/.built] Error 2
make[3]: Leaving directory '/home/user/openwrt/package/network/utils/xdp-tools'
time: package/network/utils/xdp-tools/compile#2.35#0.27#2.55
ERROR: package/network/utils/xdp-tools failed to build.
make[2]: *** [package/Makefile:128: package/network/utils/xdp-tools/compile] Error 1
make[2]: Leaving directory '/home/user/openwrt'
make[1]: *** [package/Makefile:122: /home/user/openwrt/staging_dir/target-aarch64_cortex-a72_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/user/openwrt'
make: *** [/home/user/openwrt/include/toplevel.mk:232: world] Error 2
The solution according to this comment is to install gcc-multilib
.
Should I open a PR or is this image only intended for x86_64 targets?
first of all thank you for the great work. literally saved me hours of work.
Only change I would make is to add language in the readme to create a case sensitive disk image to work on when using this docker if you are working on a non case sensitive os.
thanks again for the great work!
Is there a specific reason that the oldoldstable debian release "buster" is being used and not the current stable "bookworm" release?
sudo apt-get -y install qemu-utils
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.