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 | |
parent | 905da4096263abd2765d0239eba80e67cca4b556 (diff) | |
download | alpine_aports-f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e.tar.bz2 alpine_aports-f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e.tar.xz alpine_aports-f5cb59b3beb9454345e0c5dfb74e99d4c1bf190e.zip |
main/alpine-conf: add fakeroot fixes for update-kernel
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 @@ | |||
1 | From 0bd627de56f28063d9fcef455587d0b7d11a00a6 Mon Sep 17 00:00:00 2001 | 1 | From 0bd627de56f28063d9fcef455587d0b7d11a00a6 Mon Sep 17 00:00:00 2001 |
2 | From: Natanael Copa <ncopa@alpinelinux.org> | 2 | From: Natanael Copa <ncopa@alpinelinux.org> |
3 | Date: Fri, 2 Dec 2016 21:29:51 +0000 | 3 | Date: Fri, 2 Dec 2016 21:29:51 +0000 |
4 | Subject: [PATCH] update-kernel: make mksquashfs exit on error | 4 | Subject: [PATCH 1/3] update-kernel: make mksquashfs exit on error |
5 | 5 | ||
6 | mksquashfs will ignore errors and continue by default by design. This is | 6 | mksquashfs will ignore errors and continue by default by design. This is |
7 | definitively not the behavior we want so we tell it to explicitly exit | 7 | 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 @@ | |||
1 | From 439c020e268830965fd5ee90147e93e753855caf Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Mon, 5 Dec 2016 21:05:51 +0000 | ||
4 | Subject: [PATCH 2/3] update-kernel: don't install deps if script runs in | ||
5 | fakeroot | ||
6 | |||
7 | --- | ||
8 | update-kernel.in | 6 ++++-- | ||
9 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/update-kernel.in b/update-kernel.in | ||
12 | index 6d24649..918055a 100644 | ||
13 | --- a/update-kernel.in | ||
14 | +++ b/update-kernel.in | ||
15 | @@ -154,14 +154,16 @@ clean_up() { | ||
16 | set +e | ||
17 | ignore_sigs | ||
18 | |||
19 | - [ "$SUPERUSER" ] && apk del $QUIET_OPT $VIRTUAL | ||
20 | + if [ "$SUPERUSER" ] && [ -z "$FAKEROOTKEY" ]; then | ||
21 | + apk del $QUIET_OPT $VIRTUAL | ||
22 | + fi | ||
23 | rm -fr $TMPDIR | ||
24 | } | ||
25 | |||
26 | trap clean_up EXIT $SIGNALS | ||
27 | |||
28 | |||
29 | -if [ "$SUPERUSER" ]; then | ||
30 | +if [ "$SUPERUSER" ] && [ -z "$FAKEROOTKEY" ]; then | ||
31 | apk add $QUIET_OPT --update-cache -t $VIRTUAL mkinitfs squashfs-tools kmod | ||
32 | fi | ||
33 | |||
34 | -- | ||
35 | 2.11.0 | ||
36 | |||
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 @@ | |||
1 | From f0c288e8d7f6ef3762b7bdd0ede9efca300ba84d Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Mon, 5 Dec 2016 21:06:24 +0000 | ||
4 | Subject: [PATCH 3/3] update-kernel: re-exec under fakeroot unless we are | ||
5 | superuser | ||
6 | |||
7 | The fakeroot fake-env feature requires that the filesystem if unmodified between the | ||
8 | reloads of the fake-env. We dont comply with this so we re-exec the | ||
9 | entire script in fakeroot instead. | ||
10 | --- | ||
11 | update-kernel.in | 25 ++++++------------------- | ||
12 | 1 file changed, 6 insertions(+), 19 deletions(-) | ||
13 | |||
14 | diff --git a/update-kernel.in b/update-kernel.in | ||
15 | index 918055a..cd1edc0 100644 | ||
16 | --- a/update-kernel.in | ||
17 | +++ b/update-kernel.in | ||
18 | @@ -14,6 +14,9 @@ VIRTUAL=.tmp-$SCRIPT | ||
19 | |||
20 | SUPERUSER= | ||
21 | [ $(id -u) -eq 0 ] && SUPERUSER=Y | ||
22 | +if [ -z "$SUPERUSER" ] && [ -z "$FAKEROOTKEY" ]; then | ||
23 | + exec fakeroot "$0" "$@" | ||
24 | +fi | ||
25 | |||
26 | ARCH= | ||
27 | BUILDDIR= | ||
28 | @@ -181,28 +184,12 @@ fi | ||
29 | TMPDIR=$(mktemp -d /tmp/$SCRIPT.XXXXXX) | ||
30 | ROOT=$TMPDIR/root | ||
31 | BOOT=$ROOT/boot | ||
32 | -WRAPPER= | ||
33 | - | ||
34 | -_exec() { | ||
35 | - $WRAPPER "$@" | ||
36 | -} | ||
37 | |||
38 | _apk() { | ||
39 | local cmd=$1 | ||
40 | shift | ||
41 | |||
42 | - local wrapper= | ||
43 | - if [ -z "$SUPERUSER" ]; then | ||
44 | - local opt= | ||
45 | - local fake_env=$TMPDIR/fake-env | ||
46 | - if [ -f $fake_env ]; then | ||
47 | - opt="-i $fake_env" | ||
48 | - WRAPPER="fakeroot $opt --" | ||
49 | - fi | ||
50 | - wrapper="fakeroot $opt -s $fake_env --" | ||
51 | - fi | ||
52 | - | ||
53 | - $wrapper apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \ | ||
54 | + apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \ | ||
55 | --keys-dir /etc/apk/keys \ | ||
56 | --repositories-file "$REPOSITORIES_FILE" $* | ||
57 | } | ||
58 | @@ -261,9 +248,9 @@ find $ROOT/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort - | ||
59 | install -pD $ROOT/lib/firmware/$FW $MODLOOP/modules/firmware/$FW | ||
60 | fi | ||
61 | done | ||
62 | -_exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz -exit-on-error | ||
63 | +mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz -exit-on-error | ||
64 | |||
65 | -_exec mkinitfs $MKINITFS_ARGS -q -b $ROOT -F "$features base squashfs" \ | ||
66 | +mkinitfs $MKINITFS_ARGS -q -b $ROOT -F "$features base squashfs" \ | ||
67 | -o "$STAGING/initramfs-$FLAVOR" "$KVER" | ||
68 | |||
69 | for file in System.map config vmlinuz; do | ||
70 | -- | ||
71 | 2.11.0 | ||
72 | |||
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 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=alpine-conf | 2 | pkgname=alpine-conf |
3 | pkgver=3.5.0_rc1 | 3 | pkgver=3.5.0_rc1 |
4 | pkgrel=1 | 4 | pkgrel=2 |
5 | pkgdesc="Alpine configuration management scripts" | 5 | pkgdesc="Alpine configuration management scripts" |
6 | url=http://git.alpinelinux.org/cgit/$pkgname | 6 | url=http://git.alpinelinux.org/cgit/$pkgname |
7 | arch="all" | 7 | arch="all" |
@@ -9,6 +9,8 @@ license="MIT" | |||
9 | depends="openrc>0.13" | 9 | depends="openrc>0.13" |
10 | source="http://dev.alpinelinux.org/archive/alpine-conf/alpine-conf-$pkgver.tar.xz | 10 | source="http://dev.alpinelinux.org/archive/alpine-conf/alpine-conf-$pkgver.tar.xz |
11 | 0001-update-kernel-make-mksquashfs-exit-on-error.patch | 11 | 0001-update-kernel-make-mksquashfs-exit-on-error.patch |
12 | 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch | ||
13 | 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch | ||
12 | " | 14 | " |
13 | 15 | ||
14 | _builddir="$srcdir"/$pkgname-$pkgver | 16 | _builddir="$srcdir"/$pkgname-$pkgver |
@@ -26,8 +28,14 @@ package() { | |||
26 | } | 28 | } |
27 | 29 | ||
28 | md5sums="41e9c47129275bee279170afa7c25925 alpine-conf-3.5.0_rc1.tar.xz | 30 | md5sums="41e9c47129275bee279170afa7c25925 alpine-conf-3.5.0_rc1.tar.xz |
29 | d816842b84cab6ea988368e690a89d2d 0001-update-kernel-make-mksquashfs-exit-on-error.patch" | 31 | 66238028becd1a648780a7522a71a169 0001-update-kernel-make-mksquashfs-exit-on-error.patch |
32 | e85a35805f18a130e1dcba998356e9ca 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch | ||
33 | eb6c5e86ae571d8fc70a65bbcf947525 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch" | ||
30 | sha256sums="d93733e2dd630fc5627ec1eb71a71f633bcda7c75f3b65593542dc0a756bd580 alpine-conf-3.5.0_rc1.tar.xz | 34 | sha256sums="d93733e2dd630fc5627ec1eb71a71f633bcda7c75f3b65593542dc0a756bd580 alpine-conf-3.5.0_rc1.tar.xz |
31 | ce316da5b3b3d5300a72aa5b5cbb7ad057859bec127337b7bf52c271f5aa746c 0001-update-kernel-make-mksquashfs-exit-on-error.patch" | 35 | 8623350fff0f9456137341209172fe1d139035d42d01f16b90a5f6dceadb5d54 0001-update-kernel-make-mksquashfs-exit-on-error.patch |
36 | 9089418ca27148a33ba39b601d0b2c7808cc8315cebcb017583bfa8e80edbe2c 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch | ||
37 | 661534c6828e4cca9398bb74563d51b7661b028241cdcac717614354779ad9ce 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch" | ||
32 | sha512sums="9b77085ba719bdcfc9f9b186636f1724528270eed29e8e266fa947c91e4ee86e6253405c73b59a7977763da6e85089b57a80fd09457120a8394f5d1c786bf29b alpine-conf-3.5.0_rc1.tar.xz | 38 | sha512sums="9b77085ba719bdcfc9f9b186636f1724528270eed29e8e266fa947c91e4ee86e6253405c73b59a7977763da6e85089b57a80fd09457120a8394f5d1c786bf29b alpine-conf-3.5.0_rc1.tar.xz |
33 | af620eb0029bf4a8466986ca82966325467d77f05dc9e56771583737e3af19cb2bf33b461095aa17eb913d7eecee57df5747ec5f753482f022d02c24bd1c95ea 0001-update-kernel-make-mksquashfs-exit-on-error.patch" | 39 | 62af2f385a8431696fefb1206e37624605cbab998c59691490ac14435e1487b6a745e678ea8a760ff5c322c6349479def18b25fed6783a802875785f366a6279 0001-update-kernel-make-mksquashfs-exit-on-error.patch |
40 | 6b08fd7d2703c26d1353022484793597d20b927a37c886ec87e82c4661bf7f562e3a48007a1d659953ec06530355a9f31072923f7160bf4e1999c6a550cf19d6 0002-update-kernel-don-t-install-deps-if-script-runs-in-f.patch | ||
41 | 4ff581357e9d03431f5c45ed9badac51cce23e5f9241230ac2d48b6ba6823129c293577f4030b6c8fcb036d7a6fb5830f3b9e10b1dd0228179d1232d0ea3fca3 0003-update-kernel-re-exec-under-fakeroot-unless-we-are-s.patch" | ||