Added an update patch from Alon Bar-Lev <alonbl@gentoo.org> in bug #197244 to clean...
authorChris Gianelloni <wolf31o2@gentoo.org>
Wed, 7 Nov 2007 20:57:07 +0000 (20:57 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Wed, 7 Nov 2007 20:57:07 +0000 (20:57 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@555 67a159dc-881f-0410-a524-ba9dfbe2cb84

ChangeLog
generic/initrd.scripts
generic/linuxrc

index 4f4ac3cce4e02da17b5fdaa6e5bc354b394f6573..0d55bb5709c945b233ff0bf7eba478ea8b9b1bba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
 # 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:
index ebb44238cc70463808c645d33612dde7bc57cd62..670462cf60a66f891209c9c5a7c547da9c08bcc9 100644 (file)
@@ -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
 }
index 7e2e5f882df86777ae9e2e63a1514c114b1ec4ec..7d32e157cf9e091187c8708be1f4fafcf46ecaa8 100644 (file)
@@ -256,7 +256,7 @@ fi
 # Run debug shell if requested
 rundebugshell
 
-suspend2_resume
+tuxonice_resume
 
 if [ "${CDROOT}" -eq '1' ]
 then