Software Suspend using fbsplash

Progress information on suspend and resume

While older versions of software suspend include the functions for displaying the progress informations on suspend and resume into the kernel, newer versions will do this in userspace. This is a more flexible way to customize the suspend/resume process and adds the possibility to show the progress graphicly on the framebuffer console with own pictures.

If you have successfully setup software suspend on Fedora Core 3, Core 4, Core 5, Core 6 or Fedora 7, 8,9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 or 20, or RHEL 5 and got it running, the next step will provide you with the information how to use the _User UI. For Core 3 this step is optional, but since the current Core 4 versions use a newer software suspend it is required here (at least if you want to have any progress information and not a black screen without seeing what is going on). If you followed the installation for Core 5, Core 6, Fedora 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 or 20 or RHEL5 using yum, you have the text-based version already installed but might want to setup the graphical version too.

The User-UI tools

I provide packages with the needed tools, so the setup should be very easy. You need at least to fetch the text-ui package. If you want to use the graphical version on the framebuffer console, and you are using a Fedora version older than 17, you also need to fetch the fbsplash-ui package and one of the themes (if you do not want to create your own, or testing the setup first).
(For other distributions than Fedora Core 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 or 20 or RHEL 5 or if you plan to rebuild the packages you can fetch the Source RPM.

After downloading the needed packages please install them with
# rpm -ivh swsusp2-userui-* (Core 3+4)
# rpm -ivh userui-suspend2-* (Core 5-7, RHEL 5)
# rpm -ivh userui-tuxonice-* (Fedora 8-20)
Please also make sure that you have one of my recent kernels which includes software suspend or newer.

The framebuffer

To use the graphical version of the progress information you need to activate the framebuffer. This is usually done by adding a vga= parameter to the kernel commandline, and maybe a video= parameter for a specific graphic adapter. If you are unsure about this please have a look at the Framebuffer HowTo. In the following I will assume that you have a 1024x768 resolution with 24 bits color depth. In that case you have to add vga=0x317 to the command line. If you have an Intel 810/815/855 chipset you should also add something like this: video=i810fb:vram:2,xres:1024,yres=768,bpp:24,hsync1:30,hsync2:49,vsync1:40,vsync2:70,accel,mtrr. On my notebook with NVidia chipset and a 1280x800 resolution only vga=0x361 needs to be added.

Starting with Fedora 18 and the usage of grub2, the setup of the framebuffer is a bit simpler. Just edit your /etc/default/grub and insert a line "GRUB_GFXMODE=1600x900 (using the desired solution of course). Make sure that any existing configuration for GRUB_TERMINAL is commended out or does include gfxterm. After making these changes just run # grub2-mkconfig -o <path to your grub.cfg>. For more information on how to setup grub2 look at the Fedora Wiki.

The recommended way is to first setup the framebuffer, and then trying the fbsplash way of suspending and resuming. So if you do not use the framebuffer at the moment, but want the graphical version please do the following:
# vi /etc/grub.conf (edit your boot loader and add vga=0x317 video=i810fb:vram:2,xres:1024,yres=768,bpp:24,hsync1:30,hsync2:49,vsync1:40,vsync2:70,accel,mtrr to the kernel command line (skip the video=-parameter when you have a different adapter, or use a setup matching your graphiccard). For lilo edit /etc/lilo.conf and run lilo afterwards).
Please reboot and make sure the framebuffer works (you should see a little penguin in the upper left corner of your screen for some seconds).

Testing the User UI

Now it is time to test if your system is able to run the new UI tools. Switch to a text console and log in as root. Now run:
# /sbin/suspend2ui_text -t (if not using the framebuffer) or
# /sbin/suspend2ui_fbsplash -t (if you have setup the framebuffer)
If this works it is time to setup everything for real usage.

Since Fedora 17 there is only one single binary with all functionality provided. You can test it there with:
# /sbin/tuxoniceui -t (if not using the framebuffer) or
# /sbin/tuxoniceui -f -t (if you have setup the framebuffer).

User UI on suspend

To enable the new way of showing the progress information on suspending you only have to edit your /etc/hibernate/tuxonice.conf. You should add this line (if not already there):
ProcSetting userui_program /sbin/tuxoniceui -f (or /sbin/tuxoniceui for the textversion).

On Fedora 16 and older you use:
ProcSetting userui_program /sbin/suspend2ui_fbsplash (or /sbin/suspend2ui_text for the textversion).

User UI on resume

On resume the User UI will start just after the kernel was copied back. However, if you want to have the progress information from the beginning (eg. also for the first couple of seconds), you have to add the UI-program (and the theme in case of fbsplash) to your initrd. There were some deadlock problems in the past, so this is not the default on Core 3 and 4. However, with current Core 4 (sorry, not on Core 3) kernels this works fine, and in Core 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 and 20 and RHEL 5 it is the default anyway.
The mkinitrd-suspend ("swsusp2-mkinitrd" on Core 3+4) package already includes support for having the early UI, however it is recommended to use at least version 5.x.x for this (yes, it works on Core 4, but you will need to install several updated RPMs from rawhide, so this should only be done if you know what you are doing).

The following section is only relevant for advanced users, and really optional. Doing the following will only give you the progress information on resume some couple of seconds earlier and might not worth the trouble (starting with Fedora Core 5 it is already setup this way).

User UI on resume (deprecated)

This section should be skipped. It contains lots of deprecated information and will be removed soon. Please follow the instructions on the previous page on how to edit the initrd or patching the mkinitrd program. You can also use this script for patching the initrd. Choose one of the following ways for this step:

  • Using the mkinitrd-swsusp tool with the --swsusp-userui option (only available with swsusp2-mkinitrd >=5.0.18).
  • Using the script:
    # sh /boot/initrd-kernel-version.img
  • Modify the initrd by hand:
    Copy the file /sbin/suspend2ui_fblash (or /sbin/suspend2ui_text) into the /bin/ directory of the initrd and include these three lines after mount -t sysfs ... and before echo Creating /dev:
      echo Activating software suspend
      echo /bin/suspend2ui_fbsplash > /proc/software_suspend/userui_program
      echo > /proc/software_suspend/do_resume

    into the init-file (use /bin/suspend2ui_text for the text-version of course).
    Then copy your /etc/splash/ directory into the /etc/ directory of the initrd and the /dev/fb0" device node into the /dev/" directory (of course only when using the framebuffer splash).
  • Patch your mkinitrd in this way (replace fbsplash with text if needed):
    --- /sbin/mkinitrd.dist	2005-02-06 12:39:48.000000000 +0100
    +++ /sbin/mkinitrd	2005-05-07 13:04:28.000000000 +0200
    @@ -638,6 +638,13 @@
         echo "mount -t sysfs none /sys" >> $RCFILE
    +echo "echo Activating software suspend" >>$RCFILE
    +inst /sbin/suspend2ui_fbsplash "$MNTIMAGE/bin/suspend2ui_fbsplash"
    +echo "echo /bin/suspend2ui_fbsplash > /proc/software_suspend/userui_program" >>$RCFILE
    +echo "echo > /proc/software_suspend/do_resume" >>$RCFILE
    +mknod "$MNTIMAGE/dev/fb0" c 29 0
    +cp -r /etc/splash "$MNTIMAGE/etc"
     if [ -n "$USE_UDEV" ]; then
         if [ -n "$UDEV_TMPFS" ]; then
     	cat >> $RCFILE <<EOF

Go to the Download section.$1.29  [30799] © Matthias Hensler 2002-12, All Rights Reserved