diff --git a/kiwi/bootloader/config/grub2.py b/kiwi/bootloader/config/grub2.py index 9c69028a6bc..40d6fa795a6 100644 --- a/kiwi/bootloader/config/grub2.py +++ b/kiwi/bootloader/config/grub2.py @@ -75,6 +75,9 @@ def post_init(self, custom_args): if arch == 'x86_64': # grub2 support for bios and efi systems self.arch = arch + elif arch == 'loongarch64': + # grub2 support for efi systems + self.arch = arch elif arch.startswith('ppc64'): # grub2 support for ofw and opal systems self.arch = arch diff --git a/kiwi/defaults.py b/kiwi/defaults.py index fc7607e476e..9c70bb76fd2 100644 --- a/kiwi/defaults.py +++ b/kiwi/defaults.py @@ -1307,6 +1307,7 @@ def get_firmware_types(): 'armv7hl': ['efi', 'uefi'], 'armv7l': ['efi', 'uefi'], 'armv8l': ['efi', 'uefi'], + 'loongarch64': ['efi', 'uefi'], 'ppc': ['ofw'], 'ppc64': ['ofw', 'opal'], 'ppc64le': ['ofw', 'opal'], @@ -1331,6 +1332,7 @@ def get_default_firmware(arch): 'i586': 'bios', 'i686': 'bios', 'ix86': 'bios', + 'loongarch64': 'efi', 'ppc': 'ofw', 'ppc64': 'ofw', 'ppc64le': 'ofw', @@ -1401,6 +1403,7 @@ def get_efi_module_directory_name(arch): 'armv6l': 'arm-efi', 'armv7l': 'arm-efi', 'armv8l': 'arm-efi', + 'loongarch64': 'loongarch64-efi', 'riscv64': 'riscv64-efi' } if arch in default_module_directory_names: @@ -1437,6 +1440,7 @@ def get_efi_image_name(arch): 'armv6l': 'bootarm.efi', 'armv7l': 'bootarm.efi', 'armv8l': 'bootarm.efi', + 'loongarch64': 'bootloongarch64.efi', 'riscv64': 'bootriscv64.efi' } if arch in default_efi_image_names: diff --git a/test/unit/bootloader/config/grub2_test.py b/test/unit/bootloader/config/grub2_test.py index 6df953f68c6..71d5627b52d 100644 --- a/test/unit/bootloader/config/grub2_test.py +++ b/test/unit/bootloader/config/grub2_test.py @@ -216,6 +216,13 @@ def test_post_init_ix86_platform(self): bootloader = BootLoaderConfigGrub2(xml_state, 'root_dir') assert bootloader.arch == 'ix86' + def test_post_init_loongarch64_platform(self): + Defaults.set_platform_name('loongarch64') + xml_state = MagicMock() + xml_state.build_type.get_firmware = Mock( + return_value=None + ) + def test_post_init_ppc_platform(self): Defaults.set_platform_name('ppc64') xml_state = MagicMock()