Permission issues building with on MacOS
psychowood opened this issue · 2 comments
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
That is pretty weird. I have no idea why this is happening. But I also do not have any MAC device.
Sorry, I got a little mixed up when creating the PR :)
The problem was solved using ext4 for the cointainer instead of a direct HFS+ bind mount.