Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Nov 12, 2021
1 parent d4c66f1 commit e5bc532
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/bootloader/grub2_widgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ def invalid_custom_devices(devs_list)
# almost any byte sequence is potentially valid path in unix like systems
# AY profile can be generated for whatever system so we cannot decite if
# particular byte sequence is valid or not
return [] if Mode.config
return [] if Yast::Mode.config

devs_list.split(",").reject do |d|
dev_path = DevicePath.new(d)
Expand Down
10 changes: 9 additions & 1 deletion src/lib/bootloader/stage1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,15 @@ def custom_devices
log.info "known devices #{known_devices.inspect}"

devices.reject do |dev|
kernel_dev = Bootloader::UdevMapping.to_kernel_device(dev)
dev_path = DevicePath.new(dev)

# in installation do not care of uuids - not know at this time
kernel_dev = if dev_path.uuid?
dev
else
Bootloader::UdevMapping.to_kernel_device(dev)
end

log.info "stage1 devices for #{dev} is #{kernel_dev.inspect}"
known_devices.include?(kernel_dev)
end
Expand Down
4 changes: 4 additions & 0 deletions src/lib/bootloader/udev_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ def staging
end

def udev_to_kernel(dev)
dev_path = DevicePath.new(dev)

# in mode config if not found, then return itself
return dev if Yast::Mode.config
# in installation do not care of uuids - not know at this time
return dev if Yast::Mode.installation && dev_path.uuid?

device = staging.find_by_any_name(dev)

Expand Down

0 comments on commit e5bc532

Please sign in to comment.