summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-05-02 11:49:49 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-05-02 11:57:13 +0000
commit49f8a6745f17002322a2cd853ffacf57ee15be10 (patch)
tree5017679aca1e1a283f7b7ff58158785caea3993e
parentc8c76ad90f00132988587f4547863d58801cd252 (diff)
downloadmkinitfs-49f8a6745f17002322a2cd853ffacf57ee15be10.tar.bz2
mkinitfs-49f8a6745f17002322a2cd853ffacf57ee15be10.tar.xz
init: factorize out ALPINE_DEV_IS_NETWORK
Use ALPINE_DEV_FS to detect nfs instead of adding an additional variable
-rwxr-xr-xinitramfs-init.in5
1 files changed, 2 insertions, 3 deletions
diff --git a/initramfs-init.in b/initramfs-init.in
index aeecc26..4e47626 100755
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -435,7 +435,6 @@ case "$ALPINE_DEV" in
# nfs:IP:EXPORT
ALPINE_DEV_FS="$ALPINE_DEV"
ALPINE_DEV="${KOPT_alpine_dev:4}"
- ALPINE_DEV_IS_NETWORK=y
;;
*) ALPINE_DEV=/dev/$ALPINE_DEV ;;
esac
@@ -457,7 +456,7 @@ ALPINE_REPO=${KOPT_alpine_repo}
# look for standard mountpoint locations
ALPINE_MNT=$(find_mnt $ALPINE_DEV /etc/fstab)
-[ -z "$ALPINE_MNT" -a -n "$ALPINE_DEV_IS_NETWORK" ] && ALPINE_MNT=/media/alpine_dev
+[ -z "$ALPINE_MNT" ] && [ "$ALPINE_DEV_FS" = nfs ] && ALPINE_MNT=/media/alpine
[ -z "$ALPINE_MNT" ] && ALPINE_MNT=/media/${ALPINE_DEV##*/}
# hide kernel messages
@@ -550,7 +549,7 @@ fi
if [ -n "$ALPINE_DEV_FS" ]; then
mount_opts="-t $ALPINE_DEV_FS"
- [ "$ALPINE_DEV_FS" == "nfs" ] && mount_opts="$mount_opts -o nolock"
+ [ "$ALPINE_DEV_FS" = "nfs" ] && mount_opts="$mount_opts -o nolock"
fi
retry_mount -o ro $mount_opts $ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1