From ae13885cdfbd64aefe7d58ecd24c2acd068edeca Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 7 Nov 2007 20:57:07 +0000 Subject: [PATCH] Added an update patch from Alon Bar-Lev in bug #197244 to clean up the suspend2 code and rename the functions to tuxonice to match the upstream rename. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@555 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- ChangeLog | 6 +++++ generic/initrd.scripts | 50 +++++++++++++++++++++++------------------- generic/linuxrc | 2 +- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f4ac3c..0d55bb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ # Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 07 Nov 2007; Chris Gianelloni + generic/initrd.scripts, generic/linuxrc: + Added an update patch from Alon Bar-Lev 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 gen_cmdline.sh, gen_compile.sh, gen_initramfs.sh, gen_initrd.sh, gen_package.sh, genkernel: diff --git a/generic/initrd.scripts b/generic/initrd.scripts index ebb4423..670462c 100644 --- a/generic/initrd.scripts +++ b/generic/initrd.scripts @@ -857,39 +857,43 @@ setup_unionfs() { 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 } diff --git a/generic/linuxrc b/generic/linuxrc index 7e2e5f8..7d32e15 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -256,7 +256,7 @@ fi # Run debug shell if requested rundebugshell -suspend2_resume +tuxonice_resume if [ "${CDROOT}" -eq '1' ] then -- 2.26.2