Skip to content

Commit

Permalink
Merge pull request #51 from yast/unified_halt_sle12sp4
Browse files Browse the repository at this point in the history
Backport changes added in #49 for SLE-12-SP4 (bsc#1103525)
  • Loading branch information
teclator committed Aug 3, 2018
2 parents 9d7e903 + 526b8ce commit f3c3278
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 24 deletions.
7 changes: 7 additions & 0 deletions package/yast2-firstboot.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jun 11 11:10:40 UTC 2018 - knut.anderssen@suse.com

- Allow going back from finish step and unified halt
(bsc#1095251, bsc#1103525)
- 3.1.19

-------------------------------------------------------------------
Thu Nov 30 17:47:59 UTC 2017 - knut.anderssen@suse.com

Expand Down
6 changes: 3 additions & 3 deletions package/yast2-firstboot.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-firstboot
Version: 3.1.18
Version: 3.1.19
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -32,8 +32,8 @@ BuildRequires: yast2-devtools >= 3.1.10
Requires: yast2 >= 2.16.23
# Language::SwitchToEnglishIfNeeded
Requires: yast2-country >= 2.19.5
# new version of inst_license
Requires: yast2-installation >= 2.19.0
# Rely on the YaST2-Firstboot.service for halting the system on failure
Requires: yast2-installation >= 3.2.60
# network autoconfiguration
Requires: yast2-network >= 3.1.91

Expand Down
9 changes: 9 additions & 0 deletions scripts/Firstboot-Stage/S09-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,12 @@ 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
# Instead of calling halt directly we will rely on systemd
# failed state, that is OnFailure=shutdown.target in the
# YaST2-Firstboot.service (bsc#1095251)
exit 1
fi
16 changes: 14 additions & 2 deletions src/clients/firstboot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,24 @@ def main
@action
)

# The S09-cleanup script is responsible of rebooting or halting the
# system depending on the existence of the specifig flag files
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
1 change: 1 addition & 0 deletions src/clients/firstboot_finish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def main
GetInstArgs.enable_next
)

Wizard.HideAbortButton
Wizard.SetNextButton(:next, Label.FinishButton)
Wizard.SetFocusToNextButton

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
5 changes: 1 addition & 4 deletions src/clients/firstboot_write.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def main
Yast.import "ProductFeatures"
Yast.import "Wizard"

return :back if GetInstArgs.going_back

@progress_stages = [
# progress stages
Expand Down Expand Up @@ -94,10 +95,6 @@ def main
Firstboot.default_wm
)


# Dont run firstboot next time
SCR.Execute(path(".target.remove"), Firstboot.reconfig_file)

# save product features if they do not exist
if !FileUtils.Exists("/etc/YaST2/ProductFeatures")
Builtins.y2milestone("Saving ProductFeatures...")
Expand Down

0 comments on commit f3c3278

Please sign in to comment.