Skip to content

Commit

Permalink
Unified halt being call during the cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Aug 2, 2018
1 parent 9d7e903 commit 2d007f8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
6 changes: 6 additions & 0 deletions scripts/Firstboot-Stage/S09-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ if [ -e "/var/lib/YaST2/firstboot_reboot_after_finish" ] ; then
rm /var/lib/YaST2/firstboot_reboot_after_finish
/sbin/reboot
fi

if [ -e "/var/lib/YaST2/firstboot_halt_after_finish" ] ; then
log "\tHalting system as requested by firstboot..."
rm /var/lib/YaST2/firstboot_halt_after_finish
exit 1
fi
14 changes: 12 additions & 2 deletions src/clients/firstboot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,20 @@ def main

if @action == "halt"
Builtins.y2milestone("Halting the system...")
SCR.Execute(path(".target.bash"), "/sbin/halt")
SCR.Execute(path(".target.bash"),
Builtins.sformat(
"touch %1/firstboot_halt_after_finish",
Directory.vardir
)
)
elsif @action == "reboot"
Builtins.y2milestone("Rebooting the system...")
SCR.Execute(path(".target.bash"), "/sbin/reboot")
SCR.Execute(path(".target.bash"),
Builtins.sformat(
"touch %1/firstboot_reboot_after_finish",
Directory.vardir
)
)
elsif @action == "continue"
Builtins.y2milestone("Finishing Yast...")
else
Expand Down
6 changes: 1 addition & 5 deletions src/clients/firstboot_license.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ def main

@result = WFM.CallFunction("inst_license", [@args])

if @result == :halt
UI.CloseDialog
Builtins.y2milestone("Halting the system...")
SCR.Execute(path(".target.bash"), "/sbin/halt")
end
UI.CloseDialog if @result == :halt

deep_copy(@result)
end
Expand Down
6 changes: 1 addition & 5 deletions src/clients/firstboot_license_novell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ def main

@result = WFM.CallFunction("inst_license", [@args])

if @result == :halt
UI.CloseDialog
Builtins.y2milestone("Halting the system...")
SCR.Execute(path(".target.bash"), "/sbin/halt")
end
UI.CloseDialog if @result == :halt

deep_copy(@result)
end
Expand Down
6 changes: 1 addition & 5 deletions src/clients/firstboot_licenses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ def main

@result = WFM.CallFunction("inst_license", [@args])

if @result == :halt
UI.CloseDialog
Builtins.y2milestone("Halting the system...")
SCR.Execute(path(".target.bash"), "/sbin/halt")
end
UI.CloseDialog if @result == :halt

deep_copy(@result)
end
Expand Down

0 comments on commit 2d007f8

Please sign in to comment.