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: Ben Hutchings <b...@decadent.org.uk> --- hooks/resume | 6 ++---- mkinitramfs | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hooks/resume b/hooks/resume index c43badd03f71..d5a987602787 100755 --- a/hooks/resume +++ b/hooks/resume @@ -16,8 +16,6 @@ prereqs) esac # 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 fi fi -# 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 fi diff --git a/mkinitramfs b/mkinitramfs index 9f207a0a00df..24715d5e5287 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -205,6 +205,7 @@ export verbose export KEYMAP export MODULES export BUSYBOX +export RESUME # Private, used by 'catenate_cpiogz'. export __TMPCPIOGZ
signature.asc
Description: Digital signature