1 Star 0 Fork 107

kubuds/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-a-riscv64-enablement-patch-from-upstream.patch 3.68 KB
一键复制 编辑 原始数据 按行查看 历史
From: U2FsdGVkX1 <U2FsdGVkX1@gmail.com>
Signed-off-by: Songsong Zhang <U2FsdGVkX1@gmail.com>
Reviewed-by: Wei Fu <wefu@redhat.com>
Subject: [PATCH] Backport a riscv64 enablement patch from upstream
Signed-off-by: jchzhou <zhoujiacheng@iscas.ac.cn>
---
pyanaconda/modules/storage/bootloader/efi.py | 8 ++++
.../modules/storage/bootloader/factory.py | 8 ++++
pyanaconda/modules/storage/platform.py | 38 +++++++++++++++++++
3 files changed, 54 insertions(+)
diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py
index 1b47e24..6743717 100644
--- a/pyanaconda/modules/storage/bootloader/efi.py
+++ b/pyanaconda/modules/storage/bootloader/efi.py
@@ -214,6 +214,14 @@ class ArmEFIGRUB(EFIGRUB):
self._is_32bit_firmware = True
+class RISCV64EFIGRUB(EFIGRUB):
+ _serial_consoles = ["ttyS"]
+ _efi_binary = "\\grubriscv64.efi"
+
+ def __init__(self):
+ super().__init__()
+ self._packages64 = ["grub2-efi-riscv64"]
+
class MacEFIGRUB(EFIGRUB):
def __init__(self):
super().__init__()
diff --git a/pyanaconda/modules/storage/bootloader/factory.py b/pyanaconda/modules/storage/bootloader/factory.py
index 8aa3afb..4815685 100644
--- a/pyanaconda/modules/storage/bootloader/factory.py
+++ b/pyanaconda/modules/storage/bootloader/factory.py
@@ -146,4 +146,12 @@ class BootLoaderFactory(object):
from pyanaconda.modules.storage.bootloader.efi import ArmEFIGRUB
return ArmEFIGRUB
+ if platform_class is platform.RISCV64:
+ from pyanaconda.modules.storage.bootloader.extlinux import EXTLINUX
+ return EXTLINUX
+
+ if platform_class is platform.RISCV64EFI:
+ from pyanaconda.modules.storage.bootloader.efi import RISCV64EFIGRUB
+ return RISCV64EFIGRUB
+
return None
diff --git a/pyanaconda/modules/storage/platform.py b/pyanaconda/modules/storage/platform.py
index d0aa7ca..20f2c4d 100644
--- a/pyanaconda/modules/storage/platform.py
+++ b/pyanaconda/modules/storage/platform.py
@@ -459,6 +459,40 @@ class ARM(Platform):
}
return dict(super().stage1_constraints, **constraints)
+class RISCV64(Platform):
+
+ @property
+ def stage1_suggestion(self):
+ """The platform-specific suggestion about the stage1 device."""
+ return _(
+ "You must include at least one MBR-formatted "
+ "disk as an install target."
+ )
+
+ @property
+ def stage1_descriptions(self):
+ """The platform-specific descriptions of the stage1 device."""
+ return {
+ "disk": _(MBR_DESCRIPTION),
+ "partition": _(PARTITION_DESCRIPTION)
+ }
+
+ @property
+ def stage1_constraints(self):
+ """The platform-specific constraints for the stage1 device."""
+ constraints = {
+ PLATFORM_DEVICE_TYPES: ["disk"]
+ }
+ return dict(super().stage1_constraints, **constraints)
+
+
+class RISCV64EFI(EFI):
+
+ @property
+ def non_linux_format_types(self):
+ """Format types of devices with non-linux operating systems."""
+ return ["vfat", "ntfs"]
+
def get_platform():
"""Check the architecture of the system and return an instance of a
@@ -486,12 +520,16 @@ def get_platform():
return Aarch64EFI()
elif arch.is_arm():
return ArmEFI()
+ elif arch.is_riscv64():
+ return RISCV64EFI()
else:
return EFI()
elif arch.is_x86():
return X86()
elif arch.is_arm():
return ARM()
+ elif arch.is_riscv64():
+ return RISCV64()
else:
raise SystemError("Could not determine system architecture.")
--
2.44.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kubuds/anaconda.git
git@gitee.com:kubuds/anaconda.git
kubuds
anaconda
anaconda
master

搜索帮助