* Hacked up support for volume labels.
svn path=/nixos/trunk/; revision=7587
This commit is contained in:
parent
c9c5e920c9
commit
60e4da4a9b
@ -41,16 +41,23 @@ script
|
|||||||
fsType=\${fsTypes[$n]}
|
fsType=\${fsTypes[$n]}
|
||||||
options=\${optionss[$n]}
|
options=\${optionss[$n]}
|
||||||
|
|
||||||
if ! test -e \"$device\"; then
|
isLabel=
|
||||||
|
if echo \"$device\" | grep -q '^LABEL='; then isLabel=1; fi
|
||||||
|
|
||||||
|
if ! test -n \"$isLabel\" -o -e \"$device\"; then
|
||||||
echo \"skipping $device, doesn't exist (yet)\"
|
echo \"skipping $device, doesn't exist (yet)\"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
device=$(readlink -f \"$device\")
|
|
||||||
|
|
||||||
# If $device is already mounted somewhere else, unmount it first.
|
# If $device is already mounted somewhere else, unmount it first.
|
||||||
# !!! Note: we use /etc/mtab, not /proc/mounts, because mtab
|
# !!! Note: we use /etc/mtab, not /proc/mounts, because mtab
|
||||||
# contains more accurate info when using loop devices.
|
# contains more accurate info when using loop devices.
|
||||||
|
|
||||||
|
# !!! not very smart about labels yet; should resolve the label somehow.
|
||||||
|
if test -z \"$isLabel\"; then
|
||||||
|
|
||||||
|
device=$(readlink -f \"$device\")
|
||||||
|
|
||||||
prevMountPoint=$(
|
prevMountPoint=$(
|
||||||
cat /etc/mtab \\
|
cat /etc/mtab \\
|
||||||
| grep \"^$device \" \\
|
| grep \"^$device \" \\
|
||||||
@ -70,6 +77,8 @@ script
|
|||||||
${utillinux}/bin/umount \"$prevMountPoint\" || true
|
${utillinux}/bin/umount \"$prevMountPoint\" || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
echo \"mounting $device on $mountPoint\"
|
echo \"mounting $device on $mountPoint\"
|
||||||
|
|
||||||
# !!! should do something with the result; also prevent repeated fscks.
|
# !!! should do something with the result; also prevent repeated fscks.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user