Skip to content

Commit

Permalink
Merge pull request #302 from yast/jreidinger_config_files_proto
Browse files Browse the repository at this point in the history
dry code
  • Loading branch information
jreidinger committed Mar 29, 2016
2 parents cbac53c + cb21110 commit e6e3675
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/lib/bootloader/device_map.rb
Expand Up @@ -57,11 +57,7 @@ def contain_disk?(disk)
end

def disks_order
grub_devices = @model.grub_devices
grub_devices.select! { |d| d.start_with?("hd") }
grub_devices.sort_by! { |dev| dev[2..-1].to_i }

grub_devices.map { |d| @model.system_device_for(d) }
sorted_disks.map { |d| @model.system_device_for(d) }
end

def propose
Expand All @@ -81,6 +77,12 @@ def propose

private

def sorted_disks
grub_devices = @model.grub_devices
grub_devices.select! { |d| d.start_with?("hd") }
grub_devices.sort_by { |dev| dev[2..-1].to_i }
end

BIOS_LIMIT = 8
# FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
# The function reduces records (devices) in device.map
Expand All @@ -92,9 +94,7 @@ def reduce_to_bios_limit
return false
end

grub_devices = @model.grub_devices
grub_devices.select! { |d| d.start_with?("hd") }
grub_devices.sort_by(&:to_i)
grub_devices = sorted_disks

other_devices_size = size - grub_devices.size

Expand Down

0 comments on commit e6e3675

Please sign in to comment.