Class: Yast::InstBootloaderClient

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) main



18
19
20
21
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'src/clients/inst_bootloader.rb', line 18

def main

  textdomain "bootloader"

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


  Builtins.y2milestone("starting inst_bootloader")


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

  if Mode.installation
    Bootloader.blSave(false, false, false)
    @files = BootCommon.GetFilesContents

    Builtins.y2milestone("contents FILES: %1", @files)

    #F#300779 - Install diskless client (NFS-root)
    #kokso: bootloader will not be installed
    @device = BootCommon.getBootDisk

    if @device == "/dev/nfs"
      Builtins.y2milestone(
        "inst_bootloader -> Boot partition is nfs type, bootloader will not be installed."
      )
      BootCommon.InitializeLibrary(true, "none")
      BootCommon.setLoaderType("none")
    else
      Builtins.foreach(@files) do |file, content|
        last = Builtins.findlastof(file, "/")
        path_file = Builtins.substring(file, 0, last)
        WFM.Execute(
          path(".local.mkdir"),
          Ops.add(Installation.destdir, path_file)
        )
        Builtins.y2milestone("writing file: %1", file)
        WFM.Write(
          path(".local.string"),
          Ops.add(Installation.destdir, file),
          content
        )
      end
    end
  end

  # FATE #302245 save kernel args etc to /etc/sysconfig/bootloader
  BootCommon.WriteToSysconf(true)

  Builtins.y2milestone("finish inst_bootloader")

  :auto
end