Module: Yast::BootloaderRoutinesSwitcherInclude

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) blDialogs

Get the loader-specific dialogs

Returns:

  • a map of loader-specific dialogs



118
119
120
121
# File 'src/include/bootloader/routines/switcher.rb', line 118

def blDialogs
  method = get_function(:dialogs)
  method ? method.call : {}
end

- (Hash) blExport

Export bootloader-specific settings

Returns:

  • (Hash)

    of settings



55
56
57
# File 'src/include/bootloader/routines/switcher.rb', line 55

def blExport
  get_function(:Export).call
end

- (Boolean) blFlagOnetimeBoot(section)

Set section to boot on next reboot for this type of bootloader

Parameters:

  • section (String)

    string section to boot

Returns:

  • (Boolean)

    true on success



126
127
128
129
# File 'src/include/bootloader/routines/switcher.rb', line 126

def blFlagOnetimeBoot(section)
  method = get_function(:flagonetimeboot)
  method ? method.call(section) : false
end

- (Boolean) blImport(settings)

Import settings to bootloader

Parameters:

  • settings (Hash)

    map of settingss

Returns:

  • (Boolean)

    true on success



62
63
64
# File 'src/include/bootloader/routines/switcher.rb', line 62

def blImport(settings)
  get_function(:Import).call(settings)
end

- (Object) blPropose

Propose bootloader settings



79
80
81
# File 'src/include/bootloader/routines/switcher.rb', line 79

def blPropose
  get_function(:Propose).call
end

- (Boolean) blRead(reread, avoid_reading_device_map)

Read bootloader-specific settings

Parameters:

  • reread (Boolean)

    boolean true to force rereading the settings from the disk

Returns:

  • (Boolean)

    true on success



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

def blRead(reread, avoid_reading_device_map)
  get_function(:Read).call(reread, avoid_reading_device_map)
end

- (Object) blReset

Reset bootloader-specific settings



74
75
76
# File 'src/include/bootloader/routines/switcher.rb', line 74

def blReset
  get_function(:Reset).call
end

- (Boolean) blSave(clean, init, flush)

Save bootloader cfg. files to the cache of the pluglib

Parameters:

  • clean (Boolean)

    boolean true to perform checks on the settings

  • init (Boolean)

    boolean true to reinitialize the library

  • flush (Boolean)

    boolean true to flush the settings to the disk

Returns:

  • (Boolean)

    true on success



88
89
90
# File 'src/include/bootloader/routines/switcher.rb', line 88

def blSave(clean, init, flush)
  get_function(:Save).call(clean, init, flush)
end

- (Object) blSummary

Get cfg. summary

Returns:

  • a list summary items



94
95
96
# File 'src/include/bootloader/routines/switcher.rb', line 94

def blSummary
  get_function(:Summary).call
end

- (Object) blUpdate

Update bootloader-specific settings



99
100
101
# File 'src/include/bootloader/routines/switcher.rb', line 99

def blUpdate
  get_function(:Update).call
end

- (Object) blWidgetMaps

Get description maps of loader-specific widgets

Returns:

  • a map containing description of all loader-specific widgets



111
112
113
114
# File 'src/include/bootloader/routines/switcher.rb', line 111

def blWidgetMaps
  method = get_function(:widgets)
  method ? method.call : {}
end

- (Boolean) blWrite

Do the bootloader installation

Returns:

  • (Boolean)

    true on success



105
106
107
# File 'src/include/bootloader/routines/switcher.rb', line 105

def blWrite
  get_function(:Write).call
end

- (Object) get_function(method)

Get method for current bootloader



27
28
29
30
31
32
33
34
35
# File 'src/include/bootloader/routines/switcher.rb', line 27

def get_function(method)
  functions = get_functions(BootCommon.getLoaderType(false))
  ret = functions[method.to_s.downcase]
  if !ret && BootCommon.methods.include?(method)
    ret = BootCommon.method(method)
  end

  ret
end

- (Hash) get_functions(bootloader)

Get map of main functions for bootloader

Parameters:

  • bootloader (String)

    string bootloader name

Returns:

  • (Hash)

    of function



40
41
42
43
44
45
46
47
48
49
50
51
# File 'src/include/bootloader/routines/switcher.rb', line 40

def get_functions(bootloader)
  bl_functions = {
    "grub2"     => BootGRUB2.method(:GetFunctions),
    "grub2-efi" => BootGRUB2EFI.method(:GetFunctions)
  }
  gf = bl_functions[bootloader]
  if !gf
    Builtins.y2warning("No bootloader-specific functions specified for #{bootloader.inspect}")
    return {}
  end
  gf.call
end

- (Object) initialize_bootloader_routines_switcher(_include_target)



20
21
22
23
24
# File 'src/include/bootloader/routines/switcher.rb', line 20

def initialize_bootloader_routines_switcher(_include_target)
  Yast.import "BootGRUB2"
  Yast.import "BootGRUB2EFI"
  Yast.import "BootCommon"
end