diff --git a/00fdf83cd662291c40ebda942c9d08abe997b699.patch b/00fdf83cd662291c40ebda942c9d08abe997b699.patch new file mode 100644 index 0000000..6d5b714 --- /dev/null +++ b/00fdf83cd662291c40ebda942c9d08abe997b699.patch @@ -0,0 +1,56 @@ +From 00fdf83cd662291c40ebda942c9d08abe997b699 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Mon, 26 Aug 2019 23:37:32 -0500 +Subject: [PATCH] Use more systemd directives for directories + +systemd will automatically create these directories if missing +and also will set permissions accordingly on them. +--- + data/fwupd.service.in | 3 +++ + data/meson.build | 6 +----- + meson_post_install.sh | 2 -- + 3 files changed, 4 insertions(+), 7 deletions(-) + +diff --git a/data/fwupd.service.in b/data/fwupd.service.in +index 36b994b92..4085632e5 100644 +--- a/data/fwupd.service.in ++++ b/data/fwupd.service.in +@@ -8,6 +8,9 @@ Before=display-manager.service + Type=dbus + BusName=org.freedesktop.fwupd + ExecStart=@libexecdir@/fwupd/fwupd ++StateDirectory=@package_name@ ++CacheDirectory=@package_name@ ++ConfigurationDirectory=@package_name@ + PrivateTmp=yes + ProtectHome=yes + ProtectSystem=full +diff --git a/data/meson.build b/data/meson.build +index 20f87dd96..829c01f89 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -39,12 +39,8 @@ if get_option('systemd') + con2.set('bindir', bindir) + con2.set('datadir', datadir) + con2.set('localstatedir', localstatedir) +- ++ con2.set('package_name', meson.project_name()) + rw_directories = [] +- rw_directories += join_paths (localstatedir, 'lib', 'fwupd') +- rw_directories += join_paths (localstatedir, 'cache', 'fwupd') +- rw_directories += join_paths (sysconfdir, 'fwupd') +- rw_directories += join_paths (sysconfdir, 'fwupd', 'remotes.d') + if get_option('plugin_uefi') + rw_directories += ['-/boot/efi', '-/efi/EFI', '-/boot/EFI'] + endif +diff --git a/meson_post_install.sh b/meson_post_install.sh +index 0cbb6f419..d757a81ae 100755 +--- a/meson_post_install.sh ++++ b/meson_post_install.sh +@@ -11,6 +11,4 @@ LOCALSTATEDIR=$2 + echo 'Updating systemd deps' + mkdir -p ${DESTDIR}${SYSTEMDUNITDIR}/system-update.target.wants + ln -sf ../fwupd-offline-update.service ${DESTDIR}${SYSTEMDUNITDIR}/system-update.target.wants/fwupd-offline-update.service +- echo 'Creating stateful directory' +- mkdir -p ${DESTDIR}${LOCALSTATEDIR}/lib/fwupd + #fi diff --git a/277c196369f86f65f8831a049d01fab84cee4b1f.patch b/277c196369f86f65f8831a049d01fab84cee4b1f.patch new file mode 100644 index 0000000..81f44dc --- /dev/null +++ b/277c196369f86f65f8831a049d01fab84cee4b1f.patch @@ -0,0 +1,40 @@ +From 277c196369f86f65f8831a049d01fab84cee4b1f Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Mon, 26 Aug 2019 23:42:23 -0500 +Subject: [PATCH] fu-common: Use environment variables for systemd managed + directories + +The systemd unit will set these, create these directories and set all +permissions. If that has happened, use them. +--- + src/fu-common.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/fu-common.c b/src/fu-common.c +index 2b5abc9d1..684a21185 100644 +--- a/src/fu-common.c ++++ b/src/fu-common.c +@@ -1025,14 +1025,23 @@ fu_common_get_path (FuPathKind path_kind) + #endif + /* /etc/fwupd */ + case FU_PATH_KIND_SYSCONFDIR_PKG: ++ tmp = g_getenv ("CONFIGURATION_DIRECTORY"); ++ if (tmp != NULL) ++ return g_build_filename (tmp, NULL); + basedir = fu_common_get_path (FU_PATH_KIND_SYSCONFDIR); + return g_build_filename (basedir, PACKAGE_NAME, NULL); + /* /var/lib/fwupd */ + case FU_PATH_KIND_LOCALSTATEDIR_PKG: ++ tmp = g_getenv ("STATE_DIRECTORY"); ++ if (tmp != NULL) ++ return g_build_filename (tmp, NULL); + basedir = fu_common_get_path (FU_PATH_KIND_LOCALSTATEDIR); + return g_build_filename (basedir, "lib", PACKAGE_NAME, NULL); + /* /var/cache/fwupd */ + case FU_PATH_KIND_CACHEDIR_PKG: ++ tmp = g_getenv ("CACHE_DIRECTORY"); ++ if (tmp != NULL) ++ return g_build_filename (tmp, NULL); + basedir = fu_common_get_path (FU_PATH_KIND_LOCALSTATEDIR); + return g_build_filename (basedir, "cache", PACKAGE_NAME, NULL); + case FU_PATH_KIND_POLKIT_ACTIONS: diff --git a/fwupd.spec b/fwupd.spec index 14af641..6e4da2a 100644 --- a/fwupd.spec +++ b/fwupd.spec @@ -35,11 +35,15 @@ Summary: Firmware update daemon Name: fwupd Version: 1.2.11 -Release: 1%{?dist} +Release: 2%{?dist} License: LGPLv2+ URL: https://github.com/hughsie/fwupd Source0: http://people.freedesktop.org/~hughsient/releases/%{name}-%{version}.tar.xz +# Backported from upstream +Patch1: 00fdf83cd662291c40ebda942c9d08abe997b699.patch +Patch2: 277c196369f86f65f8831a049d01fab84cee4b1f.patch + BuildRequires: gettext BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: libxmlb-devel >= %{libxmlb_version} @@ -200,6 +204,9 @@ Data files for installed tests. mkdir -p --mode=0700 $RPM_BUILD_ROOT%{_localstatedir}/lib/fwupd/gnupg +# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1757948 +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/fwupd + %find_lang %{name} %post @@ -267,6 +274,7 @@ mkdir -p --mode=0700 $RPM_BUILD_ROOT%{_localstatedir}/lib/fwupd/gnupg %{_unitdir}/fwupd.service %{_unitdir}/system-update.target.wants/ %dir %{_localstatedir}/lib/fwupd +%dir %{_localstatedir}/cache/fwupd %dir %{_datadir}/fwupd/quirks.d %{_datadir}/fwupd/quirks.d/*.quirk %{_localstatedir}/lib/fwupd/builder/README.md @@ -343,6 +351,9 @@ mkdir -p --mode=0700 $RPM_BUILD_ROOT%{_localstatedir}/lib/fwupd/gnupg %config(noreplace)%{_sysconfdir}/fwupd/remotes.d/fwupd-tests.conf %changelog +* Tue Oct 08 2019 Richard Hughes 1.2.11-2 +- Manually create /var/cache/fwupd to work around #1757948 + * Sat Sep 28 2019 Richard Hughes 1.2.11-1 - New upstream release - Actually write the new device path if different than before