Class: Yast::InstPrepareprogressClient

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

Instance Method Summary collapse

Instance Method Details

#mainObject


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
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
# File 'src/lib/installation/clients/inst_prepareprogress.rb', line 30

def main
  textdomain "installation"
  Yast.import "InstData"
  Yast.import "Language"
  Yast.import "Mode"
  Yast.import "PackageSlideShow"
  Yast.import "Packages"
  Yast.import "SlideShow"
  Yast.import "UI"
  Yast.import "Wizard"

  Builtins.y2milestone("BEGIN of inst_prepareprogress.ycp")

  # Hide release notes button in ncurses because it blocks the installation process
  Wizard.HideReleaseNotesButton if UI.TextMode

  Packages.SlideShowSetUp(Language.language)

  SlideShow.OpenDialog
  PackageSlideShow.InitPkgData(true) # FIXME: this is odd!

  stages = [
    {
      "name"        => "disk",
      "description" => _("Preparing disks..."),
      "value"       => Mode.update ? 0 : 120, # two minutes only when doing partitioning
      "units"       => :sec
    },
    {
      "name"        => "packages",
      "description" => _("Installing Packages..."),
      # just random number like others, but expect that package installation takes most
      "value"       => 5 * 60,
      "units"       => :sec
    },
    {
      "name"        => "finish",
      "description" => _("Finishing Basic Installation"),
      # fixed value
      "value"       => 120,
      "units"       => :sec
    }
  ]

  # own workflow for OEM image deployment
  if InstData.image_target_disk
    stages = [
      {
        "name"        => "images",
        "description" => _("Deploying Images..."),
        "value"       => 400, # just make it longer than inst_finish
        "units"       => :sec
      },
      {
        "name"        => "finish",
        "description" => _("Finishing Basic Installation"),
        # fixed value
        "value"       => 100,
        "units"       => :sec
      }
    ]

  end

  SlideShow.Setup(stages)

  Builtins.y2milestone("END of inst_prepareprogress.ycp")

  Builtins.y2milestone("Cleaning memory.")
  Builtins.y2milestone("Memory before:\n#{File.read("/proc/#{Process.pid}/status")}")
  # clean as much memory as possible before doing real installation, because some packages
  # can have memory demanding scripts
  GC.start
  Builtins.y2milestone("Memory after:\n#{File.read("/proc/#{Process.pid}/status")}")

  :auto
end