Commit d857e919 authored by Ben Hutchings's avatar Ben Hutchings

Support setting of RESUME in initramfs.conf or anywhere in conf.d/

Currently hooks/resume only reads /etc/initramfs-tools/conf.d/resume,
whereas at boot time it can be set by any configuration file.
Instead, export RESUME from mkinitramfs, which reads all the
configuration files.

When writing an auto-selected resume device, use a filename that
should sort later than user configuration files (zz-resume-auto).
Signed-off-by: default avatarBen Hutchings <>
parent 7da81948
......@@ -16,8 +16,6 @@ prereqs)
# First check if a location is set and is a valid swap partition
test -r /etc/initramfs-tools/conf.d/resume \
&& . /etc/initramfs-tools/conf.d/resume
if [ -n "$RESUME" ] && blkid -p -n swap $RESUME >/dev/null 2>&1; then
# As mkinitramfs copies the config file nothing to do.
exit 0
......@@ -37,7 +35,7 @@ if [ -n "$RESUME" ]; then
# Write detected resume to intramfs conf.d/resume if not in a chroot
# Write detected resume to intramfs conf.d if not in a chroot
if [ -n "${RESUME}" ] && ! ischroot; then
echo "RESUME=${RESUME}" > ${DESTDIR}/conf/conf.d/resume
echo "RESUME=${RESUME}" > ${DESTDIR}/conf/conf.d/zz-resume-auto
......@@ -205,6 +205,7 @@ export verbose
export KEYMAP
export MODULES
export BUSYBOX
export RESUME
# Private, used by 'catenate_cpiogz'.
export __TMPCPIOGZ
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment