mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-30 01:23:03 +00:00
* Don't try to mount when the mount point isn't there yet.
* Run fsck. svn path=/nixos/trunk/; revision=7458
This commit is contained in:
parent
e3acce2f4f
commit
647db4dd2a
@ -33,7 +33,7 @@ import ../upstart-jobs/gather.nix {
|
||||
|
||||
# Mount file systems.
|
||||
(import ../upstart-jobs/filesystems.nix {
|
||||
inherit (pkgs) utillinux;
|
||||
inherit (pkgs) utillinux e2fsprogs;
|
||||
fileSystems = config.get ["fileSystems"];
|
||||
})
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{utillinux, fileSystems}:
|
||||
{utillinux, e2fsprogs, fileSystems}:
|
||||
|
||||
let
|
||||
|
||||
@ -18,6 +18,8 @@ start on startup
|
||||
start on new-devices
|
||||
|
||||
script
|
||||
PATH=${e2fsprogs}/sbin:$PATH
|
||||
|
||||
mountPoints=(${toString mountPoints})
|
||||
devices=(${toString devices})
|
||||
fsTypes=(${toString fsTypes})
|
||||
@ -39,6 +41,11 @@ script
|
||||
fsType=\${fsTypes[$n]}
|
||||
options=\${optionss[$n]}
|
||||
|
||||
if ! test -e \"$device\"; then
|
||||
echo \"skipping $device, doesn't exist (yet)\"
|
||||
continue
|
||||
fi
|
||||
|
||||
# If $device is already mounted somewhere else, unmount it first.
|
||||
# !!! Note: we use /etc/mtab, not /proc/mounts, because mtab
|
||||
# contains more accurate info when using loop devices.
|
||||
@ -63,6 +70,9 @@ script
|
||||
|
||||
echo \"mounting $device on $mountPoint\"
|
||||
|
||||
# !!! should do something with the result; also prevent repeated fscks.
|
||||
fsck -a \"$device\" || true
|
||||
|
||||
if ${utillinux}/bin/mount -t \"$fsType\" -o \"$options\" \"$device\" \"$mountPoint\"; then
|
||||
newDevices=1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user