Class: Installation::PrepShrinkFinish

Inherits:
Object
  • Object
show all
Includes:
Yast::I18n, Yast::Logger
Defined in:
src/lib/installation/prep_shrink.rb

Constant Summary collapse

USABLE_WORKFLOWS =
[
  :installation,
  :live_installation,
  :autoinst,
  :update,
  :autoupg # TODO: is autoupgrade still live?
].freeze
YAST_BASH_PATH =
Yast::Path.new ".target.bash_output"

Instance Method Summary collapse

Constructor Details

#initializePrepShrinkFinish



24
25
26
# File 'src/lib/installation/prep_shrink.rb', line 24

def initialize
  textdomain "installation"
end

Instance Method Details

#run(*args) ⇒ Object



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
# File 'src/lib/installation/prep_shrink.rb', line 28

def run(*args)
  func = args.first
  param = args[1] || {}

  log.debug "prep shrink finish client called with #{func} and #{param}"

  case func
  when "Info"
    Yast.import "Arch"
    usable = Yast::Arch.board_chrp

    {
      "steps" => 1,
      # progress step title
      "title" => _("Shrinking PREP partition..."),
      "when"  => usable ? USABLE_WORKFLOWS : []
    }

  when "Write"
    shrink_partitions

    nil
  else
    raise "Uknown action #{func} passed as first parameter"
  end
end