From 635521c7f2e4c793f4ee0d7e0ec841fd1044e587 Mon Sep 17 00:00:00 2001 From: herengui Date: Mon, 21 Aug 2023 11:11:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=BE=99=E8=8A=AF=E6=9E=B6?= =?UTF-8?q?=E6=9E=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: herengui (cherry picked from commit 7a97f8a0aca57f0f484eab035ded80e5963c564b) --- ...arch64-support-not-upstream-modified.patch | 44 +++++++++++++++++++ fwupd.spec | 12 ++++- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 1000-add-loongarch64-support-not-upstream-modified.patch diff --git a/1000-add-loongarch64-support-not-upstream-modified.patch b/1000-add-loongarch64-support-not-upstream-modified.patch new file mode 100644 index 0000000..ff52ef3 --- /dev/null +++ b/1000-add-loongarch64-support-not-upstream-modified.patch @@ -0,0 +1,44 @@ +From d9967378f9b0ba735550f917e4140dd99adc3155 Mon Sep 17 00:00:00 2001 +From: herengui +Date: Sat, 13 May 2023 16:55:11 +0800 +Subject: [PATCH] add loongarch64 support + +Signed-off-by: herengui +--- + meson.build | 3 +++ + plugins/uefi-capsule/efi/generate_binary.py | 4 ++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 0c768a2..d6c88cc 100644 +--- a/meson.build ++++ b/meson.build +@@ -374,6 +374,9 @@ if build_standalone and get_option('plugin_uefi_capsule') + elif host_cpu == 'aarch64' + EFI_MACHINE_TYPE_NAME = 'aa64' + gnu_efi_arch = 'aarch64' ++ elif host_cpu == 'loongarch64' ++ EFI_MACHINE_TYPE_NAME = 'la464' ++ gnu_efi_arch = 'loongarch64' + else + EFI_MACHINE_TYPE_NAME = '' + gnu_efi_arch = '' +diff --git a/plugins/uefi-capsule/efi/generate_binary.py b/plugins/uefi-capsule/efi/generate_binary.py +index 3d1c44c..d263d38 100755 +--- a/plugins/uefi-capsule/efi/generate_binary.py ++++ b/plugins/uefi-capsule/efi/generate_binary.py +@@ -34,9 +34,9 @@ def _run_objcopy(args): + args.outfile, + ] + +- # aarch64 and arm32 don't have an EFI capable objcopy ++ # aarch64, arm32 and loongarch64 don't have an EFI capable objcopy + # Use 'binary' instead, and add required symbols manually +- if args.arch in ["aarch64", "arm"]: ++ if args.arch in ["aarch64", "arm", "loongarch64"]: + argv.extend(["-O", "binary"]) + else: + argv.extend(["--target", "efi-app-{}".format(args.arch)]) +-- +2.39.2 + diff --git a/fwupd.spec b/fwupd.spec index 3e8eee2..53679c5 100644 --- a/fwupd.spec +++ b/fwupd.spec @@ -7,13 +7,13 @@ # of users do not need -- use this to avoid dragging python onto NestOS %global __requires_exclude ^/usr/bin/python3 -%ifarch x86_64 aarch64 +%ifarch x86_64 aarch64 loongarch64 %bcond_without uefi %endif Name: fwupd Version: 1.5.8 -Release: 5 +Release: 6 Summary: Make updating firmware on Linux automatic, safe and reliable License: LGPLv2+ URL: https://github.com/fwupd/fwupd/releases @@ -21,6 +21,8 @@ Source0: http://people.freedesktop.org/~hughsient/releases/%{name}-%{vers #refer: https://github.com/fwupd/fwupd/commit/e74d38bfd3097471fe60dbe843a68c16516a78da Patch0001: 0001-Fix-compiling-with-new-versions-of-efivar.patch +Patch1000: 1000-add-loongarch64-support-not-upstream-modified.patch + BuildRequires: gettext glib2-devel libxmlb-devel valgrind valgrind-devel libgcab1-devel BuildRequires: gpgme-devel libgudev1-devel libgusb-devel libsoup-devel polkit-devel sqlite-devel libxslt BuildRequires: gobject-introspection-devel libarchive-devel systemd gcab elfutils-libelf-devel @@ -100,6 +102,9 @@ sed -i '/DynamicUser=yes/d' data/motd/fwupd-refresh.service.in %ifarch aarch64 %pesign -s -i %{buildroot}%{_libexecdir}/%{name}/efi/%{name}aa64.efi -o %{buildroot}%{_libexecdir}/%{name}/efi/%{name}aa64.efi.signed %endif +%ifarch loongarch64 +%pesign -s -i %{buildroot}%{_libexecdir}/%{name}/efi/%{name}la464.efi -o %{buildroot}%{_libexecdir}/%{name}/efi/%{name}la464.efi.signed +%endif %endif mkdir -pm 0700 %{buildroot}%{_localstatedir}/lib/%{name}/gnupg @@ -182,6 +187,9 @@ mkdir -pm 0700 %{buildroot}%{_localstatedir}/lib/%{name}/gnupg %{_datadir}/man/man1/* %changelog +* Mon Aug 21 2023 herengui - 1.5.8-6 +- add support for loongarch64 + * Thu Dec 01 2022 yaoxin - 1.5.8-5 - Resolve fwupd upgrade and downgrade error -- Gitee