* Prevent repeated mounting.
svn path=/nixos/trunk/; revision=7882
This commit is contained in:
parent
2f6810d4af
commit
56576e7c28
@ -53,6 +53,16 @@ script
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# !!! quick hack: if mount point already exists, try a
|
||||||
|
# remount to change the options but nothing else.
|
||||||
|
if cat /proc/mounts | grep -F -q \" $mountPoint \"; then
|
||||||
|
echo \"remounting $device on $mountPoint\"
|
||||||
|
${utillinux}/bin/mount -t \"$fsType\" \\
|
||||||
|
-o remount,\"$options\" \\
|
||||||
|
\"$device\" \"$mountPoint\" || true
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
# 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.
|
||||||
@ -69,11 +79,11 @@ script
|
|||||||
)
|
)
|
||||||
|
|
||||||
if test \"$prevMountPoint\" = \"$mountPoint\"; then
|
if test \"$prevMountPoint\" = \"$mountPoint\"; then
|
||||||
echo \"remounting $device on $mountPoint\"
|
echo \"remounting $device on $mountPoint\"
|
||||||
${utillinux}/bin/mount -t \"$fsType\" \\
|
${utillinux}/bin/mount -t \"$fsType\" \\
|
||||||
-o remount,\"$options\" \\
|
-o remount,\"$options\" \\
|
||||||
\"$device\" \"$mountPoint\" || true
|
\"$device\" \"$mountPoint\" || true
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n \"$prevMountPoint\"; then
|
if test -n \"$prevMountPoint\"; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user