Class: Yast::InstBootloaderClient

Inherits:
Client
  • Object
show all
Includes:
Logger
Defined in:
src/clients/inst_bootloader.rb

Instance Method Summary collapse

Instance Method Details

#mainObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'src/clients/inst_bootloader.rb', line 22

def main
  textdomain "bootloader"

  Yast.import "Bootloader"
  # Yast.import "BootCommon"
  Yast.import "Installation"
  Yast.import "GetInstArgs"
  Yast.import "Mode"

  log.info "starting inst_bootloader"

  if GetInstArgs.going_back # going backwards?
    return :auto # don't execute this once more
  end

  # for upgrade that is from grub2 to grub2 and user do not want
  # any changes, just quit (bnc#951731)
  bl_current = ::Bootloader::BootloaderFactory.current
  if Mode.update && !(bl_current.read? || bl_current.proposed?)
    log.info "clean upgrade, do nothing"
    return :auto
  end

  bl_current.write_sysconfig(prewrite: true)

  log.info "finish inst_bootloader"

  :auto
end