This commit is contained in:
chenholmes 2020-04-03 11:20:49 +08:00
parent b1eb0fa4a8
commit 4e4d145191
2 changed files with 4 additions and 60 deletions

View File

@ -1,58 +0,0 @@
From 10d271c9819e3b9986e50e1eede7d3c126c45ff5 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 14 Aug 2018 14:49:59 +0200
Subject: [PATCH 2/2] Fedora: Set grub boot-flags on shutdown / reboot
Fedora's grub will automatically hide the boot-menu if the previous
boot has set the boot_success flag in grub's environment. This happens
automatically 30 seconds after login.
But if the user shuts down or reboots from the system-menu before then
(e.g. directly from gdm) then the boot_success flag gets not set. If
a reboot / shutdown is initiated through gnome-session then the user
is successfully interacting with the system, so set the boot_success
flag from gnome_session for this case to fix reboot from gdm leading to
the boot-menu not being hidden.
Likewise implement ConfirmedRebootMenu handling in a Fedora specific
way (for now) by setting the menu_show_once grub bootflag in this case.
---
gnome-session/gsm-manager.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index e0f190a1..1444c553 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -3716,14 +3716,27 @@ do_query_end_session_exit (GsmManager *manager)
break;
case GSM_MANAGER_LOGOUT_REBOOT:
case GSM_MANAGER_LOGOUT_REBOOT_INTERACT:
+ /*
+ * Fedora specific patch to make sure the boot-menu does not
+ * show when it is configured to auto-hide and a reboot is
+ * initiated directly from gdm.
+ */
+ system("/usr/sbin/grub2-set-bootflag boot_success");
reboot = TRUE;
break;
case GSM_MANAGER_LOGOUT_REBOOT_TO_BOOT_OPTIONS:
- /* FIXME tell bootmanager to show menu on next boot */
+ /* Fedora specific implementation to show the menu on next boot */
+ system("/usr/sbin/grub2-set-bootflag menu_show_once");
reboot = TRUE;
break;
case GSM_MANAGER_LOGOUT_SHUTDOWN:
case GSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT:
+ /*
+ * Fedora specific patch to make sure the boot-menu does not
+ * show when it is configured to auto-hide and a shutdown is
+ * initiated directly from gdm.
+ */
+ system("/usr/sbin/grub2-set-bootflag boot_success");
shutdown = TRUE;
break;
default:
--
2.19.0

View File

@ -1,13 +1,12 @@
Name: gnome-session
Summary: Session Management Tools for the GNOME Desktop
Version: 3.30.1
Release: 3
Release: 4
License: GPLv2+
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/%{name}/3.30/%{name}-%{version}.tar.xz
Patch0001: 0001-check-accelerated-gles-Use-eglGetPlatformDisplay-EXT.patch
Patch0002: 0001-Add-support-for-new-ConfirmedRebootToBootOptions-sig.patch
Patch0003: 0002-Fedora-Set-grub-boot-flags-on-shutdown-reboot.patch
BuildRequires: meson gcc gettext intltool xmlto usermode /usr/bin/xsltproc
BuildRequires: pkgconfig(gl) pkgconfig(egl) pkgconfig(glesv2) pkgconfig(gnome-desktop-3.0)
@ -65,6 +64,9 @@ sed -i 's/idm[0-9]\{5,32\}\"/idm123456789123456\"/g' $(find -name %{name}.html)
%postun -p /sbin/ldconfig
%changelog
* Fri Apr 3 2020 chenli <chenli147@huawei.com> - 3.30.1-4
- modify spec
* Wed Nov 20 2019 caomeng<caomeng5@huawei.com> - 3.30.1-3
- Package init