Added patch for suspend2 for bug #131202.
authorChris Gianelloni <wolf31o2@gentoo.org>
Tue, 22 Aug 2006 19:24:07 +0000 (19:24 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Tue, 22 Aug 2006 19:24:07 +0000 (19:24 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@427 67a159dc-881f-0410-a524-ba9dfbe2cb84

generic/initrd.scripts
generic/linuxrc

index d6a2b0c603bc85a5d79d4bc5579260b1069ad3a9..a7fca775cc0f5ced5ae4f799ab5f2227511de5c2 100644 (file)
@@ -38,7 +38,7 @@ modules_scan() {
        local MODS
        [ -d /etc/modules/${1} ] || touch /etc/modules/${1}
 
-       MODS=`cat /etc/modules/${1}`
+       [ -f /etc/modules/${1} ] && MODS=`cat /etc/modules/${1}`
        for x in ${MODS}
        do
                MLOAD=`echo ${MLIST} | sed -e "s/.*${x}.*/${x}/"`
@@ -649,3 +649,29 @@ setup_unionfs() {
                USE_UNIONFS_NORMAL=0
        fi
 }
+
+suspend2_resume() {
+       if [ -d /proc/suspend2 ]; then
+               local splash_theme
+
+               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
+
+               if which suspend2ui_text > /dev/null 2>&1; then
+                       echo `which suspend2ui_text` > /proc/suspend2/userui_program
+               fi
+
+               if [ -n "${splash_theme}" ]; then
+                       ln -s /etc/splash/${splash_theme} /etc/splash/suspend2
+
+                       if which suspend2ui_fbsplash > /dev/null 2>&1; then
+                               echo `which suspend2ui_fbsplash` > /proc/suspend2/userui_program
+                       fi
+               fi
+
+               modules_scan suspend2
+               echo > /proc/suspend2/do_resume
+       fi
+}
+
index dced792076d64e21cda3840b74aef4286bab745f..824cdb16edb47673eb86cba4dc4cf6cfe66ba277 100644 (file)
@@ -25,13 +25,6 @@ fi
 mount -t proc proc /proc >/dev/null 2>&1
 mount -o remount,rw / >/dev/null 2>&1
 
-# activate suspend2
-if [ -w /proc/suspend2/do_resume ]
-then
-       echo -e "${GOOD}>>${NORMAL}${BOLD} Activating suspend2 resume..."
-       echo > /proc/suspend2/do_resume
-fi
-
 # Set up symlinks
 if [ "$0" = '/init' ]
 then
@@ -235,6 +228,8 @@ fi
 # Run debug shell if requested
 rundebugshell
 
+suspend2_resume
+
 if [ "${CDROOT}" -eq '1' ]
 then
        if [ ! "${USE_UNIONFS_NORMAL}" -eq '1' ]