From 7b7745ec2859d4c8044799ecb72da89deb9a407a Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Sat, 11 Feb 2023 16:32:51 +0800 Subject: [PATCH] add loongarch64 support for blivet --- 0001-add-loongarch64-support-for-blivet.patch | 34 +++++++++++++++++++ python-blivet.spec | 11 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0001-add-loongarch64-support-for-blivet.patch diff --git a/0001-add-loongarch64-support-for-blivet.patch b/0001-add-loongarch64-support-for-blivet.patch new file mode 100644 index 0000000..aaed9d8 --- /dev/null +++ b/0001-add-loongarch64-support-for-blivet.patch @@ -0,0 +1,34 @@ +From 26d7d0228dff985138593ef085b5f22bfabee0b7 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Sat, 11 Feb 2023 16:28:21 +0800 +Subject: [PATCH] add loongarch64 support for blivet + +--- + blivet/arch.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/blivet/arch.py b/blivet/arch.py +index 2cd978e..bc76031 100644 +--- a/blivet/arch.py ++++ b/blivet/arch.py +@@ -333,6 +333,8 @@ def is_ipseries(): + def is_powernv(): + return is_ppc() and get_ppc_machine() == "PowerNV" + ++def is_loongarch(): ++ return os.uname()[4] == 'loongarch64' + + def get_arch(): + """ +@@ -349,6 +351,8 @@ def get_arch(): + elif is_ppc(bits=64): + # ppc64 and ppc64le are distinct architectures + return os.uname()[4] ++ elif is_loongarch(): ++ return os.uname()[4] + elif is_aarch64(): + return 'aarch64' + elif is_alpha(): +-- +2.33.0 + diff --git a/python-blivet.spec b/python-blivet.spec index b3f7e03..6aed085 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -3,7 +3,7 @@ Name: python-blivet Version: 3.6.1 -Release: 1 +Release: 2 Epoch: 1 Summary: A python module for system storage configuration License: LGPL-2.1-or-later @@ -23,6 +23,9 @@ Patch1: fix-the-long-hostname.patch patch9001: blivet-3.4.2-sw.patch %endif patch9002: Incomplete-Chineseization-of-disk-mount.patch +%if 0%(test `uname -m` == "loongarch64" && echo 1) +patch9003: 0001-add-loongarch64-support-for-blivet.patch +%endif %description The python-blivet package is a python module for examining and modifying @@ -124,6 +127,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install %doc README.md %changelog +* Sat Feb 11 2023 Wenlong Zhang - 1:3.6.1-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:add loongarch64 support for blivet + * Mon Jan 30 2023 hanhuihui - 1:3.6.1-1 - Type:enhancement - ID:NA -- Gitee