From aea41d44e6e7ee3f47a2426437fdcd08c79b5012 Mon Sep 17 00:00:00 2001 From: anolis-bot Date: Wed, 17 May 2023 00:25:16 +0800 Subject: [PATCH] update to gnome-settings-daemon-3.32.0-19.el8 Signed-off-by: anolis-bot --- ...n-action-always-power-off-when-chass.patch | 47 +++++++++++++++ ...e-nothing-power-button-action-for-VM.patch | 59 +++++++++++++++++++ dist | 2 +- gnome-settings-daemon.spec | 38 ++++++------ 4 files changed, 124 insertions(+), 22 deletions(-) create mode 100644 0001-Make-power-button-action-always-power-off-when-chass.patch create mode 100644 0001-power-Respect-the-nothing-power-button-action-for-VM.patch diff --git a/0001-Make-power-button-action-always-power-off-when-chass.patch b/0001-Make-power-button-action-always-power-off-when-chass.patch new file mode 100644 index 0000000..c44cc4f --- /dev/null +++ b/0001-Make-power-button-action-always-power-off-when-chass.patch @@ -0,0 +1,47 @@ +From bd0488fe501bae74fae1fbb21566aa35f38aa6fc Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Wed, 15 Feb 2023 15:27:59 +0100 +Subject: [PATCH] Make power-button-action always power off when chassis=server + +Servers often don't support hibernation/suspend. +--- + ...rg.gnome.settings-daemon.plugins.power.gschema.xml.in | 2 +- + plugins/media-keys/gsd-media-keys-manager.c | 9 ++++++--- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +index fc61d133..952104ed 100644 +--- a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in ++++ b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +@@ -39,7 +39,7 @@ + + 'suspend' + Power button action +- The action to take when the system power button is pressed. Virtual machines only honor the 'nothing' action, and will shutdown otherwise. Tablets always suspend, ignoring all the other action options. ++ The action to take when the system power button is pressed. Virtual machines and servers only honor the 'nothing' action, and will shutdown otherwise. Tablets always suspend, ignoring all the other action options. + + + +diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c +index ac6f7ab4..46bdade6 100644 +--- a/plugins/media-keys/gsd-media-keys-manager.c ++++ b/plugins/media-keys/gsd-media-keys-manager.c +@@ -2083,9 +2083,12 @@ do_config_power_button_action (GsdMediaKeysManager *manager, + if (manager->priv->power_button_disabled) + return; + +- action_type = g_settings_get_enum (manager->priv->power_settings, "power-button-action"); +- /* Always power off VMs, except when power-button-action is "nothing" */ +- if (g_strcmp0 (manager->priv->chassis_type, "vm") == 0) { ++ action_type = g_settings_get_enum (manager->priv->power_settings, "power-button-action"); ++ /* Always power off VMs and servers, except when power-button-action is "nothing" */ ++ if (g_strcmp0 (manager->priv->chassis_type, "vm") == 0 || ++ g_strcmp0 (manager->priv->chassis_type, "server")) { ++ g_warning ("Virtual machines and servers only honor the 'nothing' power-button-action, and will shutdown otherwise"); ++ + if (action_type != GSD_POWER_BUTTON_ACTION_NOTHING) + power_action (manager, "PowerOff", !in_lock_screen); + +-- +2.37.1 + diff --git a/0001-power-Respect-the-nothing-power-button-action-for-VM.patch b/0001-power-Respect-the-nothing-power-button-action-for-VM.patch new file mode 100644 index 0000000..84e6e63 --- /dev/null +++ b/0001-power-Respect-the-nothing-power-button-action-for-VM.patch @@ -0,0 +1,59 @@ +From 0e2c4aec104b65d2f8ea7167269e91c303908a6f Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Wed, 4 Jan 2023 15:30:15 +0100 +Subject: [PATCH] power: Respect the "nothing" power-button-action for VMs + +There are use-cases when one wants to forcefully make the guest ignore +poweroff requests from the hypervisor. + +See https://bugzilla.redhat.com/2062051 + +See also https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/46 +--- + ...org.gnome.settings-daemon.plugins.power.gschema.xml.in | 2 +- + plugins/media-keys/gsd-media-keys-manager.c | 8 +++++--- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +index 93c704e9..fc61d133 100644 +--- a/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in ++++ b/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in +@@ -39,7 +39,7 @@ + + 'suspend' + Power button action +- The action to take when the system power button is pressed. This action is hard-coded (and the setting ignored) on virtual machines (power off) and tablets (suspend). ++ The action to take when the system power button is pressed. Virtual machines only honor the 'nothing' action, and will shutdown otherwise. Tablets always suspend, ignoring all the other action options. + + + +diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c +index a526d5cf..ac6f7ab4 100644 +--- a/plugins/media-keys/gsd-media-keys-manager.c ++++ b/plugins/media-keys/gsd-media-keys-manager.c +@@ -2083,9 +2083,12 @@ do_config_power_button_action (GsdMediaKeysManager *manager, + if (manager->priv->power_button_disabled) + return; + +- /* Always power off VMs when power off is pressed in the menus */ ++ action_type = g_settings_get_enum (manager->priv->power_settings, "power-button-action"); ++ /* Always power off VMs, except when power-button-action is "nothing" */ + if (g_strcmp0 (manager->priv->chassis_type, "vm") == 0) { +- power_action (manager, "PowerOff", !in_lock_screen); ++ if (action_type != GSD_POWER_BUTTON_ACTION_NOTHING) ++ power_action (manager, "PowerOff", !in_lock_screen); ++ + return; + } + +@@ -2095,7 +2098,6 @@ do_config_power_button_action (GsdMediaKeysManager *manager, + return; + } + +- action_type = g_settings_get_enum (manager->priv->power_settings, "power-button-action"); + switch (action_type) { + case GSD_POWER_BUTTON_ACTION_SUSPEND: + action = GSD_POWER_ACTION_SUSPEND; +-- +2.37.1 + diff --git a/dist b/dist index 0ee7539..9c0e36e 100644 --- a/dist +++ b/dist @@ -1 +1 @@ -an8_6 +an8 diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec index d89e41e..a559b4a 100644 --- a/gnome-settings-daemon.spec +++ b/gnome-settings-daemon.spec @@ -1,5 +1,3 @@ -%define anolis_release .0.1 - %global glib2_version 2.56 %global geocode_glib_version 3.10.0 %global gnome_desktop_version 3.27.90 @@ -14,7 +12,7 @@ Name: gnome-settings-daemon Version: 3.32.0 -Release: 16%{anolis_release}%{?dist}.1 +Release: 19%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications License: GPLv2+ @@ -70,7 +68,6 @@ Requires: gnome-desktop3%{?_isa} >= %{gnome_desktop_version} Requires: gsettings-desktop-schemas%{?_isa} >= %{gsettings_desktop_schemas_version} Requires: gtk3%{?_isa} >= %{gtk3_version} Requires: libgweather%{?_isa} >= %{libgweather_version} -Requires: glibc Obsoletes: %{name}-updates < 3.13.1 Obsoletes: drwright < 3.5.0-3 @@ -123,8 +120,12 @@ Patch50017: 0017-Update-translations.patch Patch60001: 0001-power-Only-disable-Suspend-Hibernate-actions-inside-.patch -Patch70001: 0001-power-Avoid-automatic-logout-in-GDM-greeter.patch -Patch70002: 0002-power-Never-register-sleep-timeout-for-logout-in-GDM.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2062051 +Patch70001: 0001-power-Respect-the-nothing-power-button-action-for-VM.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2018606 +Patch70002: 0001-power-Avoid-automatic-logout-in-GDM-greeter.patch +Patch70003: 0002-power-Never-register-sleep-timeout-for-logout-in-GDM.patch +Patch70004: 0001-Make-power-button-action-always-power-off-when-chass.patch %description A daemon to share settings from GNOME to other applications. It also @@ -138,14 +139,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release} The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%package doc -Summary: Documents for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - -%description doc -Doc pages for %{name}. - %prep %autosetup -S git @@ -164,6 +157,7 @@ mkdir $RPM_BUILD_ROOT%{_libdir}/gnome-settings-daemon-3.0/gtk-modules %files -f %{name}.lang %license COPYING +%doc AUTHORS NEWS # list daemons explicitly, so we notice if one goes missing # some of these don't have a separate gschema @@ -262,16 +256,18 @@ mkdir $RPM_BUILD_ROOT%{_libdir}/gnome-settings-daemon-3.0/gtk-modules %{_includedir}/gnome-settings-daemon-3.0 %{_libdir}/pkgconfig/gnome-settings-daemon.pc -%files doc -%doc AUTHORS NEWS - %changelog -* Fri Sep 23 2022 Zhao Hang - 3.32.0-16.0.1.el8_6.1 -- Add doc sub package +* Fri Feb 17 2023 Felipe Borges - 4.32.0-19 +- Make power-button-action default to poweroff on servers +- Resolves: #1920829 -* Wed Aug 31 2022 Tomas Popela - 3.32.0-16.el8_6.1 +* Tue Jan 24 2023 Felipe Borges - 3.32.0-18 - Prevent automatic logout warning in greeter sessions -- Resolves: #2122964 +- Resolves: #2018606 + +* Wed Jan 04 2023 Felipe Borges - 3.32.0-17 +- Make power-button-action respect the "nothing" action on VMs +- Resolves: #2062051 * Fri Sep 10 2021 Kalev Lember - 3.32.0-16 - Update pt_BR translations -- Gitee