Class: Yast::InstallationClient

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

Instance Method Summary collapse

Instance Method Details

#log_os_releaseObject

log the system name found in the /etc/os-release file to easily find which system is running in inst-sys



111
112
113
114
115
116
117
# File 'src/lib/installation/clients/installation.rb', line 111

def log_os_release
  if OSRelease.os_release_exists?
    log.info("System identification: #{OSRelease.ReleaseInformation.inspect}")
  else
    log.warn("Cannot read the OS release file")
  end
end

#mainObject



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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'src/lib/installation/clients/installation.rb', line 35

def main
  textdomain "installation"

  Yast.import "Wizard"
  Yast.import "Stage"
  Yast.import "Report"
  Yast.import "Hooks"
  Yast.import "Linuxrc"
  Yast.import "OSRelease"

  # log the inst-sys identification for easier debugging
  log_os_release

  Hooks.search_path.join!("installation")

  # Initialize the UI
  UI.SetProductLogo(true)
  Wizard.OpenLeftTitleNextBackDialog

  Wizard.SetContents(
    # title
    "",
    # contents
    Empty(),
    # help
    "",
    # has back
    false,
    # has next
    false
  )
  Wizard.SetTitleIcon("yast-inst-mode")
  Wizard.DisableAbortButton

  @ret = nil

  # Call the real installation
  Builtins.y2milestone("=== installation ===")

  Hooks.run "installation_start"

  # First-stage (initial installation)
  if Stage.initial
    Builtins.y2milestone(
      "Stage::initial -> running inst_worker_initial client"
    )
    @ret = WFM.CallFunction("inst_worker_initial", WFM.Args)

    # Second-stage (initial installation)
  elsif Stage.cont
    Builtins.y2milestone(
      "Stage::cont -> running inst_worker_continue client"
    )
    @ret = WFM.CallFunction("inst_worker_continue", WFM.Args)
  else
    # TRANSLATORS: error message
    Report.Error(_("No workflow defined for this kind of installation."))
  end

  Hooks.run "installation_failure" if @ret == false

  Builtins.y2milestone("Installation ret: %1", @ret)
  Builtins.y2milestone("=== installation ===")

  Hooks.run "installation_finish"

  # Shutdown the UI
  Wizard.CloseDialog

  WFM.CallFunction("disintegrate_all_extensions") if Stage.initial

  deep_copy(@ret)
end