python-blivet/1000-add-loongarch64-support-not-upstream-modified-files.patch
panchenbo d9e348de5b turn on sw_64 loongarch for all arch reorder patchs
(cherry picked from commit 2267283183eaf907193274777a2037c61a039af0)
2023-09-25 14:12:41 +08:00

35 lines
886 B
Diff

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