From 1f8a2cb2f8b6d40cedc594c921e4176681759ae9 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 12 Feb 2021 12:23:53 +0100 Subject: [PATCH] nvidia_linux: Simplify fix for user namespace --- nvidia_linux-5.4.97-368-460.39-0.bee | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/nvidia_linux-5.4.97-368-460.39-0.bee b/nvidia_linux-5.4.97-368-460.39-0.bee index 3e14de049..251b192b7 100755 --- a/nvidia_linux-5.4.97-368-460.39-0.bee +++ b/nvidia_linux-5.4.97-368-460.39-0.bee @@ -21,26 +21,16 @@ sourcesubdir_append kernel : ${BEE_TMP_TMPDIR:=/tmp} +# fix tar option for user namespace usage (`unshare -U -r BEEFILE`) +export TAR_OPTIONS=--no-same-owner + mee_extract() { LINUXBUILDARCHIVE="${BEE_BUILDARCHIVEDIR}/${LINUXPKG}.beebuild.tar.bz2" print_info "extracting nvidia archive .." - # If we are run in a user namespace (unsahre -U -r) we have uid 0. - # tar, when started with uid 0, tries to restore file ownership from the - # archive per default, which we are not allowed to do. - # - # Use a wrapper to add option --no-same-owner to tar. - - mkdir -p $F/tar-wrapper - cat >$F/tar-wrapper/tar <<'EOF' -#! /usr/bin/bash -exec /usr/bin/tar "$@" --no-same-owner -EOF - chmod +x $F/tar-wrapper/tar - start_cmd rmdir ${S} - PATH=$F/tar-wrapper:$PATH start_cmd sh ${F}/${NVIDIA_ARCHIVE} -x --target ${S} + start_cmd sh ${F}/${NVIDIA_ARCHIVE} -x --target ${S} if [ -d "/usr/src/linux/${LINUXPKG}/source" ] ; then LINUXSRCDIR="/usr/src/linux/${LINUXPKG}/source"