home · contact · privacy
Facilitate hibernation.
authorPlom Heller <plom@plomlompom.com>
Fri, 11 Sep 2026 06:55:48 +0000 (08:55 +0200)
committerPlom Heller <plom@plomlompom.com>
Fri, 11 Sep 2026 06:55:48 +0000 (08:55 +0200)
setup_scripts/install_debian.sh

index e1fa41ac684535da83871e56602cc8f3dc3138d3..074ff87aaf25e729702653409e094bb61d8673f1 100755 (executable)
@@ -46,6 +46,7 @@ PATH_HOSTNAME=/etc/hostname
 PATH_HOSTS=/etc/hosts
 PATH_INTERFACES=/etc/network/interfaces
 PATH_NM_CONNECTIONS=/etc/NetworkManager/system-connections
+PATH_RESUME_CONF=/etc/initramfs-tools/conf.d/resume
 
 # constants we might want to change at some point
 DEB_SUITE=trixie
@@ -68,13 +69,12 @@ PATH_MNT_HOSTS="${PATH_MNT_CHROOT}${PATH_HOSTS}"
 PATH_MNT_NM_CONN="${PATH_MNT_CHROOT}${PATH_NM_CONNECTIONS}/${FNAME_NM_CONN}"
 PATH_MNT_NM_CONNECTIONS="${PATH_MNT_CHROOT}${PATH_NM_CONNECTIONS}"
 PATH_MNT_PROFILE="${PATH_MNT_CHROOT}${PATH_HOME_ROOT}/${FNAME_PROFILE}"
+PATH_MNT_RESUME_CONF="${PATH_MNT_CHROOT}${PATH_RESUME_CONF}"
 PATH_VG=$(path_vg "${NAME_LUKSVG}")
 # shellcheck disable=SC2034
 # (used only inside templates/fstab, rendered via render_template)
 PATH_VG_DATA=${PATH_VG}/${NAME_DATA}
 PATH_VG_ROOT=${PATH_VG}/${NAME_ROOT}
-# shellcheck disable=SC2034
-# (used only inside templates/fstab, rendered via render_template)
 PATH_VG_SWAP=${PATH_VG}/${NAME_SWAP}
 
 # sanity checks
@@ -132,6 +132,10 @@ sed -i 's/ main$/ main non-free-firmware/' "${PATH_MNT_APT_SOURCES}"
 
 disable_apt_recommends "${PATH_MNT_CHROOT}"
 
+msg 'Setting up hibernation resume-from-swap config …'
+mkdir -p "$(dirname "${PATH_MNT_RESUME_CONF}")"
+printf 'RESUME=%s\n' "${PATH_VG_SWAP}" >| "${PATH_MNT_RESUME_CONF}"
+
 msg 'Into chroot environment installing LVM tools, kernel, initrd etc. …'
 chroot_sh "apt-get -qq update"
 chroot_sh \