Don't re-show the bootloader for < 5 minute sessions

This isn't necessarily evidence of instability.

Related to #471
This commit is contained in:
Nate Graham
2026-03-18 17:17:45 -06:00
parent 1d7b2ee03f
commit 3ab95cffdf
2 changed files with 2 additions and 7 deletions

View File

@@ -14,11 +14,6 @@ case "${1:-}" in
echo "Multiple operating systems detected, not hiding bootloader."
exit 0
fi
UPTIME_SECONDS="$(cut -d. -f1 /proc/uptime)"
if [ "$UPTIME_SECONDS" -lt 300 ]; then
echo "System uptime was less than 5 minutes, not hiding bootloader."
exit 0
fi
if [ "$(systemctl show -p Result --value kde-linux-bless-boot.service 2>/dev/null || echo "failed")" = "success" ]; then
/usr/bin/bootctl set-timeout 0
fi

View File

@@ -11,7 +11,7 @@ Before=shutdown.target
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/systemd-bless-boot good
# If the boot was blessed, the user shuts the system down normally, and the uptime
# is greater than 5 minutes, the bootloader is hidden, because the current image should work.
# If the boot was blessed and the user shuts the system down normally,
# the bootloader is hidden, because the current image should work.
# This is idempotent if more than one operating system is installed.
ExecStopPost=/usr/lib/auto-hide-bootloader hide