Class: Yast::PreUmountFinishClient

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

Instance Method Summary collapse

Instance Method Details

#mainObject



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
107
108
109
# File 'src/lib/installation/clients/pre_umount_finish.rb', line 32

def main
  Yast.import "UI"

  Yast.import "Misc"
  Yast.import "Installation"
  Yast.import "String"

  Yast.include self, "installation/inst_inc_first.rb"

  textdomain "installation"

  @ret = nil
  @func = ""
  @param = {}

  # Check arguments
  if Ops.greater_than(Builtins.size(WFM.Args), 0) &&
      Ops.is_string?(WFM.Args(0))
    @func = Convert.to_string(WFM.Args(0))
    if Ops.greater_than(Builtins.size(WFM.Args), 1) &&
        Ops.is_map?(WFM.Args(1))
      @param = Convert.to_map(WFM.Args(1))
    end
  end

  Builtins.y2milestone("starting pre_umount_finish")
  Builtins.y2debug("func=%1", @func)
  Builtins.y2debug("param=%1", @param)

  if @func == "Info"
    return {
      "steps" => 1,
      # progress step title
      "title" => _("Checking the installed system..."),
      # !Mode::autoinst
      "when"  => [
        :installation,
        :live_installation,
        :update,
        :autoinst
      ]
    }
  elsif @func == "Write"
    # bugzilla #326478
    # some processes might be still running...
    @cmd = Builtins.sformat(
      "fuser -v '%1' 2>&1",
      String.Quote(Installation.destdir)
    )
    @cmd_run = Convert.to_map(WFM.Execute(path(".local.bash_output"), @cmd))

    Builtins.y2milestone(
      "These processes are still running at %1 -> %2",
      Installation.destdir,
      @cmd_run
    )

    if Ops.greater_than(Builtins.size(Misc.boot_msg), 0)
      # just a beep
      SCR.Execute(path(".target.bash"), "/bin/echo -e 'a'")
    end

    # creates or removes the runme_at_boot file (for second stage)
    # according to the current needs
    #
    # Must be called before 'umount'!
    #
    # See FATE #303396
    HandleSecondStageRequired()
  else
    Builtins.y2error("unknown function: %1", @func)
    @ret = nil
  end

  Builtins.y2debug("ret=%1", @ret)
  Builtins.y2milestone("pre_umount_finish finished")
  deep_copy(@ret)
end