From 295dd2e016727ec5b21164327604c51896110ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BD=AC=E7=90=9B?= Date: Thu, 14 Aug 2025 07:24:51 +0000 Subject: [PATCH] support sw_64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张彬琛 --- 1010-support-for-sw_64-architecture.patch | 122 ++++++++++++++++++++++ anaconda.spec | 6 +- 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 1010-support-for-sw_64-architecture.patch diff --git a/1010-support-for-sw_64-architecture.patch b/1010-support-for-sw_64-architecture.patch new file mode 100644 index 0000000..38897c2 --- /dev/null +++ b/1010-support-for-sw_64-architecture.patch @@ -0,0 +1,122 @@ +From dd033e4ac6601491e17cb33252fcc9fb6070df59 Mon Sep 17 00:00:00 2001 +From: zhangbinchen +Date: Thu, 14 Aug 2025 15:12:13 +0800 +Subject: [PATCH] support for sw_64 architecture + +Signed-off-by: zhangbinchen +--- + pyanaconda/modules/storage/bootloader/efi.py | 9 ++++- + .../modules/storage/bootloader/factory.py | 8 ++++ + pyanaconda/modules/storage/platform.py | 38 +++++++++++++++++++ + 3 files changed, 54 insertions(+), 1 deletion(-) + +diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py +index 22ceefb..362c6a9 100644 +--- a/pyanaconda/modules/storage/bootloader/efi.py ++++ b/pyanaconda/modules/storage/bootloader/efi.py +@@ -28,7 +28,7 @@ from pyanaconda.product import productName + from pyanaconda.anaconda_loggers import get_module_logger + log = get_module_logger(__name__) + +-__all__ = ["EFIBase", "EFIGRUB", "Aarch64EFIGRUB", "ArmEFIGRUB", "MacEFIGRUB", "LOONGARCHEFIGRUB"] ++__all__ = ["EFIBase", "EFIGRUB", "Aarch64EFIGRUB", "ArmEFIGRUB", "MacEFIGRUB", "LOONGARCHEFIGRUB", "SW64EFIGRUB"] + + + class EFIBase(object): +@@ -251,6 +251,13 @@ class RISCV64EFIGRUB(EFIGRUB): + super().__init__() + self._packages64 = ["grub2-efi-riscv64"] + ++class SW64EFIGRUB(EFIGRUB): ++ _serial_consoles = ["ttyS"] ++ _efi_binary = "\\grubsw64.efi" ++ ++ def __init__(self): ++ super().__init__() ++ self._packages64 = ["grub2-efi-sw64"] + + class MacEFIGRUB(EFIGRUB): + def __init__(self): +diff --git a/pyanaconda/modules/storage/bootloader/factory.py b/pyanaconda/modules/storage/bootloader/factory.py +index 7accc22..b9f35ae 100644 +--- a/pyanaconda/modules/storage/bootloader/factory.py ++++ b/pyanaconda/modules/storage/bootloader/factory.py +@@ -158,4 +158,12 @@ class BootLoaderFactory(object): + from pyanaconda.modules.storage.bootloader.efi import RISCV64EFIGRUB + return RISCV64EFIGRUB + ++ if platform_class is platform.SW64: ++ from pyanaconda.modules.storage.bootloader.extlinux import EXTLINUX ++ return EXTLINUX ++ ++ if platform_class is platform.SW64EFI: ++ from pyanaconda.modules.storage.bootloader.efi import SW64EFIGRUB ++ return SW64EFIGRUB ++ + return None +diff --git a/pyanaconda/modules/storage/platform.py b/pyanaconda/modules/storage/platform.py +index 4cac175..49967ab 100644 +--- a/pyanaconda/modules/storage/platform.py ++++ b/pyanaconda/modules/storage/platform.py +@@ -502,6 +502,40 @@ class RISCV64EFI(EFI): + """Format types of devices with non-linux operating systems.""" + return ["vfat", "ntfs"] + ++class SW64(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 SW64EFI(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 +@@ -533,6 +567,8 @@ def get_platform(): + return LOONGARCHEFI() + elif arch.is_riscv64(): + return RISCV64EFI() ++ elif arch.is_sw_64(): ++ return SW64EFI() + else: + return EFI() + elif arch.is_x86(): +@@ -543,6 +579,8 @@ def get_platform(): + return LOONGARCHEFI() + elif arch.is_riscv64(): + return RISCV64() ++ elif arch.is_sw_64(): ++ return SW64() + else: + raise SystemError("Could not determine system architecture.") + +-- +2.43.5 + diff --git a/anaconda.spec b/anaconda.spec index a18d37b..d52586d 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,4 +1,4 @@ -%define anolis_release 8 +%define anolis_release 9 Summary: Graphical system installer Name: anaconda @@ -34,6 +34,7 @@ Patch1007: 1007-Remove-nvdimm-support.patch Patch1008: 1008-Do-not-use-stringize-and-unicodeize-from-Blivet.patch # Refer to https://github.com/rhinstaller/anaconda/commit/fed051f660c06ce9c3566b8fb12864a5c2737423 Patch1009: 1009-backport-a-riscv64-enablement-patch-from-upstream.patch +Patch1010: 1010-support-for-sw_64-architecture.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -455,6 +456,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_d %{_prefix}/libexec/anaconda/dd_* %changelog +* Thu Aug 14 2025 zhangbinchen - 38.23-9 +- add patch 1010 for sw64 support + * Fri Jun 13 2025 Yihao Yan - 38.23-8 - add riscv64 support -- Gitee