Skip to content

Commit

Permalink
adjust code
Browse files Browse the repository at this point in the history
  • Loading branch information
wfeldt committed Feb 28, 2020
1 parent 7c623bc commit 9ba850a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/lib/bootloader/proposal_client.rb
Expand Up @@ -342,12 +342,18 @@ def handle_errors(ret)
end

def single_click_action(option, value)
stage1 = ::Bootloader::BootloaderFactory.current.stage1
bootloader = ::Bootloader::BootloaderFactory.current

log.info "single_click_action: option #{option}, value #{value.inspect}"

case option
when "boot_mbr"
devices = stage1.boot_disk_names
when "boot_boot"
devices = stage1.boot_partition_names
when "boot_mbr", "boot_boot"
stage1 = bootloader.stage1
devices = (option == "boot_mbr") ? stage1.boot_disk_names : stage1.boot_partition_names
log.info "single_click_action: devices #{devices}"
devices.each do |device|
value ? stage1.add_udev_device(device) : stage1.remove_device(device)
end
when "trusted_boot"
::Bootloader::BootloaderFactory.current.trusted_boot = value
when "secure_boot"
Expand All @@ -362,11 +368,6 @@ def single_click_action(option, value)
)
end
end
log.info "single_click_action #{option} #{value.inspect} #{devices}"

devices&.each do |device|
value ? stage1.add_udev_device(device) : stage1.remove_device(device)
end

Yast::Bootloader.proposed_cfg_changed = true
end
Expand Down

0 comments on commit 9ba850a

Please sign in to comment.