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

Instance Method Summary (collapse)

Constructor Details

- (FinishClient) initialize

Returns a new instance of FinishClient



16
17
18
# File 'src/lib/bootloader/finish_client.rb', line 16

def initialize
  textdomain "bootloader"
end

Instance Method Details

- (Object) modes



28
29
30
# File 'src/lib/bootloader/finish_client.rb', line 28

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

- (Object) steps



20
21
22
# File 'src/lib/bootloader/finish_client.rb', line 20

def steps
  3
end

- (Object) title



24
25
26
# File 'src/lib/bootloader/finish_client.rb', line 24

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

- (Object) write



32
33
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
71
72
73
74
# File 'src/lib/bootloader/finish_client.rb', line 32

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

  # call mkinitrd to ensure initrd is properly set, it is especially needed
  # in live system install ( where it is just copyied ) and image based
  # installation where post install script is not executed
  # (bnc#979719,bnc#977656)
  Yast::Execute.on_target("/sbin/mkinitrd")

  true
end