From 459fcb89c6ec32d7ddc38fe95582d0d78e5fe92a Mon Sep 17 00:00:00 2001 From: flatcar-ci Date: Wed, 5 Jan 2022 17:25:51 +0100 Subject: [PATCH] sdk_lib/sdk_entry.sh: use a login shell to source /etc/profile For execution of the compiled binaries in /build/arm64-usr we rely on qemu-user binfmt emulation and have to tell it where the root is with QEMU_LD_PREFIX because build systems don't chroot into /build/arm64-usr themselves (which also works just by chance on amd64 because we have similar glibc versions and so on). The env var setup was done in /etc/profile.d/qemu-aarch64.sh but is now not read anymore since the container runs the shell not as login shell. Add the login options to the bash and su calls when starting the container. --- sdk_lib/sdk_entry.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk_lib/sdk_entry.sh b/sdk_lib/sdk_entry.sh index 7708a49a4e..03fab1cb8c 100755 --- a/sdk_lib/sdk_entry.sh +++ b/sdk_lib/sdk_entry.sh @@ -22,7 +22,7 @@ chown -R sdk:sdk /home/sdk # our quotes for su -c "" already. if [ $# -gt 0 ] ; then cmd="/home/sdk/.cmd" - echo -n "exec bash -i -c '" >"$cmd" + echo -n "exec bash -l -i -c '" >"$cmd" for arg in "$@"; do echo -n "\"$arg\" " >>"$cmd" done @@ -33,5 +33,5 @@ if [ $# -gt 0 ] ; then rm -f "$cmd" exit $rc else - exec sudo su sdk + exec sudo su -l sdk fi