Author: eelco
Date: Fri Apr 6 14:20:43 2012
New Revision: 33650
URL: https://nixos.org/websvn/nix/?rev=33650&sc=1
Log:
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.
Modified:
nixos/trunk/modules/installer/cd-dvd/system-tarball-fuloong2f.nix
nixos/trunk/modules/installer/cd-dvd/system-tarball-sheevaplug.nix
nixos/trunk/modules/profiles/all-hardware.nix
nixos/trunk/modules/system/boot/kernel.nix
nixos/trunk/modules/system/boot/stage-1-init.sh
Modified: nixos/trunk/modules/installer/cd-dvd/system-tarball-fuloong2f.nix
==============================================================================
--- nixos/trunk/modules/installer/cd-dvd/system-tarball-fuloong2f.nix Fri Apr
6 13:18:58 2012 (r33649)
+++ nixos/trunk/modules/installer/cd-dvd/system-tarball-fuloong2f.nix Fri Apr
6 14:20:43 2012 (r33650)
@@ -119,11 +119,6 @@
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
Modified: nixos/trunk/modules/installer/cd-dvd/system-tarball-sheevaplug.nix
==============================================================================
--- nixos/trunk/modules/installer/cd-dvd/system-tarball-sheevaplug.nix Fri Apr
6 13:18:58 2012 (r33649)
+++ nixos/trunk/modules/installer/cd-dvd/system-tarball-sheevaplug.nix Fri Apr
6 14:20:43 2012 (r33650)
@@ -106,11 +106,6 @@
[ "mvsdio" "mmc_block" "reiserfs" "ext3" "ums-cypress" "rtc_mv"
"ext4" ];
- boot.initrd.kernelModules =
- [
- "scsi_wait_scan"
- ];
-
boot.postBootCommands =
''
mkdir -p /mnt
Modified: nixos/trunk/modules/profiles/all-hardware.nix
==============================================================================
--- nixos/trunk/modules/profiles/all-hardware.nix Fri Apr 6 13:18:58
2012 (r33649)
+++ nixos/trunk/modules/profiles/all-hardware.nix Fri Apr 6 14:20:43
2012 (r33650)
@@ -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
Modified: nixos/trunk/modules/system/boot/kernel.nix
==============================================================================
--- nixos/trunk/modules/system/boot/kernel.nix Fri Apr 6 13:18:58 2012
(r33649)
+++ nixos/trunk/modules/system/boot/kernel.nix Fri Apr 6 14:20:43 2012
(r33650)
@@ -160,6 +160,9 @@
# Misc. stuff.
"pcips2" "serio" "atkbd" "xtkbd"
+
+ # To wait for SCSI devices to appear.
+ "scsi_wait_scan"
];
boot.initrd.kernelModules =
Modified: nixos/trunk/modules/system/boot/stage-1-init.sh
==============================================================================
--- nixos/trunk/modules/system/boot/stage-1-init.sh Fri Apr 6 13:18:58
2012 (r33649)
+++ nixos/trunk/modules/system/boot/stage-1-init.sh Fri Apr 6 14:20:43
2012 (r33650)
@@ -139,6 +139,8 @@
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 @@
# 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 @@
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"
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits