Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for loongarch64 #2691

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions kiwi/bootloader/config/grub2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions kiwi/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -1331,6 +1332,7 @@ def get_default_firmware(arch):
'i586': 'bios',
'i686': 'bios',
'ix86': 'bios',
'loongarch64': 'efi',
'ppc': 'ofw',
'ppc64': 'ofw',
'ppc64le': 'ofw',
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions test/unit/bootloader/config/grub2_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading