diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-12-05 21:32:54 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-12-05 21:33:34 +0000 |
commit | f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e (patch) | |
tree | 3d4b8952e128562d57becb7d063a9353e77e2358 /main/alpine-conf/0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch | |
parent | 905da4096263abd2765d0239eba80e67cca4b556 (diff) | |
download | aports-f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e.tar.bz2 aports-f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e.tar.xz |
main/alpine-conf: add fakeroot fixes for update-kernel
Diffstat (limited to 'main/alpine-conf/0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch')
-rw-r--r-- | main/alpine-conf/0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/main/alpine-conf/0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch b/main/alpine-conf/0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch new file mode 100644 index 0000000000..12cfd7c3b5 --- /dev/null +++ b/main/alpine-conf/0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch @@ -0,0 +1,72 @@ +From f0c288e8d7f6ef3762b7bdd0ede9efca300ba84d Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Mon, 5 Dec 2016 21:06:24 +0000 +Subject: [PATCH 3/3] update-kernel: re-exec under fakeroot unless we are + superuser + +The fakeroot fake-env feature requires that the filesystem if unmodified between the +reloads of the fake-env. We dont comply with this so we re-exec the +entire script in fakeroot instead. +--- + update-kernel.in | 25 ++++++------------------- + 1 file changed, 6 insertions(+), 19 deletions(-) + +diff --git a/update-kernel.in b/update-kernel.in +index 918055a..cd1edc0 100644 +--- a/update-kernel.in ++++ b/update-kernel.in +@@ -14,6 +14,9 @@ VIRTUAL=.tmp-$SCRIPT + + SUPERUSER= + [ $(id -u) -eq 0 ] && SUPERUSER=Y ++if [ -z "$SUPERUSER" ] && [ -z "$FAKEROOTKEY" ]; then ++ exec fakeroot "$0" "$@" ++fi + + ARCH= + BUILDDIR= +@@ -181,28 +184,12 @@ fi + TMPDIR=$(mktemp -d /tmp/$SCRIPT.XXXXXX) + ROOT=$TMPDIR/root + BOOT=$ROOT/boot +-WRAPPER= +- +-_exec() { +- $WRAPPER "$@" +-} + + _apk() { + local cmd=$1 + shift + +- local wrapper= +- if [ -z "$SUPERUSER" ]; then +- local opt= +- local fake_env=$TMPDIR/fake-env +- if [ -f $fake_env ]; then +- opt="-i $fake_env" +- WRAPPER="fakeroot $opt --" +- fi +- wrapper="fakeroot $opt -s $fake_env --" +- fi +- +- $wrapper apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \ ++ apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \ + --keys-dir /etc/apk/keys \ + --repositories-file "$REPOSITORIES_FILE" $* + } +@@ -261,9 +248,9 @@ find $ROOT/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort - + install -pD $ROOT/lib/firmware/$FW $MODLOOP/modules/firmware/$FW + fi + done +-_exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz -exit-on-error ++mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz -exit-on-error + +-_exec mkinitfs $MKINITFS_ARGS -q -b $ROOT -F "$features base squashfs" \ ++mkinitfs $MKINITFS_ARGS -q -b $ROOT -F "$features base squashfs" \ + -o "$STAGING/initramfs-$FLAVOR" "$KVER" + + for file in System.map config vmlinuz; do +-- +2.11.0 + |