From 2821289aeb809f50ac536577a88b3c8bda43a927 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 12 Apr 2012 18:01:19 +0000 Subject: [PATCH] * Ugly hack: force udev to exit to prevent random "Device or resource busy while trying to open /dev/xvda" errors from fsck. svn path=/nixos/trunk/; revision=33766 --- modules/system/boot/stage-1-init.sh | 2 +- modules/virtualisation/amazon-image.nix | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/system/boot/stage-1-init.sh b/modules/system/boot/stage-1-init.sh index 7c98b35eba2..278c68fce99 100644 --- a/modules/system/boot/stage-1-init.sh +++ b/modules/system/boot/stage-1-init.sh @@ -322,7 +322,7 @@ done # Stop udevd. -udevadm control --exit +udevadm control --exit || true # Kill any remaining processes, just to be sure we're not taking any # with us into stage 2. diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix index 65bf43c1478..55b1f5c0bd2 100644 --- a/modules/virtualisation/amazon-image.nix +++ b/modules/virtualisation/amazon-image.nix @@ -78,6 +78,14 @@ with pkgs.lib; boot.loader.grub.timeout = 0; boot.loader.grub.extraPerEntryConfig = "root (hd0)"; + boot.initrd.postDeviceCommands = + '' + # Force udev to exit to prevent random "Device or resource busy + # while trying to open /dev/xvda" errors from fsck. + udevadm control --exit || true + kill -9 -- -1 + ''; + # Mount all formatted ephemeral disks and activate all swap devices. # We cannot do this with the ‘fileSystems’ and ‘swapDevices’ options # because the set of devices is dependent on the instance type