mirror of
https://github.com/KDE/kde-linux.git
synced 2026-05-19 14:04:06 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user