diff --git a/boot/boot-stage-1-init.sh b/boot/boot-stage-1-init.sh index d412b31715a..3c9b35d0da2 100644 --- a/boot/boot-stage-1-init.sh +++ b/boot/boot-stage-1-init.sh @@ -70,7 +70,8 @@ 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 - + echo 1 > /sys/power/resume || echo "Failed to resume..." + echo shutdown >/sys/power/disk # Create device nodes in /dev. mknod -m 0666 /dev/null c 1 3 diff --git a/boot/boot-stage-2-init.sh b/boot/boot-stage-2-init.sh index e298a0d1c8b..2d90147dd1e 100644 --- a/boot/boot-stage-2-init.sh +++ b/boot/boot-stage-2-init.sh @@ -108,7 +108,10 @@ export MODULE_DIR=@kernel@/lib/modules/ # Run any user-specified commands. @shell@ @bootLocal@ -resumeDevice="$(cat /sys/power/tuxonice/resume)" +resumeDevice="$(cat /proc/cmdline)" +resumeDevice="${resumeDevice##* resume=}" +resumeDevice="${resumeDevice%% *}" +echo "$resumeDevice" if test -n "$resumeDevice"; then mkswap "$resumeDevice" || echo 'Failed to clear saved image.' fi