add loongarch64 support for blivet

(cherry picked from commit 5c128cdad7ebd1b27d7a247af2316ec668058db2)
This commit is contained in:
Wenlong Zhang 2023-02-11 14:59:55 +08:00 committed by openeuler-sync-bot
parent 9b724536c1
commit 51480591cb
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From c946520bc7917ee5b1c01c49ce7c866b7faf8eb0 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Sat, 11 Feb 2023 06:48:05 +0000
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

View File

@ -3,7 +3,7 @@
Name: python-blivet
Version: 3.4.2
Release: 5
Release: 6
Epoch: 1
Summary: A python module for system storage configuration
License: LGPLv2+
@ -27,6 +27,9 @@ patch9003: Incomplete-Chineseization-of-disk-mount.patch
patch6001: backport-Exclude-unusable-disks-from-PartitionFactory-1.patch
patch6002: backport-Exclude-unusable-disks-from-PartitionFactory-2.patch
%if 0%(test `uname -m` == "loongarch64" && echo 1)
Patch6003: 0001-add-loongarch64-support-for-blivet.patch
%endif
%description
The python-blivet package is a python module for examining and modifying
@ -127,6 +130,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install
%doc README.md
%changelog
* Sat Feb 11 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 1:3.4.2-6
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add loongarch64 support for blivet
* Tue Dec 27 2022 hanhuihui<hanhuihui5@huawei.com> - 1:3.4.2-5
- Type:bugfix
- ID:NA