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 /main | |
parent | 153eb2dc7cfe3353b56f7d8166973f9151cb045a (diff) | |
download | aports-99e836cc8c964005a05df3e3a83dd16b9f3d5a58.tar.bz2 aports-99e836cc8c964005a05df3e3a83dd16b9f3d5a58.tar.xz |
main/openrc: support for squashfs modloop
Diffstat (limited to 'main')
-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 @@ pkgname=openrc pkgver=0.8.3 _ver=${pkgver/_git*/} -pkgrel=5 +pkgrel=6 pkgdesc="OpenRC manages the services, startup and shutdown of a host" url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git" arch="all" @@ -77,6 +77,6 @@ c32e15b0858eef708497e7ee6355a055 hostname.initd b1e64885f301166df30be3e3cf5338ff hwdrivers.initd 33ca3e558c42cdd17adccbc7807298f7 keymaps.initd 098a1f16812f56fcb56eb6b6f0fa31f6 modules.initd -9b4b72543d80e7bef5fc677ebc6c64ef modloop.initd +c268461826dfa21a781249f5b65017bc modloop.initd af16db0d798392c7c0ed3434e4bad241 networking.initd 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() { } start() { - local modloop mount_opts + local modloop= mount_opts= modloop_mounted= find_media if [ -z "$alpine_dev" ] ; then return 0 fi - modloop=${KOPT_modloop:-$KOPT_BOOT_IMAGE.cmg} - [ -n "$alpine_fs" ] && mount_opts="-t $alpine_fs" - - ebegin "Mounting loopback device for kernel modules" if [ -z "$alpine_mounted" ]; then + ebegin "Mounting $alpine_mnt" + [ -n "$alpine_fs" ] && mount_opts="-t $alpine_fs" mount $mount_opts /dev/$alpine_dev $alpine_mnt 2>/dev/null + eend $? || return 1 fi mkdir -p /.modloop /lib - mount -o loop,ro -t cramfs $alpine_mnt/$modloop /.modloop - - eend $? || return 1 - + for modloop in ${alpine_mnt}$KOPT_modloop \ + ${alpine_mnt}$KOPT_BOOT_IMAGE.modloop.* \ + ${alpine_mnt}$KOPT_BOOT_IMAGE.cmg; do + [ -f "$modloop" ] || continue + ebegin "Mounting modloop $modloop" + mount -o loop,ro $fs_opt $modloop /.modloop \ + && modloop_mounted=1 + eend $? || return 1 + done + [ "$modloop_mounted" = "1" ] || return 1 + #use unionfs is available and configured if grep -q -w "unionfs$" /proc/filesystems && [ -n "$unionfs_size" ]; then ebegin "UnionFS detected. Mounting modloop rw" @@ -110,19 +116,22 @@ start() { rmdir /lib/firmware 2>/dev/null \ && ln -s /lib/modules/firmware /lib/ fi + return 0 } stop() { local rc=0 find_media [ -z "$alpine_dev" ] && return 0 - ebegin "Unmounting loopback device for kernel modules" if mountinfo --quiet /.modloop; then - umount -d /.modloop || rc=1 + ebegin "Unmounting /.modloop" + umount -d /.modloop + eend $? || return 1 fi if mountinfo --quiet $alpine_mnt; then - umount $alpine_mnt || rc=1 + ebegin "Unmounting $alpine_mnt" + umount $alpine_mnt + eend $? fi - eend $rc } |