Support for mounting pseudo-felisystems during stage1

Don't ignore fsType field, don't add /mnt/root to device names not starting with
'/'.

svn path=/nixos/trunk/; revision=9232
This commit is contained in:
Yury G. Kudryashov 2007-09-01 17:59:00 +00:00
parent 0c4a936419
commit 3944916856

View File

@ -88,6 +88,7 @@ mountFS() {
local device="$1" local device="$1"
local mountPoint="$2" local mountPoint="$2"
local options="$3" local options="$3"
local fsType="$4"
# Check the root device, if . # Check the root device, if .
mustCheck= mustCheck=
@ -124,7 +125,7 @@ mountFS() {
fi fi
# Mount read-writable. # Mount read-writable.
mount -n -o "$options" "$device" /mnt/root$mountPoint || fail mount -n -t "$fsType" -o "$options" "$device" /mnt/root$mountPoint || fail
} }
@ -185,21 +186,21 @@ else
# !!! Really quick hack to support bind mounts, i.e., where # !!! Really quick hack to support bind mounts, i.e., where
# the "device" should be taken relative to /mnt/root, not /. # the "device" should be taken relative to /mnt/root, not /.
# Assume that every device that doesn't start with /dev or # Assume that every device that start with / but doesn't
# LABEL= is a bind mount. # start with /dev or LABEL= is a bind mount.
case $device in case $device in
/dev/*) /dev/*)
;; ;;
LABEL=*) LABEL=*)
;; ;;
*) /*)
device=/mnt/root$device device=/mnt/root$device
;; ;;
esac esac
echo "mounting $device on $mountPoint..." echo "mounting $device on $mountPoint..."
mountFS "$device" "$mountPoint" "$options" mountFS "$device" "$mountPoint" "$options" "$fsType"
done done
fi fi