# Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 07 Nov 2007; Chris Gianelloni <wolf31o2@gentoo.org>
+ generic/initrd.scripts, generic/linuxrc:
+ Added an update patch from Alon Bar-Lev <alonbl@gentoo.org> in bug #197244
+ to clean up the suspend2 code and rename the functions to tuxonice to match
+ the upstream rename.
+
07 Nov 2007; Chris Gianelloni <wolf31o2@gentoo.org> gen_cmdline.sh,
gen_compile.sh, gen_initramfs.sh, gen_initrd.sh, gen_package.sh,
genkernel:
fi
}
-suspend2_resume() {
- if [ -d /proc/suspend2 ] || [ -d /sys/power/suspend2 ]; then
- local splash_theme
+tuxonice_resume() {
+ [ -d /proc/suspend2 -o -d /sys/power/suspend2 -o -d /sys/power/tuxonice ] || return
- if grep "splash=" /proc/cmdline > /dev/null 2>&1; then
- splash_theme=`cat /proc/cmdline | sed 's/.*splash=/splash=/' | sed 's/ .*//' | sed 's/.*theme://' | sed 's/,.*//'`
- fi
+ local splash_theme
- local suspend2_userui_program="/sys/power/suspend2/user_interface/program"
- local suspend2_do_resume="/sys/power/suspend2/do_resume"
+ if grep "splash=" /proc/cmdline > /dev/null 2>&1; then
+ splash_theme=$(cat /proc/cmdline | sed 's/.*splash=/splash=/' | sed 's/ .*//' | sed 's/.*theme://' | sed 's/,.*//')
+ fi
- #
- # Backward compatibility
- #
- if [ -e /proc/suspend2 ]; then
- suspend2_userui_program="/proc/suspend2/userui_program"
- suspend2_do_resume="/proc/suspend2/do_resume"
- fi
+ local tuxonice_userui_program="/sys/power/tuxonice/user_interface/program"
+ local tuxonice_do_resume="/sys/power/tuxonice/do_resume"
- modules_scan suspend2
+ #
+ # Backward compatibility
+ #
+ if [ -e /sys/power/suspend2 ]; then
+ tuxonice_userui_program="/sys/power/suspend2/user_interface/program"
+ tuxonice_do_resume="/sys/power/suspend2/do_resume"
+ elif [ -e /proc/suspend2 ]; then
+ tuxonice_userui_program="/proc/suspend2/userui_program"
+ tuxonice_do_resume="/proc/suspend2/do_resume"
+ fi
- if which suspend2ui_text > /dev/null 2>&1; then
- which suspend2ui_text > "${suspend2_userui_program}"
- fi
+ modules_scan tuxonice
+
+ if ! grep suspend_noui /proc/cmdline > /dev/null 2>&1; then
+ which suspend2ui_text > /dev/null 2>&1 && which suspend2ui_text > "${tuxonice_userui_program}"
+ which tuxoniceui_text > /dev/null 2>&1 && which tuxoniceui_text > "${tuxonice_userui_program}"
if [ -n "${splash_theme}" ]; then
ln -s /etc/splash/${splash_theme} /etc/splash/suspend2
+ ln -s /etc/splash/${splash_theme} /etc/splash/tuxonice
- if which suspend2ui_fbsplash > /dev/null 2>&1; then
- which suspend2ui_fbsplash > "${suspend2_userui_program}"
- fi
+ which suspend2ui_fbsplash > /dev/null 2>&1 && which suspend2ui_fbsplash > "${tuxonice_userui_program}"
+ which tuxoniceui_fbsplash > /dev/null 2>&1 && which tuxoniceui_fbsplash > "${tuxonice_userui_program}"
fi
- echo > "${suspend2_do_resume}"
+ echo > "${tuxonice_do_resume}"
fi
}