support suspend2 kernels in initramfs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
suspend2-userui (Ubuntu) |
Invalid
|
Low
|
Unassigned | ||
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-
/usr/share/
#!/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/
elif [ -d /sys/power/suspend2 ]; then
echo > /sys/power/
fi
-------
/usr/share/
#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/
if [ -x /usr/sbin/
then
mkdir --parents ${DESTDIR}/usr/bin/ 2>/dev/null || true
copy_exec /usr/sbin/
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
adding the above scripts as attachments, wasn't surethe bug report would let me do so later.