From afa0f6763ea92551e3c419277a9e20d3f01f700e Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 27 Feb 2020 11:28:06 +0100 Subject: [PATCH 01/10] Init script: Checking working network with network-online.target (#564) (#566) * Init script: Checking working network with network-online.target (#564) --- package/autoyast2.changes | 8 ++++++++ package/autoyast2.spec | 2 +- scripts/autoyast-initscripts.service | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package/autoyast2.changes b/package/autoyast2.changes index 1715706b3..cae974209 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Feb 26 16:19:57 CET 2020 - schubi@suse.de + +- Service for init scripts: Checking working network with + "network-online.target" before starting the AY init scripts + (bsc#1164105). +- 4.0.71 + ------------------------------------------------------------------- Tue Dec 17 16:19:57 UTC 2019 - Imobach Gonzalez Sosa diff --git a/package/autoyast2.spec b/package/autoyast2.spec index e39346a01..e3e99c45e 100644 --- a/package/autoyast2.spec +++ b/package/autoyast2.spec @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.0.70 +Version: 4.0.71 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/scripts/autoyast-initscripts.service b/scripts/autoyast-initscripts.service index 27e855961..83881ab3b 100644 --- a/scripts/autoyast-initscripts.service +++ b/scripts/autoyast-initscripts.service @@ -1,6 +1,6 @@ [Unit] Description=Autoyast2 Init Scripts -After=remote-fs.target network.target time-sync.target mail-transfer-agent.target hwscan.service ypbind.service YaST2-Second-Stage.service +After=remote-fs.target network-online.target time-sync.target mail-transfer-agent.target hwscan.service ypbind.service YaST2-Second-Stage.service Before=systemd-user-sessions.service [Service] From 128f4dbc1b371246b061938f72687b1986728168 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Tue, 10 Mar 2020 10:46:37 +0100 Subject: [PATCH 02/10] Security fix: Removed all "--gpg-auto-import-keys" options from zypper commands (bsc#1140711) (#570) (#571) --- package/autoyast2.changes | 7 +++++++ package/autoyast2.spec | 2 +- src/modules/AutoinstSoftware.rb | 9 ++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/package/autoyast2.changes b/package/autoyast2.changes index cae974209..a5bf2abc1 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 10 10:19:09 CET 2020 - schubi@suse.de + +- Security fix: Removed all "--gpg-auto-import-keys" options from + zypper commands (bsc#1140711) +- 4.0.72 + ------------------------------------------------------------------- Wed Feb 26 16:19:57 CET 2020 - schubi@suse.de diff --git a/package/autoyast2.spec b/package/autoyast2.spec index e3e99c45e..2835a9810 100644 --- a/package/autoyast2.spec +++ b/package/autoyast2.spec @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.0.71 +Version: 4.0.72 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/modules/AutoinstSoftware.rb b/src/modules/AutoinstSoftware.rb index b3b759644..7ea8eb6dc 100644 --- a/src/modules/AutoinstSoftware.rb +++ b/src/modules/AutoinstSoftware.rb @@ -302,7 +302,8 @@ def createImage(targetdir) # Add Source: # zypper --root /space/tmp/tmproot/ ar ftp://10.10.0.100/install/SLP/openSUSE-11.2/i386/DVD1/ main zypperCall = Builtins.sformat( - "ZYPP_READONLY_HACK=1 zypper --root %1 --gpg-auto-import-keys --non-interactive ar %2 main-source %3", + "ZYPP_READONLY_HACK=1 zypper --root %1 " \ + "--non-interactive ar %2 main-source %3", rootdir, @instsource, outputRedirect @@ -321,7 +322,8 @@ def createImage(targetdir) addOns = Ops.get_list(addOnExport, "add_on_products", []) Builtins.foreach(addOns) do |addOn| zypperCall = Builtins.sformat( - "ZYPP_READONLY_HACK=1 zypper --root %1 --gpg-auto-import-keys --non-interactive ar %2 %3 %4", + "ZYPP_READONLY_HACK=1 zypper --root %1 " \ + "--non-interactive ar %2 %3 %4", rootdir, Ops.get_string(addOn, "media_url", ""), Ops.get_string(addOn, "product", ""), @@ -342,7 +344,8 @@ def createImage(targetdir) # Install zypperCall = Builtins.sformat( - "ZYPP_READONLY_HACK=1 zypper --root %1 --gpg-auto-import-keys --non-interactive install --auto-agree-with-licenses ", + "ZYPP_READONLY_HACK=1 zypper --root %1 " \ + "--non-interactive install --auto-agree-with-licenses ", rootdir ) From cfdf947c5bb77378214056cf54133940969ae2cd Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Wed, 1 Apr 2020 15:21:49 +0200 Subject: [PATCH 03/10] Sle 15 ga bsc 1164105 1 (#579) * Init script: Checking working network with network-online.target (#564) * Init script: Checking working network with network-online.target --- package/autoyast2.changes | 8 ++++++++ package/autoyast2.spec | 2 +- scripts/autoyast-initscripts.service | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package/autoyast2.changes b/package/autoyast2.changes index a5bf2abc1..2eb741195 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Mar 31 09:29:30 CEST 2020 - schubi@suse.de + +- Service for init scripts: Try to start "network-online.target" + before starting the AY init scripts in order to get a working + network (bsc#1164105). +- 4.0.73 + ------------------------------------------------------------------- Tue Mar 10 10:19:09 CET 2020 - schubi@suse.de diff --git a/package/autoyast2.spec b/package/autoyast2.spec index 2835a9810..34d5039fc 100644 --- a/package/autoyast2.spec +++ b/package/autoyast2.spec @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.0.72 +Version: 4.0.73 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/scripts/autoyast-initscripts.service b/scripts/autoyast-initscripts.service index 83881ab3b..2a5069155 100644 --- a/scripts/autoyast-initscripts.service +++ b/scripts/autoyast-initscripts.service @@ -2,6 +2,7 @@ Description=Autoyast2 Init Scripts After=remote-fs.target network-online.target time-sync.target mail-transfer-agent.target hwscan.service ypbind.service YaST2-Second-Stage.service Before=systemd-user-sessions.service +Wants=network-online.target [Service] Type=oneshot From fd8fad0468676779167b50f3a8b0b8e82cef5c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Thu, 11 Jun 2020 16:52:08 +0100 Subject: [PATCH 04/10] Export ntp_policy via CDATA so that empty strings are preserved --- src/include/autoinstall/xml.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/autoinstall/xml.rb b/src/include/autoinstall/xml.rb index 18287a108..64ad25fbb 100644 --- a/src/include/autoinstall/xml.rb +++ b/src/include/autoinstall/xml.rb @@ -124,7 +124,8 @@ def profileSetup "location", "script_source", "media_url", - "subvolumes_prefix" + "subvolumes_prefix", + "ntp_policy" ] ) # doc["systemID"] = "/usr/share/autoinstall/dtd/profile.dtd"; From 53ffe437d443eb73e3dd5b331517cc80bbe4ab8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Fri, 12 Jun 2020 14:18:03 +0100 Subject: [PATCH 05/10] Bump version & changelog --- package/autoyast2.changes | 7 +++++++ package/autoyast2.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package/autoyast2.changes b/package/autoyast2.changes index 1f0714db1..57130091a 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jun 12 13:15:42 UTC 2020 - Knut Anderssen + +- Export ntp_policy as CDATA so that empty strings are preserved + during for the second_stage (bsc#1172026) +- 4.1.17 + ------------------------------------------------------------------- Wed May 20 22:00:01 UTC 2020 - David Díaz diff --git a/package/autoyast2.spec b/package/autoyast2.spec index c90833d04..e3419141a 100644 --- a/package/autoyast2.spec +++ b/package/autoyast2.spec @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.1.16 +Version: 4.1.17 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build From b29c6b2633b86378a29e1e604e2ebe8361d4c6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Tue, 7 Jul 2020 00:18:26 +0100 Subject: [PATCH 06/10] Run pre-scripts just after the profile has been processed --- src/clients/inst_autoinit.rb | 44 +++++++++++++++++++++++++++++++ src/clients/inst_autosetup.rb | 49 +++-------------------------------- 2 files changed, 48 insertions(+), 45 deletions(-) diff --git a/src/clients/inst_autoinit.rb b/src/clients/inst_autoinit.rb index ff6bee40d..6d8013bae 100644 --- a/src/clients/inst_autoinit.rb +++ b/src/clients/inst_autoinit.rb @@ -7,9 +7,13 @@ # # $Id$ # +require "autoinstall/autosetup_helpers" + module Yast class InstAutoinitClient < Client include Yast::Logger + include Y2Autoinstallation::AutosetupHelpers + def main Yast.import "UI" @@ -20,6 +24,7 @@ def main Yast.import "AutoinstConfig" Yast.import "AutoinstFunctions" Yast.import "AutoinstGeneral" + Yast.import "AutoinstScripts" Yast.import "ProfileLocation" Yast.import "AutoInstallRules" Yast.import "Progress" @@ -33,6 +38,7 @@ def main Yast.import "Popup" Yast.include self, "autoinstall/autoinst_dialogs.rb" + Yast.include self, "autoinstall/ask.rb" Console.Init @@ -44,6 +50,7 @@ def main _("Retrieve & Read Control File"), _("Parse control file"), _("Initial Configuration"), + _("Execute pre-install user scripts") ] @profileFetched = false @@ -84,6 +91,13 @@ def main return @ret if @ret != :ok end + Yast::Progress.NextStage + Yast::Progress.Title(_("Executing pre-install user scripts...")) + log.info("Executing pre-scripts") + + @ret = autoinit_scripts + return @ret if @ret != :ok + Progress.Finish if !(Mode.autoupgrade && AutoinstConfig.ProfileInRootPart) @@ -127,6 +141,36 @@ def main private + def autoinit_scripts + # Pre-Scripts + AutoinstScripts.Import(Profile.current["scripts"] || {}) + AutoinstScripts.Write("pre-scripts", false) + + # Reread Profile in case it was modified in pre-script + # User has to create the new profile in a pre-defined + # location for easy processing in pre-script. + + return :abort if readModified == :abort + + return :abort if UI.PollInput == :abort && Popup.ConfirmAbort(:painless) + + loop do + askDialog + # Pre-Scripts + AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) + AutoinstScripts.Write("pre-scripts", false) + ret = readModified + return :abort if ret == :abort + + return :restart_yast if File.exist?("/var/lib/YaST2/restart_yast") + break if ret == :not_found + end + + # reimport scripts, for the case has changed them + AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) + :ok + end + # Checking profile for unsupported sections. def check_unsupported_profile_sections unsupported_sections = Y2ModuleConfig.unsupported_profile_sections diff --git a/src/clients/inst_autosetup.rb b/src/clients/inst_autosetup.rb index e9fd42813..fb61a309a 100644 --- a/src/clients/inst_autosetup.rb +++ b/src/clients/inst_autosetup.rb @@ -46,13 +46,10 @@ def main Yast.import "AutoinstFunctions" Yast.import "Wizard" - Yast.include self, "autoinstall/ask.rb" - @help_text = _( "

Please wait while the system is prepared for autoinstallation.

" ) @progress_stages = [ - _("Execute pre-install user scripts"), _("Configure General Settings "), _("Set up language"), _("Configure security settings"), @@ -67,7 +64,6 @@ def main ] @progress_descriptions = [ - _("Executing pre-install user scripts..."), _("Configuring general settings..."), _("Setting up language..."), _("Configuring security settings"), @@ -90,48 +86,8 @@ def main @help_text ) - - return :abort if UI.PollInput == :abort && Popup.ConfirmAbort(:painless) - - - Progress.NextStage - - # Pre-Scripts - AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) - AutoinstScripts.Write("pre-scripts", false) - - # Reread Profile in case it was modified in pre-script - # User has to create the new profile in a pre-defined - # location for easy processing in pre-script. - - return :abort if readModified == :abort - return :abort if UI.PollInput == :abort && Popup.ConfirmAbort(:painless) - # - # Partitioning and Storage - #////////////////////////////////////////////////////////////////////// - - @modified = true - begin - askDialog - # Pre-Scripts - AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) - AutoinstScripts.Write("pre-scripts", false) - @ret2 = readModified - return :abort if @ret2 == :abort - @modified = false if @ret2 == :not_found - if Ops.greater_or_equal( - SCR.Read(path(".target.size"), "/var/lib/YaST2/restart_yast"), - 0 - ) - return :restart_yast - end - end while @modified == true - - - # reimport scripts, for the case has changed them - AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) # # Set workflow variables # @@ -255,7 +211,6 @@ def main Builtins.y2milestone("y2confirm found and confirm turned on") end - return :abort if UI.PollInput == :abort && Popup.ConfirmAbort(:painless) # moved here from autoinit for fate #301193 @@ -282,6 +237,10 @@ def main autosetup_security return :abort if UI.PollInput == :abort && Popup.ConfirmAbort(:painless) + # + # Partitioning and Storage + #////////////////////////////////////////////////////////////////////// + Progress.NextStage probe_storage if modified_profile? || dasd_or_zfcp From 2a6033fd47718afe2473a6e291fb2f6d9597c546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Tue, 7 Jul 2020 00:46:15 +0100 Subject: [PATCH 07/10] Bump version & changelog --- package/autoyast2.changes | 7 +++++++ package/autoyast2.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package/autoyast2.changes b/package/autoyast2.changes index 2eb741195..c01fea593 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jul 6 23:41:41 UTC 2020 - Knut Anderssen + +- Move pre-scriptis to the autoinit client running them just after + the profile has been processed (bsc#1110413) +- 4.0.74 + ------------------------------------------------------------------- Tue Mar 31 09:29:30 CEST 2020 - schubi@suse.de diff --git a/package/autoyast2.spec b/package/autoyast2.spec index 34d5039fc..44e6b8ddd 100644 --- a/package/autoyast2.spec +++ b/package/autoyast2.spec @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.0.73 +Version: 4.0.74 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build From 90b10a0622550d9b58e7d3f3dd145c8cef445fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Tue, 7 Jul 2020 08:43:42 +0100 Subject: [PATCH 08/10] Added bug reference and a method comment --- src/clients/inst_autoinit.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/clients/inst_autoinit.rb b/src/clients/inst_autoinit.rb index 6d8013bae..ac25e307f 100644 --- a/src/clients/inst_autoinit.rb +++ b/src/clients/inst_autoinit.rb @@ -91,6 +91,8 @@ def main return @ret if @ret != :ok end + # Run pre-scripts as soon as possible as we could modify the profile by + # them or by the ask dialog (bsc#1114013) Yast::Progress.NextStage Yast::Progress.Title(_("Executing pre-install user scripts...")) log.info("Executing pre-scripts") @@ -141,6 +143,9 @@ def main private + # Import and write the profile pre-scripts running then the ask dialog when + # an ask-list is declared redoing the import and write of the pre-scripts as + # many times as needed. def autoinit_scripts # Pre-Scripts AutoinstScripts.Import(Profile.current["scripts"] || {}) From 7d054cda34160b235ad8115b08a846a544feb94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Tue, 7 Jul 2020 10:53:44 +0100 Subject: [PATCH 09/10] Drop pre-scripts from autosetup_upgrade --- src/clients/inst_autosetup_upgrade.rb | 37 --------------------------- 1 file changed, 37 deletions(-) diff --git a/src/clients/inst_autosetup_upgrade.rb b/src/clients/inst_autosetup_upgrade.rb index e00b1fb15..266536a54 100644 --- a/src/clients/inst_autosetup_upgrade.rb +++ b/src/clients/inst_autosetup_upgrade.rb @@ -45,7 +45,6 @@ def main ) @progress_stages = [ _("Configure General Settings "), - _("Execute pre-install user scripts"), _("Set up language"), _("Registration"), _("Configure Software selections"), @@ -55,7 +54,6 @@ def main @progress_descriptions = [ _("Configuring general settings..."), - _("Executing pre-install user scripts..."), _("Setting up language..."), _("Registering the system..."), _("Configuring Software selections..."), @@ -73,47 +71,12 @@ def main ) - return :abort if Popup.ConfirmAbort(:painless) if UI.PollInput == :abort - Progress.NextStage - - # configure general settings - - - - return :abort if Popup.ConfirmAbort(:painless) if UI.PollInput == :abort Progress.NextStage - # Pre-Scripts - AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) - AutoinstScripts.Write("pre-scripts", false) - - # Reread Profile in case it was modified in pre-script - # User has to create the new profile in a pre-defined - # location for easy processing in pre-script. - - return :abort if readModified == :abort - - # - # Partitioning and Storage - #////////////////////////////////////////////////////////////////////// - - @modified = true - begin - askDialog - # Pre-Scripts - AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) - AutoinstScripts.Write("pre-scripts", false) - @ret2 = readModified - return :abort if @ret2 == :abort - @modified = false if @ret2 == :not_found - end while @modified == true - - # reimport scripts, for the case has changed them - AutoinstScripts.Import(Ops.get_map(Profile.current, "scripts", {})) # # Set workflow variables # From 9ae7bc595a146e493825c15d4cf66dfed65af53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Wed, 8 Jul 2020 15:42:16 +0100 Subject: [PATCH 10/10] Fix changelog typo --- package/autoyast2.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/autoyast2.changes b/package/autoyast2.changes index c0873e470..b880f5bd9 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Mon Jul 6 23:41:41 UTC 2020 - Knut Anderssen -- Move pre-scriptis to the autoinit client running them just after +- Move pre-scripts to the autoinit client running them just after the profile has been processed (bsc#1110413) - 4.1.18