diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-27 16:01:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-27 16:01:15 +0000 |
commit | 99e836cc8c964005a05df3e3a83dd16b9f3d5a58 (patch) | |
tree | f44cd96136c811a92f5319bf175e7fbd7d6c315d | |
parent | 153eb2dc7cfe3353b56f7d8166973f9151cb045a (diff) | |
download | alpine_aports-99e836cc8c964005a05df3e3a83dd16b9f3d5a58.tar.bz2 alpine_aports-99e836cc8c964005a05df3e3a83dd16b9f3d5a58.tar.xz alpine_aports-99e836cc8c964005a05df3e3a83dd16b9f3d5a58.zip |
main/openrc: support for squashfs modloop
-rw-r--r-- | main/openrc/APKBUILD | 4 | ||||
-rw-r--r-- | main/openrc/modloop.initd | 35 |
2 files changed, 24 insertions, 15 deletions
diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD index 7723ca8312..4d12f92dd4 100644 --- a/main/openrc/APKBUILD +++ b/main/openrc/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | pkgname=openrc | 2 | pkgname=openrc |
3 | pkgver=0.8.3 | 3 | pkgver=0.8.3 |
4 | _ver=${pkgver/_git*/} | 4 | _ver=${pkgver/_git*/} |
5 | pkgrel=5 | 5 | pkgrel=6 |
6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" | 6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" |
7 | url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git" | 7 | url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git" |
8 | arch="all" | 8 | arch="all" |
@@ -77,6 +77,6 @@ c32e15b0858eef708497e7ee6355a055 hostname.initd | |||
77 | b1e64885f301166df30be3e3cf5338ff hwdrivers.initd | 77 | b1e64885f301166df30be3e3cf5338ff hwdrivers.initd |
78 | 33ca3e558c42cdd17adccbc7807298f7 keymaps.initd | 78 | 33ca3e558c42cdd17adccbc7807298f7 keymaps.initd |
79 | 098a1f16812f56fcb56eb6b6f0fa31f6 modules.initd | 79 | 098a1f16812f56fcb56eb6b6f0fa31f6 modules.initd |
80 | 9b4b72543d80e7bef5fc677ebc6c64ef modloop.initd | 80 | c268461826dfa21a781249f5b65017bc modloop.initd |
81 | af16db0d798392c7c0ed3434e4bad241 networking.initd | 81 | af16db0d798392c7c0ed3434e4bad241 networking.initd |
82 | c1ec888202d868710b5749f7b217d1e3 modloop.confd" | 82 | c1ec888202d868710b5749f7b217d1e3 modloop.confd" |
diff --git a/main/openrc/modloop.initd b/main/openrc/modloop.initd index d2cff4e6a3..3a69498420 100644 --- a/main/openrc/modloop.initd +++ b/main/openrc/modloop.initd | |||
@@ -71,25 +71,31 @@ find_media() { | |||
71 | } | 71 | } |
72 | 72 | ||
73 | start() { | 73 | start() { |
74 | local modloop mount_opts | 74 | local modloop= mount_opts= modloop_mounted= |
75 | find_media | 75 | find_media |
76 | if [ -z "$alpine_dev" ] ; then | 76 | if [ -z "$alpine_dev" ] ; then |
77 | return 0 | 77 | return 0 |
78 | fi | 78 | fi |
79 | 79 | ||
80 | modloop=${KOPT_modloop:-$KOPT_BOOT_IMAGE.cmg} | ||
81 | [ -n "$alpine_fs" ] && mount_opts="-t $alpine_fs" | ||
82 | |||
83 | ebegin "Mounting loopback device for kernel modules" | ||
84 | if [ -z "$alpine_mounted" ]; then | 80 | if [ -z "$alpine_mounted" ]; then |
81 | ebegin "Mounting $alpine_mnt" | ||
82 | [ -n "$alpine_fs" ] && mount_opts="-t $alpine_fs" | ||
85 | mount $mount_opts /dev/$alpine_dev $alpine_mnt 2>/dev/null | 83 | mount $mount_opts /dev/$alpine_dev $alpine_mnt 2>/dev/null |
84 | eend $? || return 1 | ||
86 | fi | 85 | fi |
87 | mkdir -p /.modloop /lib | 86 | mkdir -p /.modloop /lib |
88 | 87 | ||
89 | mount -o loop,ro -t cramfs $alpine_mnt/$modloop /.modloop | 88 | for modloop in ${alpine_mnt}$KOPT_modloop \ |
90 | 89 | ${alpine_mnt}$KOPT_BOOT_IMAGE.modloop.* \ | |
91 | eend $? || return 1 | 90 | ${alpine_mnt}$KOPT_BOOT_IMAGE.cmg; do |
92 | 91 | [ -f "$modloop" ] || continue | |
92 | ebegin "Mounting modloop $modloop" | ||
93 | mount -o loop,ro $fs_opt $modloop /.modloop \ | ||
94 | && modloop_mounted=1 | ||
95 | eend $? || return 1 | ||
96 | done | ||
97 | [ "$modloop_mounted" = "1" ] || return 1 | ||
98 | |||
93 | #use unionfs is available and configured | 99 | #use unionfs is available and configured |
94 | if grep -q -w "unionfs$" /proc/filesystems && [ -n "$unionfs_size" ]; then | 100 | if grep -q -w "unionfs$" /proc/filesystems && [ -n "$unionfs_size" ]; then |
95 | ebegin "UnionFS detected. Mounting modloop rw" | 101 | ebegin "UnionFS detected. Mounting modloop rw" |
@@ -110,19 +116,22 @@ start() { | |||
110 | rmdir /lib/firmware 2>/dev/null \ | 116 | rmdir /lib/firmware 2>/dev/null \ |
111 | && ln -s /lib/modules/firmware /lib/ | 117 | && ln -s /lib/modules/firmware /lib/ |
112 | fi | 118 | fi |
119 | return 0 | ||
113 | } | 120 | } |
114 | 121 | ||
115 | stop() { | 122 | stop() { |
116 | local rc=0 | 123 | local rc=0 |
117 | find_media | 124 | find_media |
118 | [ -z "$alpine_dev" ] && return 0 | 125 | [ -z "$alpine_dev" ] && return 0 |
119 | ebegin "Unmounting loopback device for kernel modules" | ||
120 | if mountinfo --quiet /.modloop; then | 126 | if mountinfo --quiet /.modloop; then |
121 | umount -d /.modloop || rc=1 | 127 | ebegin "Unmounting /.modloop" |
128 | umount -d /.modloop | ||
129 | eend $? || return 1 | ||
122 | fi | 130 | fi |
123 | if mountinfo --quiet $alpine_mnt; then | 131 | if mountinfo --quiet $alpine_mnt; then |
124 | umount $alpine_mnt || rc=1 | 132 | ebegin "Unmounting $alpine_mnt" |
133 | umount $alpine_mnt | ||
134 | eend $? | ||
125 | fi | 135 | fi |
126 | eend $rc | ||
127 | } | 136 | } |
128 | 137 | ||