Class: Bootloader::FinishClient

Inherits:
Installation::FinishClient
  • Object
show all
Includes:
Yast::I18n
Defined in:
src/lib/bootloader/finish_client.rb

Overview

Finish client for bootloader configuration

Constant Summary

BASH_PATH =
Yast::Path.new(".target.bash_output")

Instance Method Summary (collapse)

Constructor Details

- (FinishClient) initialize

Returns a new instance of FinishClient



18
19
20
# File 'src/lib/bootloader/finish_client.rb', line 18

def initialize
  textdomain "bootloader"
end

Instance Method Details

- (Object) modes



30
31
32
# File 'src/lib/bootloader/finish_client.rb', line 30

def modes
  [:installation, :live_installation, :update, :autoinst]
end

- (Object) steps



22
23
24
# File 'src/lib/bootloader/finish_client.rb', line 22

def steps
  3
end

- (Object) title



26
27
28
# File 'src/lib/bootloader/finish_client.rb', line 26

def title
  _("Saving bootloader configuration...")
end

- (Object) write



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'src/lib/bootloader/finish_client.rb', line 34

def write
  # message after first round of packet installation
  # now the installed system is run and more packages installed
  # just warn the user that the screen is going back to text mode
  # and yast2 will come up again.
  set_boot_msg

  bl_current = ::Bootloader::BootloaderFactory.current
  # we do nothing in upgrade unless we have to change bootloader
  if Yast::Mode.update && !bl_current.read? && !bl_current.proposed?
    return true
  end

  # we do not manage bootloader, so relax :)
  return true if bl_current.name == "none"

  # read one from system, so we do not overwrite changes done in rpm post install scripts
  ::Bootloader::BootloaderFactory.clear_cache
  system = ::Bootloader::BootloaderFactory.system
  system.read
  system.merge(bl_current)
  system.write

  # and remember result of merge as current one
  ::Bootloader::BootloaderFactory.current = system

  # fate #303395: Use kexec to avoid booting between first and second stage
  # copy vmlinuz, initrd and flush kernel option into /var/lib/YaST2
  if Yast::Linuxrc.InstallInf("kexec_reboot") == "1"
    kexec = ::Bootloader::Kexec.new
    kexec.prepare_environment
  else
    log.info "Installation started with kexec_reboot set 0"
  end

  true
end