Class: Yast::BootSupportCheckClass

Inherits:
Module
  • Object
show all
Includes:
Logger
Defined in:
src/modules/BootSupportCheck.rb

Instance Method Summary collapse

Instance Method Details

#mainObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'src/modules/BootSupportCheck.rb', line 23

def main
  textdomain "bootloader"

  Yast.import "Bootloader"
  Yast.import "Arch"
  Yast.import "BootStorage"
  Yast.import "FileUtils"
  Yast.import "Mode"

  # List of problems found during last check
  @detected_problems = []
end

#StringProblemsBoolean

Formated string of detected problems Always run SystemSupported before calling this function

Returns:

  • (Boolean)

    a list of problems, empty if no was found



65
66
67
# File 'src/modules/BootSupportCheck.rb', line 65

def StringProblems
  @detected_problems.join("\n")
end

#SystemSupportedBoolean

Check if the system configuraiton is supported Also sets the founds problems into internal variable Always run this function before calling DetectedProblems()

Returns:

  • (Boolean)

    true if supported



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'src/modules/BootSupportCheck.rb', line 40

def SystemSupported
  @detected_problems = []

  lt = ::Bootloader::BootloaderFactory.current.name
  # detect correct bootloader type
  supported = correct_loader_type(lt)

  # check specifics for individual loaders
  case lt
  when "grub2"
    supported = GRUB2() && supported
  when "grub2-efi"
    supported = GRUB2EFI() && supported
  when "systemd-boot"
    supported = SYSTEMDBOOT() && supported
  end

  log.info "Configuration supported: #{supported}"

  supported
end