Class: Yast::BootSupportCheckClass

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) main



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

def main
  textdomain "bootloader"

  Yast.import "Bootloader"
  Yast.import "Arch"
  Yast.import "Storage"
  Yast.import "Partitions"
  Yast.import "Region"
  Yast.import "BootStorage"
  Yast.import "FileUtils"
  Yast.import "Mode"

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

- (Boolean) StringProblems

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

Returns:

  • (Boolean)

    a list of problems, empty if no was found



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

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

- (Boolean) SystemSupported

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



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

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
  end

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

  supported
end