Stage 1 improvements:

* Load scsi_wait_scan after all other kernel modules to ensure that
  all SCSI device nodes have been created.
* Increase the timeout for the appearance of the root device to 20
  seconds.
* Do a "udevadm settle" just after the root device has appeared to
  make sure that udev isn't accessing the device anymore (hopefully).
  On EC2 (Xen), I've seen fsck on the root fail randomly with "device
  in use" errors.

svn path=/nixos/trunk/; revision=33650
This commit is contained in:
Eelco Dolstra 2012-04-06 14:20:43 +00:00
parent 1e8e83408b
commit 4f4c529979
5 changed files with 10 additions and 16 deletions

View file

@ -119,11 +119,6 @@ in
boot.kernelPackages = pkgs.linuxPackages_2_6_35;
boot.kernelParams = [ "console=tty" ];
boot.initrd.kernelModules =
[ # Wait for SCSI devices to appear.
"scsi_wait_scan"
];
boot.postBootCommands =
''
mkdir -p /mnt

View file

@ -106,11 +106,6 @@ in
[ "mvsdio" "mmc_block" "reiserfs" "ext3" "ums-cypress" "rtc_mv"
"ext4" ];
boot.initrd.kernelModules =
[
"scsi_wait_scan"
];
boot.postBootCommands =
''
mkdir -p /mnt

View file

@ -46,11 +46,6 @@
"hid_apple"
];
boot.initrd.kernelModules =
[ # Wait for SCSI devices to appear.
"scsi_wait_scan"
];
# Include lots of firmware.
require =
[ ../hardware/network/intel-4965agn.nix

View file

@ -160,6 +160,9 @@ let kernel = config.boot.kernelPackages.kernel; in
# Misc. stuff.
"pcips2" "serio" "atkbd" "xtkbd"
# To wait for SCSI devices to appear.
"scsi_wait_scan"
];
boot.initrd.kernelModules =

View file

@ -139,6 +139,8 @@ mkdir -p /dev/.mdadm
udevd --daemon
udevadm trigger --action=add
udevadm settle || true
modprobe scsi_wait_scan || true
udevadm settle || true
# XXX: Use case usb->lvm will still fail, usb->luks->lvm is covered
@ -298,7 +300,7 @@ for ((n = 0; n < ${#mountPoints[*]}; n++)); do
# that we don't properly recognise.
if test -z "$pseudoDevice" -a ! -e $device; then
echo -n "waiting for device $device to appear..."
for ((try = 0; try < 10; try++)); do
for ((try = 0; try < 20; try++)); do
sleep 1
if test -e $device; then break; fi
echo -n "."
@ -306,6 +308,10 @@ for ((n = 0; n < ${#mountPoints[*]}; n++)); do
echo
fi
# Wait once more for the udev queue to empty, just in case it's
# doing something with $device right now.
udevadm settle || true
echo "mounting $device on $mountPoint..."
mountFS "$device" "$mountPoint" "$options" "$fsType"