--- linuxrc.orig 2010-02-04 20:06:21.160939914 -0800 +++ linuxrc 2010-02-04 20:06:26.839941380 -0800 @@ -243,8 +243,11 @@ startLUKS if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ] then + good_msg "Attempting resuming from disk using 'resume'..." + suspend_resume + good_msg "Attempting resuming from disk using 'in-kernel'..." swsusp_resume -# suspend_resume + good_msg "Attempting resuming from disk using 'tuxonice'..." tuxonice_resume fi fi --- initrd.scripts.orig 2010-02-04 20:08:12.412942847 -0800 +++ initrd.scripts 2010-02-04 20:10:26.355972600 -0800 @@ -902,6 +902,29 @@ return 0 } +suspend_resume() { + which resume > /dev/null 2>&1 || return + good_msg "Going for resume using 'resume'..." + local args + local features="$(resume --version | grep FEATURES)" + devres="" + if [ -n "${REAL_RESUME}" ] + then + if [ ! -b "${REAL_RESUME}" ] + then + devres="`blkid -t "${REAL_RESUME}" | cut -d ":" -f 1 2>/dev/null`" + else + devres="${REAL_RESUME}" + fi + fi + [ -n "${REAL_RESUME}" ] && args="${args} --resume_device=\"${devres}\"" + if ! grep suspend_noui /proc/cmdline > /dev/null 2>&1; then + echo "${features}" | grep "fbsplash" > /dev/null && grep "splash=" /proc/cmdline > /dev/null && args="${args} --parameter=\"splash=y\"" + fi + [ -c /dev/snapshot ] || mknod /dev/snapshot c 10 231 + eval resume ${args} +} + tuxonice_resume() { [ -d /proc/suspend2 -o -d /sys/power/suspend2 -o -d /sys/power/tuxonice ] || return