aboutsummaryrefslogtreecommitdiffstats
path: root/main/alpine-conf
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-12-05 21:32:54 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2016-12-05 21:33:34 +0000
commitf5cb59b3beb9454345e0c5dfb74e99d4c1bf190e (patch)
tree3d4b8952e128562d57becb7d063a9353e77e2358 /main/alpine-conf
parent905da4096263abd2765d0239eba80e67cca4b556 (diff)
downloadaports-f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e.tar.bz2
aports-f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e.tar.xz
main/alpine-conf: add fakeroot fixes for update-kernel
Diffstat (limited to 'main/alpine-conf')
-rw-r--r--main/alpine-conf/0001-update-kernel-make-mksquashfs-exit-on-error.patch2
-rw-r--r--main/alpine-conf/0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch36
-rw-r--r--main/alpine-conf/0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch72
-rw-r--r--main/alpine-conf/APKBUILD16
4 files changed, 121 insertions, 5 deletions
diff --git a/main/alpine-conf/0001-update-kernel-make-mksquashfs-exit-on-error.patch b/main/alpine-conf/0001-update-kernel-make-mksquashfs-exit-on-error.patch
index 04f0721de0..54ea2b21fb 100644
--- a/main/alpine-conf/0001-update-kernel-make-mksquashfs-exit-on-error.patch
+++ b/main/alpine-conf/0001-update-kernel-make-mksquashfs-exit-on-error.patch
@@ -1,7 +1,7 @@
From 0bd627de56f28063d9fcef455587d0b7d11a00a6 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 2 Dec 2016 21:29:51 +0000
-Subject: [PATCH] update-kernel: make mksquashfs exit on error
+Subject: [PATCH 1/3] update-kernel: make mksquashfs exit on error
mksquashfs will ignore errors and continue by default by design. This is
definitively not the behavior we want so we tell it to explicitly exit
diff --git a/main/alpine-conf/0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch b/main/alpine-conf/0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch
new file mode 100644
index 0000000000..a7fe05a360
--- /dev/null
+++ b/main/alpine-conf/0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch
@@ -0,0 +1,36 @@
+From 439c020e268830965fd5ee90147e93e753855caf Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 5 Dec 2016 21:05:51 +0000
+Subject: [PATCH 2/3] update-kernel: don't install deps if script runs in
+ fakeroot
+
+---
+ update-kernel.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/update-kernel.in b/update-kernel.in
+index 6d24649..918055a 100644
+--- a/update-kernel.in
++++ b/update-kernel.in
+@@ -154,14 +154,16 @@ clean_up() {
+ set +e
+ ignore_sigs
+
+- [ "$SUPERUSER" ] && apk del $QUIET_OPT $VIRTUAL
++ if [ "$SUPERUSER" ] && [ -z "$FAKEROOTKEY" ]; then
++ apk del $QUIET_OPT $VIRTUAL
++ fi
+ rm -fr $TMPDIR
+ }
+
+ trap clean_up EXIT $SIGNALS
+
+
+-if [ "$SUPERUSER" ]; then
++if [ "$SUPERUSER" ] && [ -z "$FAKEROOTKEY" ]; then
+ apk add $QUIET_OPT --update-cache -t $VIRTUAL mkinitfs squashfs-tools kmod
+ fi
+
+--
+2.11.0
+
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
+
diff --git a/main/alpine-conf/APKBUILD b/main/alpine-conf/APKBUILD
index 249a5b2f04..f53f4abfe0 100644
--- a/main/alpine-conf/APKBUILD
+++ b/main/alpine-conf/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=alpine-conf
pkgver=3.5.0_rc1
-pkgrel=1
+pkgrel=2
pkgdesc="Alpine configuration management scripts"
url=http://git.alpinelinux.org/cgit/$pkgname
arch="all"
@@ -9,6 +9,8 @@ license="MIT"
depends="openrc>0.13"
source="http://dev.alpinelinux.org/archive/alpine-conf/alpine-conf-$pkgver.tar.xz
0001-update-kernel-make-mksquashfs-exit-on-error.patch
+ 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch
+ 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch
"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -26,8 +28,14 @@ package() {
}
md5sums="41e9c47129275bee279170afa7c25925 alpine-conf-3.5.0_rc1.tar.xz
-d816842b84cab6ea988368e690a89d2d 0001-update-kernel-make-mksquashfs-exit-on-error.patch"
+66238028becd1a648780a7522a71a169 0001-update-kernel-make-mksquashfs-exit-on-error.patch
+e85a35805f18a130e1dcba998356e9ca 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch
+eb6c5e86ae571d8fc70a65bbcf947525 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch"
sha256sums="d93733e2dd630fc5627ec1eb71a71f633bcda7c75f3b65593542dc0a756bd580 alpine-conf-3.5.0_rc1.tar.xz
-ce316da5b3b3d5300a72aa5b5cbb7ad057859bec127337b7bf52c271f5aa746c 0001-update-kernel-make-mksquashfs-exit-on-error.patch"
+8623350fff0f9456137341209172fe1d139035d42d01f16b90a5f6dceadb5d54 0001-update-kernel-make-mksquashfs-exit-on-error.patch
+9089418ca27148a33ba39b601d0b2c7808cc8315cebcb017583bfa8e80edbe2c 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch
+661534c6828e4cca9398bb74563d51b7661b028241cdcac717614354779ad9ce 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch"
sha512sums="9b77085ba719bdcfc9f9b186636f1724528270eed29e8e266fa947c91e4ee86e6253405c73b59a7977763da6e85089b57a80fd09457120a8394f5d1c786bf29b alpine-conf-3.5.0_rc1.tar.xz
-af620eb0029bf4a8466986ca82966325467d77f05dc9e56771583737e3af19cb2bf33b461095aa17eb913d7eecee57df5747ec5f753482f022d02c24bd1c95ea 0001-update-kernel-make-mksquashfs-exit-on-error.patch"
+62af2f385a8431696fefb1206e37624605cbab998c59691490ac14435e1487b6a745e678ea8a760ff5c322c6349479def18b25fed6783a802875785f366a6279 0001-update-kernel-make-mksquashfs-exit-on-error.patch
+6b08fd7d2703c26d1353022484793597d20b927a37c886ec87e82c4661bf7f562e3a48007a1d659953ec06530355a9f31072923f7160bf4e1999c6a550cf19d6 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch
+4ff581357e9d03431f5c45ed9badac51cce23e5f9241230ac2d48b6ba6823129c293577f4030b6c8fcb036d7a6fb5830f3b9e10b1dd0228179d1232d0ea3fca3 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch"