Module: Yast::BootloaderRoutinesLilolikeInclude

Defined in:
src/include/bootloader/routines/lilolike.rb

Instance Method Summary (collapse)

Instance Method Details

- (String) ConfigureLocation

ConfigureLocation() Where to install the bootloader. Returns the type of device where to install: one of “boot”, “root”, “mbr”, “mbr_md” Also sets internal global variable selected_location to this.

FIXME: replace with grub_ConfigureLocation() when lilo et al. have changed to stop using selected_location and loader_device.

Returns:

  • (String)

    type of location proposed to bootloader



69
70
71
72
# File 'src/include/bootloader/routines/lilolike.rb', line 69

def ConfigureLocation
  # configure stage1 only on non-EFI systems
  ::Bootloader::Stage1.new.propose.to_s if Yast::Bootloader.getLoaderType == "grub2"
end

- (Object) DetectDisks

Detect /boot and / (root) partition devices If loader_device is empty or the device is not available as a boot partition, also calls ConfigureLocation to configure loader_device, set selected_location and set the activate flag if needed all these settings are stored in internal variables



79
80
81
82
83
84
85
86
87
88
89
90
# File 'src/include/bootloader/routines/lilolike.rb', line 79

def DetectDisks
  location_reconfigure = BootStorage.detect_disks

  return if location_reconfigure == :ok
  # if already proposed, then empty location is intention of user
  if location_reconfigure == :empty && BootCommon.was_proposed
    # unless autoinstall where we do not allow empty boot devices (bnc#948258)
    return unless Mode.auto
  end

  ConfigureLocation()
end

- (String) DiskOrderSummary

Get the summary of disks order for the proposal

Returns:

  • (String)

    a line for the summary (or nil if not intended to be shown)



104
105
106
107
108
109
110
111
112
113
114
115
# File 'src/include/bootloader/routines/lilolike.rb', line 104

def DiskOrderSummary
  order = BootStorage.DisksOrder
  ret = nil
  if Ops.greater_than(Builtins.size(order), 1)
    ret = Builtins.sformat(
      # part of summary, %1 is a list of hard disks device names
      _("Order of Hard Disks: %1"),
      Builtins.mergestring(order, ", ")
    )
  end
  ret
end

- (String) FindMBRDisk

FindMbrDisk() try to find the system's mbr device

Returns:

  • (String)

    mbr device



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'src/include/bootloader/routines/lilolike.rb', line 37

def FindMBRDisk
  # check the disks order, first has MBR
  order = BootStorage.DisksOrder
  if Ops.greater_than(Builtins.size(order), 0)
    ret = Ops.get(order, 0, "")
    Builtins.y2milestone("First disk in the order: %1, using for MBR", ret)
    return ret
  end

  # OK, order empty, use the disk with boot partition
  mp = Storage.GetMountPoints
  boot_disk = Ops.get_string(
    mp,
    ["/boot", 2],
    Ops.get_string(mp, ["/", 2], "")
  )
  Builtins.y2milestone(
    "Disk with boot partition: %1, using for MBR",
    boot_disk
  )
  boot_disk
end

- (Object) initialize_bootloader_routines_lilolike(include_target)



25
26
27
28
29
30
31
32
# File 'src/include/bootloader/routines/lilolike.rb', line 25

def initialize_bootloader_routines_lilolike(include_target)
  textdomain "bootloader"

  Yast.import "BootStorage"
  Yast.import "Storage"

  Yast.include include_target, "bootloader/routines/i386.rb"
end

- (Object) UpdateGlobals

Update global options of bootloader modifies internal sreuctures



94
95
96
97
98
99
100
# File 'src/include/bootloader/routines/lilolike.rb', line 94

def UpdateGlobals
  if Ops.get(@globals, "timeout", "") == ""
    Ops.set(@globals, "timeout", "8")
  end

  nil
end