Module: Yast::InstallationInstIncAllInclude

Defined in:
src/include/installation/inst_inc_all.rb

Instance Method Summary collapse

Instance Method Details

#connect_nbftObject

Convenience method for discovering and connecting all NVMe over Fabrics subsystems



255
256
257
258
259
260
261
262
# File 'src/include/installation/inst_inc_all.rb', line 255

def connect_nbft
  require "yast2/execute"

  # Replaced 'connect-nbft' by 'connect-all --nbft' (bsc#1222246).
  Yast::Execute.locally!("nvme", "connect-all", "--nbft")
rescue Cheetah::ExecutionFailed
  Builtins.y2error("Error connecting NBFT")
end

#FinishInstallation(ret) ⇒ Object



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'src/include/installation/inst_inc_all.rb', line 105

def FinishInstallation(ret)
  Builtins.y2milestone("Finishing the installation...")

  if [:reboot, :restart_yast, :restart_same_step, :abort].include?(ret)
    # TRANSLATORS: busy message
    UI.OpenDialog(Label(_("Writing YaST configuration..."))) # #2
  else
    # FATE #304395: Disabling (or handling) screensaver during installation
    # Enabling screen-saver on exit
    if WFM.Read(path(".local.size"), "/usr/bin/xset") != -1
      Builtins.y2milestone("Enabling Energy Star (DPMS) features")
      # default DPMS values, enable DPMS, enable screen-saver
      WFM.Execute(
        path(".local.bash"),
        "/usr/bin/xset dpms 1200 1800 2400; /usr/bin/xset +dpms; /usr/bin/xset s on; " \
        "/usr/bin/xset s default;"
      )
    end

    # TRANSLATORS: busy message
    UI.OpenDialog(Label(_("Finishing the installation..."))) # #2
  end

  UI.CloseDialog # #2

  nil
end

#initialize_installation_inst_inc_all(_include_target) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'src/include/installation/inst_inc_all.rb', line 32

def initialize_installation_inst_inc_all(_include_target)
  Yast.import "UI"

  textdomain "installation"

  Yast.import "ProductControl"
  Yast.import "Label"
  Yast.import "Linuxrc"
  Yast.import "Wizard"
  Yast.import "Arch"
  Yast.import "Report"
  Yast.import "Installation"
  Yast.import "Stage"
  Yast.import "Mode"
end

#retranslateWizardDialogObject

Re-translate static part of wizard dialog and other predefined messages after language change



223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'src/include/installation/inst_inc_all.rb', line 223

def retranslateWizardDialog
  Builtins.y2milestone("Retranslating messages")

  # Make sure the labels for default function keys are retranslated, too.
  # Using Label::DefaultFunctionKeyMap() from Label module.
  UI.SetFunctionKeys(Label.DefaultFunctionKeyMap)

  # Activate language changes on static part of wizard dialog
  ProductControl.RetranslateWizardSteps
  Wizard.RetranslateButtons
  Wizard.SetFocusToNextButton
  nil
end

#SetAutoinstHandlingObject

Sets autoinstallation behavior.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'src/include/installation/inst_inc_all.rb', line 134

def SetAutoinstHandling
  return if !Mode.autoinst

  reportMap = {
    "errors"         => { "timeout" => 0 },
    "warnings"       => { "timeout" => 10 },
    "yesno_messages" => { "timeout" => 10 }
  }
  Report.Import(reportMap)

  Report.DisplayErrors(true, 0)
  Report.DisplayWarnings(true, 10)
  Report.DisplayMessages(true, 10)

  nil
end

#SetAutoupgHandlingObject

Sets autoupgrade behavior



152
153
154
155
156
157
158
159
160
161
162
# File 'src/include/installation/inst_inc_all.rb', line 152

def SetAutoupgHandling
  # if profile is defined, first read it, then probe hardware
  autoinstall = SCR.Read(path(".etc.install_inf.AutoYaST"))
  if !autoinstall.nil? && Ops.is_string?(autoinstall) &&
      Convert.to_string(autoinstall) != ""
    ProductControl.DisableModule("system_analysis")
    ProductControl.DisableModule("update_partition_auto")
  end

  nil
end

#SetDiskActivationModuleObject



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'src/include/installation/inst_inc_all.rb', line 237

def SetDiskActivationModule
  # Connect all the discovered NVMe-over-Fabrics subsystems (jse#PED-318)
  connect_nbft if Linuxrc.InstallInf("UseNBFT") == "1"
  # update the workflow according to current situation
  # disable disks activation if not needed
  iscsi = Linuxrc.InstallInf("WithiSCSI") == "1"
  fcoe = Linuxrc.InstallInf("WithFCoE") == "1"
  no_disk = !::Y2Storage::StorageManager.instance.devices_for_installation?

  if !((Arch.s390 && !Arch.is_zkvm) || iscsi || fcoe || no_disk)
    Builtins.y2milestone("Disabling disk activation module")
    ProductControl.DisableModule("disks_activate")
  end

  nil
end

#SetGlobalInstallationFeaturesObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'src/include/installation/inst_inc_all.rb', line 90

def SetGlobalInstallationFeatures
  # FATE #304395: Disabling (or handling) screensaver during installation
  # Disabling screen-saver on startup
  if WFM.Read(path(".local.size"), "/usr/bin/xset") != -1
    Builtins.y2milestone("Disabling Energy Star (DPMS) features")
    # DPMS off values, disable DPMS, disable screen-saver
    WFM.Execute(
      path(".local.bash"),
      "/usr/bin/xset dpms 0 0 0; /usr/bin/xset -dpms; /usr/bin/xset s 0 0; /usr/bin/xset s off"
    )
  end

  nil
end

#SetInitializingUIObject



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
# File 'src/include/installation/inst_inc_all.rb', line 48

def SetInitializingUI
  # dialog content - busy message
  ui_message = ""
  # help for the dialog - busy message
  ui_help = _("<p>Initializing the installation...</p>")

  # another texts for second stage
  if Stage.cont
    # dialog content - busy message
    ui_message = _("Preparing the 1st system configuration...")
    # help for the dialog - busy message
    ui_help = _("<p>Please wait...</p>")
  end

  Wizard.SetContents(
    # dialog caption
    _("Initializing..."),
    Label(ui_message),
    ui_help,
    false,
    false
  )

  # gh#86 No control file found
  if ProductControl.current_control_file.nil?
    Yast.import "InstError"
    InstError.ShowErrorPopupWithLogs(
      # TRANSLATORS: Error message
      _("No installation control file has been found,\nthe installer cannot continue.")
    )
  end

  nil
end

#SetUIContentObject



83
84
85
86
87
88
# File 'src/include/installation/inst_inc_all.rb', line 83

def SetUIContent
  # Wizard::OpenNextBackStepsDialog();
  SetInitializingUI()

  nil
end

#ShowTextFallbackMessageObject



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'src/include/installation/inst_inc_all.rb', line 164

def ShowTextFallbackMessage
  if (Installation.text_fallback || Installation.no_x11) &&
      Installation.x11_setup_needed && Arch.x11_setup_needed &&
      !Installation.shown_text_mode_warning
    x11_msg = ""
    if (Installation.no_x11 || Installation.text_fallback) && Stage.initial
      # Somehow the graphical frontend failed and we're running in
      # text mode. Inform the user about this fact.
      x11_msg = Builtins.sformat(
        _(
          "Your computer does not fulfill all requirements for\n" \
          "a graphical installation. There is either less than %1 MB\n" \
          "memory or the X server could not be started.\n" \
          "\n" \
          "As fallback, the text front-end of YaST2 will guide you\n" \
          "through the installation. This front-end offers the\n" \
          "same functionality as the graphical one, but the screens\n" \
          "differ from those in the manual.\n"
        ),
        "96"
      )
    elsif (Installation.no_x11 || Installation.text_fallback) && Stage.cont
      # The script YaST2 wants to inform about a problem with the
      # option no_x11 but it's broken.
      # else if (Installation::no_x11 ())

      # Somehow the graphical frontend failed and we're running in
      # text mode. Inform the user about this fact.
      x11_msg = _(
        "The graphical interface could not be started.\n" \
        "\n" \
        "Either the required packages were not installed (minimal installation) \n" \
        "or the graphics card is not properly supported.\n" \
        "\n" \
        "As fallback, the text front-end of YaST2 will guide you\n" \
        "through the installation. This front-end offers the\n" \
        "same functionality as the graphical one, but the screens\n" \
        "differ from those in the manual.\n"
      )
    end

    if x11_msg == ""
      Builtins.y2error(
        "There should be a more detailed message displayed here,\n" \
        "but something went wrong, that's why it is only in the log"
      )
    else
      Report.Message(x11_msg)
    end

    # show this warning only once
    Installation.shown_text_mode_warning = true
  end

  nil
end