SHA256
1
0
forked from pool/fwupd

Accepting request 831661 from home:qkzhu:branches:Base:System

- Add fwupd-jscSLE-11766-close-efidir-leap-gap.patch: Set SLE and
  openSUSE esp os dir at runtime (jsc#SLE-11766)
- Drop _multibuild and build option -Defi_os_dir="%{efidir}": with
  the above patch fwupd can detect esp os dir dynamically
- Update the efidir related %post and %postun scripts in spec file

OBS-URL: https://build.opensuse.org/request/show/831661
OBS-URL: https://build.opensuse.org/package/show/Base:System/fwupd?expand=0&rev=76
This commit is contained in:
Marcus Meissner 2020-09-03 15:32:22 +00:00 committed by Git OBS Bridge
parent bac8c88bbe
commit c08240c54b
4 changed files with 38 additions and 42 deletions

View File

@ -1,4 +0,0 @@
<multibuild>
<package>openSUSE</package>
<package>SLE</package>
</multibuild>

View File

@ -0,0 +1,18 @@
diff --git a/plugins/uefi/fu-uefi-common.c b/plugins/uefi/fu-uefi-common.c
index 6cd55672..6a710cdb 100644
--- a/plugins/uefi/fu-uefi-common.c
+++ b/plugins/uefi/fu-uefi-common.c
@@ -227,9 +227,13 @@ fu_uefi_get_esp_path_for_os (const gchar *base)
g_autofree gchar *esp_path = NULL;
g_autoptr(GError) error_local = NULL;
g_autoptr(GHashTable) os_release = fwupd_get_os_release (&error_local);
+ g_auto(GStrv) split = NULL;
/* try to lookup /etc/os-release ID key */
if (os_release != NULL) {
os_release_id = g_hash_table_lookup (os_release, "ID");
+ /* Overide os_release_id for SLE and openSUSE */
+ split = g_strsplit (g_hash_table_lookup (os_release, "NAME"), " ", 2);
+ os_release_id = g_ascii_strdown (split[0], -1);
} else {
g_debug ("failed to get ID: %s", error_local->message);
}

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Sep 2 10:18:55 UTC 2020 - QK ZHU <qkzhu@suse.com>
- Add fwupd-jscSLE-11766-close-efidir-leap-gap.patch: Set SLE and
openSUSE esp os dir at runtime (jsc#SLE-11766)
- Drop _multibuild and build option -Defi_os_dir="%{efidir}": with
the above patch fwupd can detect esp os dir dynamically
- Update the efidir related %post and %postun scripts in spec file
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jul 30 14:52:34 UTC 2020 - dimstar@opensuse.org Thu Jul 30 14:52:34 UTC 2020 - dimstar@opensuse.org

View File

@ -17,34 +17,11 @@
# needssslcertforbuild # needssslcertforbuild
%define flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
ExclusiveArch: %{nil}
%else
%define branding_name %{flavor}
%if "%{flavor}" == "SLE"
%define build_SLE 1
%else
%define build_openSUSE 1
%endif
%endif
%if (0%{?build_SLE} && 0%{?is_opensuse}) || (0%{?build_openSUSE} && ! 0%{?is_opensuse})
# Don't build SLE branding on openSUSE and vice-versa
ExclusiveArch: %{nil}
%endif
%ifarch %{ix86} x86_64 aarch64 %ifarch %{ix86} x86_64 aarch64
%bcond_without efi_fw_update %bcond_without efi_fw_update
%else %else
%bcond_with efi_fw_update %bcond_with efi_fw_update
%endif %endif
%if 0%{?build_openSUSE}
%global efidir opensuse
%else
%global efidir sles
%endif
Name: fwupd Name: fwupd
Version: 1.4.5 Version: 1.4.5
@ -59,6 +36,8 @@ Source: %{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE fwupd-bsc1130056-shim-path.patch bsc#1130056 # PATCH-FIX-OPENSUSE fwupd-bsc1130056-shim-path.patch bsc#1130056
Patch1: fwupd-bsc1130056-change-shim-path.patch Patch1: fwupd-bsc1130056-change-shim-path.patch
# PATCH-FIX-OPENSUSE fwupd-jscSLE-11766-close-efidir-leap-gap.patch jsc#SLE-11766 qkzhu@suse.com -- Set SLE and openSUSE esp os dir at runtime
Patch2: fwupd-jscSLE-11766-close-efidir-leap-gap.patch
BuildRequires: dejavu-fonts BuildRequires: dejavu-fonts
BuildRequires: fish BuildRequires: fish
@ -205,8 +184,6 @@ done
-Dplugin_nvme=false \ -Dplugin_nvme=false \
-Dplugin_redfish=false \ -Dplugin_redfish=false \
-Dplugin_uefi=false \ -Dplugin_uefi=false \
%else
-Defi_os_dir="%{efidir}" \
%endif %endif
%ifnarch %{ix86} x86_64 %ifnarch %{ix86} x86_64
-Dplugin_dell=false \ -Dplugin_dell=false \
@ -254,23 +231,19 @@ ln -s %{_libexecdir}/fwupd/efi/$FWUPD_EFI %{buildroot}/%{_libexecdir}/fwupd/efi/
%post %post
%udev_rules_update %udev_rules_update
%service_add_post %{name}.service fwupd-offline-update.service %service_add_post %{name}.service fwupd-offline-update.service
%if %{with efi_fw_update}
if [ -d "/boot/efi/EFI/%{efidir}" ]; then
# Create the directory for firwmare update capsules
mkdir -p /boot/efi/EFI/%{efidir}/fw
# Install the UEFI firmware update program
cp %{_libexecdir}/fwupd/efi/fwupd*.efi /boot/efi/EFI/%{efidir}
fi
%endif
%postun %postun
%service_del_postun %{name}.service fwupd-offline-update.service %service_del_postun %{name}.service fwupd-offline-update.service
%if %{with efi_fw_update} %if %{with efi_fw_update}
if [ "$1" = 0 ] && [ -d "/boot/efi/EFI/%{efidir}" ] ; then if [ -e /etc/os-release ]; then
# Remove all capsule files . /etc/os-release
rm -rf /boot/efi/EFI/%{efidir}/fw efi_distributor="$(echo "${NAME} ${VERSION}" | tr 'A-Z' 'a-z' | cut -d' ' -f1)"
# Remove the UEFI firmware update program fi
rm -f /boot/efi/EFI/%{efidir}/fwupd*.efi if [ "$1" = 0 ] && [ -d "/boot/efi/EFI/$efi_distributor" ]; then
# Remove all capsule files
rm -rf /boot/efi/EFI/"$efi_distributor"/fw
# Remove the UEFI firmware update program
rm -f /boot/efi/EFI/"$efi_distributor"/fwupd*.efi
fi fi
%endif %endif