From 470259ffec324fc5ec0f16bec6f846596a9bfcb3 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 25 Sep 2014 14:10:38 +0000 Subject: 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 --- main/openrc/modloop.initd | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'main/openrc/modloop.initd') 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 -- cgit v1.2.3