From 295df77f21e880c7cf4026fadc2adac61df200dc Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 14 Aug 2010 20:12:05 +0000 Subject: [PATCH] Move resume section after udev launch - on some systems devices are recognized by kernel only after udev works. svn path=/nixos/trunk/; revision=23176 --- modules/system/boot/stage-1-init.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/system/boot/stage-1-init.sh b/modules/system/boot/stage-1-init.sh index 080016dc32c..24c55d47e59 100644 --- a/modules/system/boot/stage-1-init.sh +++ b/modules/system/boot/stage-1-init.sh @@ -110,20 +110,6 @@ done mknod /dev/null c 1 3 -# Try to resume - all modules are loaded now. -if test -e /sys/power/tuxonice/resume; then - if test -n "$(cat /sys/power/tuxonice/resume)"; then - echo 0 > /sys/power/tuxonice/user_interface/enabled - echo 1 > /sys/power/tuxonice/do_resume || echo "failed to resume..." - fi -fi - -if test -e /sys/power/resume -a -e /sys/power/disk; then - echo "@resumeDevice@" > /sys/power/resume 2> /dev/null || echo "failed to resume..." - echo shutdown > /sys/power/disk -fi - - # Create device nodes in /dev. echo "running udev..." export UDEV_CONFIG_FILE=@udevConf@ @@ -145,6 +131,20 @@ if test -n "$debug1devices"; then fail; fi @postDeviceCommands@ +# Try to resume - all modules are loaded now, and devices exist +if test -e /sys/power/tuxonice/resume; then + if test -n "$(cat /sys/power/tuxonice/resume)"; then + echo 0 > /sys/power/tuxonice/user_interface/enabled + echo 1 > /sys/power/tuxonice/do_resume || echo "failed to resume..." + fi +fi + +if test -e /sys/power/resume -a -e /sys/power/disk; then + echo "@resumeDevice@" > /sys/power/resume 2> /dev/null || echo "failed to resume..." + echo shutdown > /sys/power/disk +fi + + # Return true if the machine is on AC power, or if we can't determine # whether it's on AC power. onACPower() {