Skip to content

Commit 8f2d360

Browse files
committed
update_sdk_container_image: work around sandbox permission errors
This change temporarily disables the Gentoo sandbox when updating the SDK to work around sandbox permission errors some pakage builds (like e.g. GO) run into. Fixes e.g. ``` Building Go cmd/dist using /usr/lib/go-bootstrap. (go1.5.3 linux/amd64) * /var/tmp/portage/sys-apps/sandbox-2.12/work/sandbox-2.12/libsandbox/trace.c:do_peekstr():125: failure (Operation not permitted): * ISE:do_peekstr:process_vm_readv(6863, 0x00007ffe4a502180{0x00007f01abd3e010, 0x570}, 1, 0x00007ffe4a502190{0x000000c820012a90, 0x570}, 1, 0) failed: Operation not permitted * ERROR: dev-lang/go-1.17.8::coreos failed (compile phase): ``` Signed-off-by: Thilo Fromm <[email protected]>
1 parent 4adf8df commit 8f2d360

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

sdk_lib/Dockerfile.sdk-update

+10
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ FROM ${BASE}
44
COPY --chown=sdk:sdk sdk_container/ /mnt/host/source
55
COPY --chown=sdk:sdk . /mnt/host/source/src/scripts
66

7+
# Disable all sandboxing for SDK updates since some core packages
8+
# (like GO) fail to build from a permission error otherwise.
9+
RUN cp /home/sdk/.bashrc /home/sdk/.bashrc.bak
10+
RUN echo 'export FEATURES="-sandbox -usersandbox -ipc-sandbox -network-sandbox -pid-sandbox"' \
11+
>> /home/sdk/.bashrc
12+
713
RUN chown sdk:sdk /mnt/host/source
814
RUN /home/sdk/sdk_entry.sh ./update_chroot --toolchain_boards="amd64-usr arm64-usr"
915

1016
RUN /home/sdk/sdk_entry.sh ./setup_board --board="arm64-usr" --regen_configs
1117
RUN /home/sdk/sdk_entry.sh ./setup_board --board="amd64-usr" --regen_configs
18+
19+
# Restore original .bashrc to remove sandbox disablement
20+
RUN mv /home/sdk/.bashrc.bak /home/sdk/.bashrc
21+
RUN chown sdk:sdk /home/sdk/.bashrc

update_sdk_container_image

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
set -eu
11-
set -x
1211

1312
cd $(dirname "$0")
1413
source sdk_lib/sdk_container_common.sh

0 commit comments

Comments
 (0)