From 8eab9e297170eb2906e6a9041373a96ec04242f9 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Mon, 11 Sep 2023 12:16:14 +0300 Subject: [PATCH] Add support for riscv64 Signed-off-by: David Abdurachmanov --- anaconda-riscv64.patch | 89 ++++++++++++++++++++++++++++++++++++++++++ anaconda.spec | 7 +++- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 anaconda-riscv64.patch diff --git a/anaconda-riscv64.patch b/anaconda-riscv64.patch new file mode 100644 index 0000000..7897767 --- /dev/null +++ b/anaconda-riscv64.patch @@ -0,0 +1,89 @@ +diff --git a/data/dbus/anaconda-bus.conf b/data/dbus/anaconda-bus.conf +index 75e0835..58de286 100644 +--- a/data/dbus/anaconda-bus.conf ++++ b/data/dbus/anaconda-bus.conf +@@ -112,9 +112,9 @@ + 1000000000 + +- 600000 +- 240000 +- 150000 ++ 6000000 ++ 2400000 ++ 1500000 + 100000 + 10000 + 100000 +diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py +index 1b47e24..507df96 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"] ++__all__ = ["EFIBase", "EFIGRUB", "Aarch64EFIGRUB", "ArmEFIGRUB", "MacEFIGRUB", "RISCV64EFIGRUB"] + + + class EFIBase(object): +@@ -214,6 +214,15 @@ 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..835ab2e 100644 +--- a/pyanaconda/modules/storage/bootloader/factory.py ++++ b/pyanaconda/modules/storage/bootloader/factory.py +@@ -142,6 +142,10 @@ class BootLoaderFactory(object): + 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 ++ + if platform_class is platform.ArmEFI: + from pyanaconda.modules.storage.bootloader.efi import ArmEFIGRUB + return ArmEFIGRUB +diff --git a/pyanaconda/modules/storage/platform.py b/pyanaconda/modules/storage/platform.py +index d0aa7ca..d9ddcae 100644 +--- a/pyanaconda/modules/storage/platform.py ++++ b/pyanaconda/modules/storage/platform.py +@@ -295,6 +295,14 @@ class ArmEFI(EFI): + return ["vfat", "ntfs"] + + ++class RISCV64EFI(EFI): ++ ++ @property ++ def non_linux_format_types(self): ++ """Format types of devices with non-linux operating systems.""" ++ return ["vfat", "ntfs"] ++ ++ + class PPC(Platform): + + @property +@@ -484,6 +492,8 @@ def get_platform(): + return MacEFI() + elif arch.is_aarch64(): + return Aarch64EFI() ++ elif arch.is_riscv64(): ++ return RISCV64EFI() + elif arch.is_arm(): + return ArmEFI() + else: diff --git a/anaconda.spec b/anaconda.spec index d46e5a0..e7f439d 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,7 +1,7 @@ Summary: Graphical system installer Name: anaconda Version: 38.23.4 -Release: 2%{?dist} +Release: 2.0.riscv64%{?dist} License: GPLv2+ and MIT URL: http://fedoraproject.org/wiki/Anaconda @@ -16,6 +16,8 @@ Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{vers # Don't try and attach non-existent or empty files to bug reports Patch0: 0001-exception-only-attach-existent-and-non-empty-files-2.patch +Patch9: anaconda-riscv64.patch + # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -473,6 +475,9 @@ rm -rf \ %{_prefix}/libexec/anaconda/dd_* %changelog +* Mon Sep 11 2023 David Abdurachmanov - 38.23.4-2.0.riscv64 +- Add support for riscv64 EFI + * Tue Apr 11 2023 Adam Williamson - 38.23.4-2 - Backport PR #4690 to avoid failing on empty files when reporting bugs