Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Jun 26, 2023
1 parent c2f0f07 commit 36dc7e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions SUPPORTED_SCENARIOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ This option requires packages based on the architecture of the system:

## systemd-boot
If you're running a multiboot EFI system, systemd-boot can provide easier boot management and may even reduce your boot times.
Systemd-boot will be supported on x86_64 EFI architecture only.

## none
This option has no additional package requirement.
16 changes: 10 additions & 6 deletions src/lib/bootloader/autoyast_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def import(data)
bootloader = bootloader_from_data(data)
return bootloader if bootloader.name == "none"

if ["grub2", "grub2-efi"].include?(bootloader.name)
case bootloader.name
when "grub2", "grub2-efi"
import_grub2(data, bootloader)
import_grub2efi(data, bootloader)
import_stage1(data, bootloader)
Expand All @@ -47,10 +48,11 @@ def import(data)
if cpu_mitigations
bootloader.cpu_mitigations = CpuMitigations.from_string(cpu_mitigations)
end
end
if bootloader.name == "systemd-boot"
when "systemd-boot"
bootloader.menue_timeout = data.global.timeout
bootloader.secure_boot = data.global.secure_boot
else
raise UnsupportedBootloader, bootloader.name
end
# TODO: import Initrd
log.warn "autoyast profile contain sections which won't be processed" if data.sections
Expand All @@ -69,17 +71,19 @@ def export(config)

res["global"] = {}

if ["grub2", "grub2-efi"].include?(config.name)
case config.name
when "grub2", "grub2-efi"
global = res["global"]
export_grub2(global, config) if config.name == "grub2"
export_grub2efi(global, config) if config.name == "grub2-efi"
export_default(global, config.grub_default)
export_password(global, config.password)
res["global"]["cpu_mitigations"] = config.cpu_mitigations.value.to_s
end
if config.name == "systemd-boot"
when "systemd-boot"
res["global"]["timeout"] = config.menue_timeout
res["global"]["secure_boot"] = config.secure_boot
else
raise UnsupportedBootloader, bootloader.name
end
# Do not export device map as device name are very unpredictable and is used only as
# work-around when automatic ones do not work for what-ever reasons ( it can really safe
Expand Down

0 comments on commit 36dc7e6

Please sign in to comment.