aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/modloop.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-09-25 14:10:38 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-09-25 14:10:38 +0000
commit470259ffec324fc5ec0f16bec6f846596a9bfcb3 (patch)
treec64fb2939b2ec6e04afcf0dec8cfde64c0266d17 /main/openrc/modloop.initd
parentc44d7e7c4825ac1509f17fcc1d3c8d865ed4892a (diff)
downloadaports-470259ffec324fc5ec0f16bec6f846596a9bfcb3.tar.bz2
aports-470259ffec324fc5ec0f16bec6f846596a9bfcb3.tar.xz
main/openrc: fix and cleanup modloop initd
- fix mounting of modloop - drop support for .cmg - if modloop=/path/file boot option specified but file does not exist, then fail instead of searching for fallback
Diffstat (limited to 'main/openrc/modloop.initd')
-rw-r--r--main/openrc/modloop.initd24
1 files changed, 10 insertions, 14 deletions
diff --git a/main/openrc/modloop.initd b/main/openrc/modloop.initd
index ec52697446..e26bdcbb49 100644
--- a/main/openrc/modloop.initd
+++ b/main/openrc/modloop.initd
@@ -73,17 +73,17 @@ find_media() {
}
start() {
- local modloop= mount_opts= modloop_mounted= modloop_dldir="/lib"
+ local modloop= mount_opts= modloop_dldir="/lib"
find_media
case "$KOPT_modloop" in
http://*|https://|ftp://*)
wget -P "$modloop_dldir" "$KOPT_modloop" \
- && modloop=$modloop_dldir/$(basename $KOPT_modloop)
+ && modloop=$modloop_dldir/${KOPT_modloop##/*}
;;
*)
- if [ -z "$alpine_dev" ] ; then
+ if [ -z "$alpine_dev" ]; then
return 0
fi
if [ -z "$alpine_mounted" ]; then
@@ -93,21 +93,17 @@ start() {
eend $? || return 1
fi
for modloop in ${alpine_mnt}$KOPT_modloop \
- ${alpine_mnt}$KOPT_BOOT_IMAGE.modloop.* \
- ${alpine_mnt}$KOPT_BOOT_IMAGE.cmg; do
- [ -f "$modloop" ] || continue
+ ${alpine_mnt}$KOPT_BOOT_IMAGE.modloop.*; do
+
+ [ -f "$modloop" -o -n "$KOPT_modloop" ] && break
done
;;
esac
- if [ -f "$modloop" ]; then
- ebegin "Mounting modloop $modloop"
- mkdir -p /.modloop /lib
- mount -o loop,ro $fs_opt $modloop /.modloop \
- && modloop_mounted=1
- eend $? || return 1
- fi
- [ "$modloop_mounted" = "1" ] || return 1
+ ebegin "Mounting modloop $modloop"
+ mkdir -p /.modloop /lib
+ mount -o loop,ro $fs_opt $modloop /.modloop
+ eend $? || return 1
#use unionfs is available and configured
if grep -q -w "unionfs$" /proc/filesystems && [ -n "$unionfs_size" ]; then