Fedora Core 3, 4, 5, 6 and 7 + Redhat Enterprise Linux 5

Have a look at http://mhensler.de/swsusp/ which provides some instructions and ready to run distribution kernel packages with included softwaresuspend support.

Fedora Core 3

This page never got mentioned! It shows how to patch FC3 (and 2?) stock kernel source for recent versions of swsusp2. Not yet been updated for the very latest FC3 2.6.11 kernels - hopefully soon.

http://www.suspend2.net/fedora/

Fedora Core 2 with software suspend 2 + bootsplash

<!> This information is fairly outdated.

Author: Alessandro Barbosa (barbosa_alessandro@hotmail.com)

Reference PC used for this customization: Dell Dimension 4300: 512Mb RAM, 2xHD 80M/20M, NVIDIA GForce4.

WARNING: Beware of Fedora Core 2 installation bug on dual boot systems. It modifies HD geometry and can mess up windows boots. To overcome this problem, you must indicate HD geometry at the beginning of installation (linux hdX=C,H,S ie: hda=9964,255,63, linux hdb=2431,255,63)

Requirements

Step-by-Step

1. Unpack kernel to
# cd /usr/src
# tar jxvf /patch/linux-2.6.6.tar.bz2
# ln -s linux-2.6.6 linux

2. Apply swsusp2 patches (contains bootsplash)
# cd /patch
# tar jxf software-suspend-2.0.0.81-for-2.6.6.tar.bz2
# cd /usr/src/linux-2.6.6
# for NAME in /patch/software-suspend-2.0.0.81-for-2.6.6/*; do patch -p1 -b &lt; $NAME; done
# make mrproper
3. Configure kernel options (use .config of FC2 as basis - see Notes)

  Power management options (ACPI. APM) ---&gt;
        [*] Power Management support
        [ ]   Software Sspend (EXPERIMENTAL)
              Software Suspend 2 ---&gt;
                  --- Image Storage (you need at least one writer)
                  [*]    Swap Writer
                  [ ]    Null Writer
                  --- Page Transformers
                  [*]    LZF image compression
                  [ ]    GZIP image compression
                  [ ]   Null Page Transformer (For debugging)
                  --- General Options
                  [ ]    Compile in debugging output
                  [ ]    Variation Analysis
                  [ ]    Metadata dump
                  [ ]    Allow keep Image Mode
                  [*]    Relaxed /proc/swsusp permissions
                  ()     Default resume device name
        [ ]   Suspend-to-Disk Support
            ACPI (Advanced Configuration and Power Interface) Support ---&gt;
              [*] ACPI Support
              [*]   Sleep states (EXPERIMENTAL)
              &lt;*&gt;   AC Adapter
              &lt;*&gt;   Battery
              &lt;*&gt;   Button
              &lt; &gt;   Fan
              &lt;*&gt;   Processor
              &lt; &gt;     Thermal Zone
              &lt; &gt;   ASUS/Medion Laptop Extras
              &lt; &gt;   Toshiba Laptop Extras
              [ ]   Debug Statements
              [ ]   Relaxed AML
  Device Drivers  ---&gt;
      Graphics support  ---&gt;
          Bootsplash configuration  ---&gt;
              [*] Bootup splash screen
4. Move files to hidden ones:
# cd /etc/rc.d/rc0.d
# mv S18rpcgssd .S18rpcgssd
# mv S19rpcidmapd .S19rpcidmapd
# mv S19rpcsvcgssd .S19rpcsvcgssd
# cd /etc/rc.d/rc6.d
# mv S18rpcgssd .S18rpcgssd
# mv S19rpcidmapd .S19rpcidmapd
# mv S19rpcsvcgssd .S19rpcsvcgssd

5. Compile the kernel and arrange the appropriate files
# make xconfig (or menuconfig)
# make bzImage
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.6
# make modules
# make modules_install
# cp System.map /boot/System.map-2.6.6
# mkinitrd -f /boot/initrd-2.6.6.img 2.6.6

6. Install the suspend.sh shell script
# cd /patch
# LANG=C
# export LANG
# sh /patch/suspend.sh --install

7. Unpack, make, arrange and configure bootsplash
# tar jxvf /patch/bootsplash-3.0.7.tar.bz2
# tar jxvf /patch/Theme-Linux.tar.bz2
# cd bootsplash-3.0.7/Utilities
# make all
# cp fbmngplay fbresolution fbtruetype splash /sbin
# cd ../../
# mkdir /etc/bootsplash
# mkdir /etc/bootsplash/themes
# cp -a Linux /etc/bootsplash/themes
# cp bootsplash-3.0.7/Scripts/splash.sh /etc/rc.d
# splash -s -f /etc/bootsplash/themes/Linux/config/bootsplash-1024x768.cfg &gt;&gt; /boot/initrd-2.6.6.img

8. Edit configuration files

To boot correctly (/boot/grub/grub.conf)
...
title Fedora Core (2.6.6)
root (hd1,0)
kernel /vmlinuz-2.6.6 ro root=LABEL=/ acpi=on vga=791 rhgb quiet splash=silent resume2=swap:/dev/hdXX
initrd /initrd-2.6.6.img
...

To avoid sound cards to resume muted (/etc/rc.d/rc.local)
...
if [ -d /proc/asound ]
then
    /usr/sbin/alsactl restore &gt;/dev/null 2&gt;&amp;1
fi
Change below parameter for Suspend + Bootsplash (/etc/suspend.conf)
...
# Default: 9
SWSUSP_VT="1"

Select appropriate theme for bootsplash(/etc/rc.d/splash.sh)
...
THEME="Linux"
...

Insert some code to activate bootsplash script via /etc/rc.d/rc
...
. /etc/init.d/functions

############### BootSplash Start 1##############
RUNLEVEL=$runlevel
PREVLEVEL=$previous
export progress=0
SSC=(/etc/rc.d/rc$runlevel.d/S*)
case "$SSC" in
        *\*) sscripts=0 ;;
        *) sscripts=${#SSC[*]}
esac
export sscripts
#if test "$PREVLEVEL" != "N" ; then
        KSC=(/etc/rc.d/rc$runlevel.d/K*)
        case "$KSC" in
                *\*) kscripts=0 ;;
                *) kscripts=${#KSC[*]}
        esac
        export kscripts
#fi
sscripts=$(( $sscripts + $kscripts ))
kscripts=$sscripts
############### BootSplash End 1 ###############

...

# First, run the KILL scripts.
for i in /etc/rc$runlevel.d/K* ; do
############### BootSplash Start 2##############
        progress=$(( $progress + 1 ))
        /etc/rc.d/splash.sh
############### BootSplash End 2 ###############
        check_runlevel "$i" || continue

...

# Now run the START scripts.
for i in /etc/rc$runlevel.d/S* ; do
############### BootSplash Start 3##############
        progress=$(( $progress + 1 ))
        /etc/rc.d/splash.sh
############### BootSplash End 3 ###############
        check_runlevel "$i" || continue


9. Test application using:
su /usr/local/sbin/hibernate
If you want users to be able to suspend, use visudo and add the following lines to your /etc/sudoers file:
Host_Alias LOCALHOST=localhost,&lt;your hostname&gt;
ALL LOCALHOST=NOPASSWD: /usr/local/sbin/hibernate *
See man sudoers(5) for more information. Users will then be able to do sudo /usr/local/sbin/hibernate

Acknowledgments
Nigel Cunningham, Florent Chabaud for Software Suspend "HOWTO" pages (http://softwaresuspend.berlios.de/Software-suspend.html).
Nemaru for his tutorial on installing swsusp2 on a FC2 LibrettoL1 (http://nemaru.at.infoseek.co.jp/).


Notes/Help!
1.One kernel parameter that needs to be turned off (it's on by default in Fedora) is REGPARM ("Use register arguments") or you'll get messages like "Number of free pages at start and end of write pageset don't match 122657 != 122658" ; {Note: REGPARM support is working in newer versions - Nigel}
2.When unpacking an making userspace tools, if you get an error during the make process which says something similar to: freetype.h:20:2: #error "`ft2build.h' hasn't been included yet!" then a simple fix is to load ttf.c in your editor, and alter the top of the file to read:
#include &lt;assert.h&gt;
#include &lt;ft2build.h&gt;     [ &lt;-- this line has been inserted ]

Analysis.html Name Analysis

None: DistroAndHardwareSetup/FedoraCore (last edited 2007-10-11 20:29:56 by 193)