From 0b9bfec150f9d5ee38c0182c5658b4dee076be4b Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Sun, 20 Oct 2019 13:30:51 -0500 Subject: [PATCH] Add a systemd preset file for `fwupd-refresh.service` Makes `fwupd-refresh.service` strictly opt-in. Some distros are defaulting to all systemd services on and causing more refreshes than desirable by default, especially when using both `gnome-software` and `fwupd-refresh.service` --- contrib/debian/fwupd.install | 1 + contrib/fwupd.spec.in | 1 + data/motd/fwupd-refresh.preset | 1 + data/motd/meson.build | 2 ++ meson.build | 1 + 5 files changed, 6 insertions(+) create mode 100644 data/motd/fwupd-refresh.preset diff --git a/contrib/debian/fwupd.install b/contrib/debian/fwupd.install index ba9c1eca6..0c7c8f78d 100644 --- a/contrib/debian/fwupd.install +++ b/contrib/debian/fwupd.install @@ -14,6 +14,7 @@ usr/lib/*/fwupdoffline usr/lib/*/fwupdtool usr/share/man/man1/* lib/systemd/system/* +lib/systemd/system-preset/* lib/systemd/system-shutdown/* var/lib/fwupd lib/udev/rules.d/* diff --git a/contrib/fwupd.spec.in b/contrib/fwupd.spec.in index 969387405..d331da9b8 100644 --- a/contrib/fwupd.spec.in +++ b/contrib/fwupd.spec.in @@ -287,6 +287,7 @@ rm ${RPM_BUILD_ROOT}%{_sbindir}/flashrom %{_unitdir}/fwupd.service %{_unitdir}/fwupd-refresh.service %{_unitdir}/fwupd-refresh.timer +%{_presetdir}/fwupd-refresh.preset %{_unitdir}/system-update.target.wants/ %dir %{_localstatedir}/lib/fwupd %dir %{_datadir}/fwupd/quirks.d diff --git a/data/motd/fwupd-refresh.preset b/data/motd/fwupd-refresh.preset new file mode 100644 index 000000000..a6b18e059 --- /dev/null +++ b/data/motd/fwupd-refresh.preset @@ -0,0 +1 @@ +disable fwupd-refresh.service diff --git a/data/motd/meson.build b/data/motd/meson.build index 3a1852bd2..b583fb7f7 100644 --- a/data/motd/meson.build +++ b/data/motd/meson.build @@ -11,6 +11,8 @@ con2.set('motd_fullpath', motd_fullpath) if get_option('systemd') install_data(['fwupd-refresh.timer'], install_dir: systemdunitdir) + install_data(['fwupd-refresh.preset'], + install_dir: systemdsystempresetdir) dynamic_options = [] if systemd.version().version_compare('>= 243') diff --git a/meson.build b/meson.build index 0de0d5ebe..2a13eabde 100644 --- a/meson.build +++ b/meson.build @@ -306,6 +306,7 @@ if build_standalone and get_option('systemd') if systemdunitdir == '' and get_option('systemd') systemdunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') endif + systemdsystempresetdir = systemd.get_pkgconfig_variable('systemdsystempresetdir') endif if build_standalone and get_option('elogind')