From: Plom Heller Date: Fri, 11 Sep 2026 07:40:30 +0000 (+0200) Subject: On hibernation failure, poweroff nonetheless. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/test.html?a=commitdiff_plain;h=HEAD;p=confplom On hibernation failure, poweroff nonetheless. --- diff --git a/setup_scripts/start_root_t490s.sh b/setup_scripts/start_root_t490s.sh index cd39b45..1c74d61 100755 --- a/setup_scripts/start_root_t490s.sh +++ b/setup_scripts/start_root_t490s.sh @@ -9,6 +9,8 @@ include render_template # constants unlikely to change PATH_DEFAULT_LOCALE=/etc/default/locale +PATH_HIBERNATE_OVERRIDE=/etc/systemd/system/systemd-hibernate.service.d/\ +60-poweroff-on-failure.conf PATH_HOOK_EFI=/etc/initramfs/post-update.d/update-efi PATH_SYSCTL_PRINTK=/etc/sysctl.d/60-printk-console.conf PATH_TLP_THRESH_CONF=/etc/tlp.conf.d/60-thresholds.conf @@ -54,6 +56,11 @@ printf 'START_CHARGE_THRESH_BAT0=%s\nSTOP_CHARGE_THRESH_BAT0=%s\n' \ "${TLP_THRESH_START}" "${TLP_THRESH_STOP}" >| "${PATH_TLP_THRESH_CONF}" tlp start +msg 'Falling back to poweroff on a failed hibernate attempt …' +mkdir -p "$(dirname "${PATH_HIBERNATE_OVERRIDE}")" +printf '[Unit]\nOnFailure=poweroff.target\n' >| "${PATH_HIBERNATE_OVERRIDE}" +systemctl daemon-reload + msg 'Making backlight devices available to user-run backlight script …' cp "${PATH_TO_COPY}/${FNAME_UDEV_RULES_BACKLIGHT}" "${PATH_UDEV_RULES}/" udevadm control --reload-rules