Blame SOURCES/0001-Fedora-Set-grub-boot-flags-on-shutdown-reboot.patch

ddb239
From e3d6f1c1d342d0c74f2125ea0efa2a9669aaa8df Mon Sep 17 00:00:00 2001
ddb239
From: Hans de Goede <hdegoede@redhat.com>
ddb239
Date: Tue, 14 Aug 2018 14:49:59 +0200
ddb239
Subject: [PATCH] Fedora: Set grub boot-flags on shutdown / reboot
ddb239
ddb239
Fedora's grub will automatically hide the boot-menu if the previous
ddb239
boot has set the boot_success flag in grub's environment. This happens
ddb239
automatically 30 seconds after login.
ddb239
ddb239
But if the user shuts down or reboots from the system-menu before then
ddb239
(e.g. directly from gdm) then the boot_success flag gets not set. If
ddb239
a reboot / shutdown is initiated through gnome-session then the user
ddb239
is successfully interacting with the system, so set the boot_success
ddb239
flag from gnome_session for this case to fix reboot from gdm leading to
ddb239
the boot-menu not being hidden.
ddb239
---
ddb239
 gnome-session/gsm-manager.c | 12 ++++++++++++
ddb239
 1 file changed, 12 insertions(+)
ddb239
ddb239
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
ddb239
index 6839a02d..589efb02 100644
ddb239
--- a/gnome-session/gsm-manager.c
ddb239
+++ b/gnome-session/gsm-manager.c
ddb239
@@ -3823,10 +3823,22 @@ do_query_end_session_exit (GsmManager *manager)
ddb239
                 break;
ddb239
         case GSM_MANAGER_LOGOUT_REBOOT:
ddb239
         case GSM_MANAGER_LOGOUT_REBOOT_INTERACT:
ddb239
+                /*
ddb239
+                 * Fedora specific patch to make sure the boot-menu does not
ddb239
+                 * show when it is configured to auto-hide and a reboot is
ddb239
+                 * initiated directly from gdm.
ddb239
+                 */
ddb239
+                system("/usr/sbin/grub2-set-bootflag boot_success");
ddb239
                 reboot = TRUE;
ddb239
                 break;
ddb239
         case GSM_MANAGER_LOGOUT_SHUTDOWN:
ddb239
         case GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT:
ddb239
+                /*
ddb239
+                 * Fedora specific patch to make sure the boot-menu does not
ddb239
+                 * show when it is configured to auto-hide and a shutdown is
ddb239
+                 * initiated directly from gdm.
ddb239
+                 */
ddb239
+                system("/usr/sbin/grub2-set-bootflag boot_success");
ddb239
                 shutdown = TRUE;
ddb239
                 break;
ddb239
         default:
ddb239
-- 
ddb239
2.28.0
ddb239