diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-25 09:58:41 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-25 09:58:41 +0000 |
commit | 03b3c418d88e6777e84631d28756f1ed5ce6f16d (patch) | |
tree | 8564f278a06ff75ec2b5aa7fcfaa75c60fba89dc | |
parent | 89a33f1e203b13ead8ccc783e05f5a73c2f5502b (diff) | |
download | alpine_aports-03b3c418d88e6777e84631d28756f1ed5ce6f16d.tar.bz2 alpine_aports-03b3c418d88e6777e84631d28756f1ed5ce6f16d.tar.xz alpine_aports-03b3c418d88e6777e84631d28756f1ed5ce6f16d.zip |
main/mkinitfs: delay umount of apkovl media so apk cache is available
When installing the apks we might need the apk cache so we need wait
with unmounting the apkovl media
ref #736
-rw-r--r-- | main/mkinitfs/APKBUILD | 4 | ||||
-rw-r--r-- | main/mkinitfs/delay-umount-apkovl.patch | 94 |
2 files changed, 97 insertions, 1 deletions
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD index dd2c59a0f8..dca3535e1f 100644 --- a/main/mkinitfs/APKBUILD +++ b/main/mkinitfs/APKBUILD | |||
@@ -1,7 +1,7 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=mkinitfs | 2 | pkgname=mkinitfs |
3 | pkgver=2.3.4 | 3 | pkgver=2.3.4 |
4 | pkgrel=3 | 4 | pkgrel=4 |
5 | pkgdesc="Tool to generate initramfs images for Alpine" | 5 | pkgdesc="Tool to generate initramfs images for Alpine" |
6 | url=http://git.alpinelinux.org/cgit/mkinitfs | 6 | url=http://git.alpinelinux.org/cgit/mkinitfs |
7 | depends="busybox apk-tools>=2.0" | 7 | depends="busybox apk-tools>=2.0" |
@@ -9,6 +9,7 @@ triggers="$pkgname.trigger=/usr/share/kernel/*" | |||
9 | source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2 | 9 | source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2 |
10 | 0001-init-fix-progressbar-when-not-quiet.patch | 10 | 0001-init-fix-progressbar-when-not-quiet.patch |
11 | mount-move.patch | 11 | mount-move.patch |
12 | delay-umount-apkovl.patch | ||
12 | eglibc.patch | 13 | eglibc.patch |
13 | " | 14 | " |
14 | arch="noarch" | 15 | arch="noarch" |
@@ -47,4 +48,5 @@ package() { | |||
47 | md5sums="abec6dced89e137dc60542c1e5f938ac mkinitfs-2.3.4.tar.bz2 | 48 | md5sums="abec6dced89e137dc60542c1e5f938ac mkinitfs-2.3.4.tar.bz2 |
48 | 4ea4389d5dff0a69d6792420574d2f1f 0001-init-fix-progressbar-when-not-quiet.patch | 49 | 4ea4389d5dff0a69d6792420574d2f1f 0001-init-fix-progressbar-when-not-quiet.patch |
49 | 049392dd315240d2c7d892ef67072e03 mount-move.patch | 50 | 049392dd315240d2c7d892ef67072e03 mount-move.patch |
51 | 6d8b0a6f3b7a90152d84eda373743d84 delay-umount-apkovl.patch | ||
50 | e59c2f7de496fe430b07e32fd812ebe0 eglibc.patch" | 52 | e59c2f7de496fe430b07e32fd812ebe0 eglibc.patch" |
diff --git a/main/mkinitfs/delay-umount-apkovl.patch b/main/mkinitfs/delay-umount-apkovl.patch new file mode 100644 index 0000000000..983008b3fb --- /dev/null +++ b/main/mkinitfs/delay-umount-apkovl.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | diff --git a/initramfs-init.in b/initramfs-init.in | ||
2 | index f64ef26..8f01c8f 100755 | ||
3 | --- a/initramfs-init.in | ||
4 | +++ b/initramfs-init.in | ||
5 | @@ -244,8 +244,8 @@ resolve_dev() { | ||
6 | esac | ||
7 | } | ||
8 | |||
9 | -# remount ALPINE_MNT according given fstab | ||
10 | -remount_alpine_mnt() { | ||
11 | +# relocate ALPINE_MNT according given fstab | ||
12 | +relocate_alpine_mnt() { | ||
13 | local fstab="$1" | ||
14 | local mnt=$(find_mnt $ALPINE_DEV $fstab) | ||
15 | if [ "$ALPINE_MNT" != "$mnt" ]; then | ||
16 | @@ -253,10 +253,6 @@ remount_alpine_mnt() { | ||
17 | mount -o move $ALPINE_MNT $mnt | ||
18 | ALPINE_MNT=$mnt | ||
19 | fi | ||
20 | - # respect users mount options in fstab | ||
21 | - if [ -n "$MNTOPTS" ]; then | ||
22 | - mount -o remount,$MNTOPTS "$ALPINE_MNT" | ||
23 | - fi | ||
24 | } | ||
25 | |||
26 | # gotta start from somewhere :) | ||
27 | @@ -458,7 +454,6 @@ if [ -f "$ovl" ]; then | ||
28 | eend $? $errstr || ovlfiles= | ||
29 | # hack, incase /root/.ssh was included in apkovl | ||
30 | [ -d "$sysroot/root" ] && chmod 700 "$sysroot/root" | ||
31 | - umount $ovl_unmount 2>/dev/null & | ||
32 | pkgs="$pkgs $(sed 's/\#.*//' $sysroot/etc/lbu/packages.list 2>/dev/null)" | ||
33 | rm -f "$sysroot"/etc/lbu/packages.list | ||
34 | pkgs="$pkgs $(cat $sysroot/var/lib/apk/world $sysroot/etc/apk/world 2>/dev/null)" | ||
35 | @@ -480,12 +475,19 @@ else | ||
36 | rc_add savecache shutdown | ||
37 | fi | ||
38 | |||
39 | -# let user override tmpfs size in fstab in apkovl | ||
40 | if [ -f $sysroot/etc/fstab ]; then | ||
41 | + has_fstab=1 | ||
42 | + | ||
43 | + # let user override tmpfs size in fstab in apkovl | ||
44 | mountopts=$(awk '$2 == "/" && $3 == "tmpfs" { print $4 }' $sysroot/etc/fstab) | ||
45 | if [ -n "$mountopts" ]; then | ||
46 | mount -o remount,$mountopts $sysroot | ||
47 | fi | ||
48 | + | ||
49 | + # move the ALPINE_MNT if ALPINE_DEV is specified in users fstab | ||
50 | + # this is so a generated /etc/apk/repositories will use correct | ||
51 | + # mount dir | ||
52 | + relocate_alpine_mnt "$sysroot"/etc/fstab | ||
53 | fi | ||
54 | |||
55 | # in case we upgrade we might need those: | ||
56 | @@ -496,13 +498,6 @@ rc_add modloop sysinit | ||
57 | # hack so we get openrc | ||
58 | pkgs="$pkgs alpine-base" | ||
59 | |||
60 | -# move the ALPINE_MNT if ALPINE_DEV is specified in users fstab | ||
61 | -# this is so a generated /etc/apk/repositories will use correct mount dir | ||
62 | -if [ -f "$sysroot"/etc/fstab ]; then | ||
63 | - has_fstab=1 | ||
64 | - remount_alpine_mnt "$sysroot"/etc/fstab | ||
65 | -fi | ||
66 | - | ||
67 | # copy keys so apk finds them. apk looks for stuff relative --root | ||
68 | mkdir -p $sysroot/etc/apk/keys/ | ||
69 | cp -a /etc/apk/keys $sysroot/etc/apk | ||
70 | @@ -537,11 +532,23 @@ else | ||
71 | fi | ||
72 | eend $? | ||
73 | |||
74 | +# unmount ovl mount if needed | ||
75 | +if [ -n "$ovl_unmount" ]; then | ||
76 | + umount $ovl_unmount 2>/dev/null | ||
77 | +fi | ||
78 | + | ||
79 | # remount ALPINE_MNT according default fstab from package | ||
80 | if [ -z "$has_fstab" ] && [ -f "$sysroot"/etc/fstab ]; then | ||
81 | - remount_alpine_mnt "$sysroot"/etc/fstab | ||
82 | + relocate_alpine_mnt "$sysroot"/etc/fstab | ||
83 | fi | ||
84 | |||
85 | +# respect mount options in fstab for ALPINE_MNT (e.g if user wants rw) | ||
86 | +opts=$(awk "\$2 == \"$ALPINE_MNT\" {print \$4}" $sysroot/etc/fstab) | ||
87 | +if [ -n "$opts" ]; then | ||
88 | + mount -o remount,$opts "$ALPINE_MNT" | ||
89 | +fi | ||
90 | + | ||
91 | + | ||
92 | # fix inittab if alternative console | ||
93 | setup_inittab_console $CONSOLE | ||
94 | |||