support suspend2 kernels in initramfs

Bug #75616 reported by Matt Price
12
Affects Status Importance Assigned to Milestone
suspend2-userui (Ubuntu)
Invalid
Low
Unassigned
Nominated for Feisty by Nigel Cunningham

Bug Description

currently users switching to suspend2-enabled kernels need to add support for suspend2 into the initramfs scripts manually. This is an unnecessary user intervention into sensitive miccion-critical files, which can be avoided by adding scripts to the initramfs-tools package which handle suspend2 kernels by default. the following two scripts add support for suspend2 while leaving the boot process untouched in non-suspend2-enabled kernels.

/usr/share/initramfs-tools/scripts/local-premount/suspend2_do_resume :

#!/bin/sh

PREREQ=""

prereqs()
{
        echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
        prereqs
        exit 0
        ;;
esac

if [ -d /proc/suspend2 ]; then
        echo > /proc/suspend2/do_resume
elif [ -d /sys/power/suspend2 ]; then
        echo > /sys/power/suspend2/do_resume
fi

--------------------------

/usr/share/initramfs-tools/hooks/suspend2ui_usplash_hook :

#!/bin/sh
PREREQ=""

prereqs()
{
        echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
        prereqs
        exit 0
        ;;
esac

. /usr/share/initramfs-tools/hook-functions

if [ -x /usr/sbin/suspend2ui_usplash ];
then
        mkdir --parents ${DESTDIR}/usr/bin/ 2>/dev/null || true
        copy_exec /usr/sbin/suspend2ui_usplash /usr/bin/
fi

---------------------------------------

The first script is essential, as it enables the resume from suspend. The second script simply integrates the suspend2 resume messages into usplash if the usplash-ui package is installed.

matt

Revision history for this message
Matt Price (matt-price) wrote :

adding the above scripts as attachments, wasn't surethe bug report would let me do so later.

Revision history for this message
Matt Price (matt-price) wrote :

adds integration with usplash if suspendui_usplash is present

Revision history for this message
Ben Collins (ben-collins) wrote :

I believe the sync with Debian fixed this in feisty.

Changed in initramfs-tools:
importance: Undecided → Low
status: Unconfirmed → Confirmed
Revision history for this message
QuinnStorm (livinglatexkali) wrote :

The relevant code isn't there in the scripts as far as I can tell, did it get moved elsewhere (hardcoded into initramfs-tools perhaps?) For now I've dropped in these scripts

Revision history for this message
Matt Price (matt-price) wrote :

thanks quinn for responding -- i hadn't seen the code there either but wasn't sure whether that was just a result of my incompetence & didn't have time to investigate fully. this is great, thanks!

matt

Revision history for this message
Nigel Cunningham (nigelc) wrote :

I just had a quick look at my x86 and amd64 machines, and neither seems to have this. Also checked the Changelog.

Regards,

Nigel

Revision history for this message
neocarpetbagger (purcell-jr) wrote :

Excellent! Thanks for posting this.

Revision history for this message
maximilian attems (maks-debian) wrote :

Please ship that hook together with the ui of suspend2.

initramfs-tools is a generic initramfs generator and works out of the box for generic linux images using vanilla suspend mechanism.
thank you for your work.

affects: initramfs-tools (Ubuntu) → suspend2-userui (Ubuntu)
Revision history for this message
Phillip Susi (psusi) wrote :

This package was removed some time ago, so I am closing this report.

Changed in suspend2-userui (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.