Skip to content

Commit

Permalink
nvidia_linux: Simplify fix for user namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Feb 12, 2021
1 parent e6fe805 commit 1f8a2cb
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions nvidia_linux-5.4.97-368-460.39-0.bee
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1f8a2cb

Please sign in to comment.