ref: 49f8a6745f17002322a2cd853ffacf57ee15be10
parent: c8c76ad90f00132988587f4547863d58801cd252
author: Natanael Copa <ncopa@alpinelinux.org>
date: Thu May 2 06:49:49 CDT 2013
init: factorize out ALPINE_DEV_IS_NETWORK Use ALPINE_DEV_FS to detect nfs instead of adding an additional variable
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -435,7 +435,6 @@
# 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 @@
# 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 @@
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