Author: jsrain
Date: Wed Jan 19 15:16:35 2011
New Revision: 63230
URL: http://svn.opensuse.org/viewcvs/yast?rev=63230&view=rev
Log:
- adaptations for unattended migration (fate#310481)
Added:
trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp
trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp
Modified:
trunk/autoinstallation/VERSION
trunk/autoinstallation/autoyast2.spec.in
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/clients/Makefile.am
trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp
trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp
trunk/autoinstallation/src/clients/inst_autoconfigure.ycp
trunk/autoinstallation/src/clients/inst_autoinit.ycp
trunk/autoinstallation/src/modules/AutoInstall.ycp
trunk/autoinstallation/src/modules/AutoinstConfig.ycp
Modified: trunk/autoinstallation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/VERSION?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/VERSION (original)
+++ trunk/autoinstallation/VERSION Wed Jan 19 15:16:35 2011
@@ -1 +1 @@
-2.20.3
+2.20.4
Modified: trunk/autoinstallation/autoyast2.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/autoyast2.spec.in?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/autoyast2.spec.in (original)
+++ trunk/autoinstallation/autoyast2.spec.in Wed Jan 19 15:16:35 2011
@@ -204,6 +204,9 @@
@clientdir@/autoinst_scripts1_finish.ycp
@clientdir@/autoinst_scripts2_finish.ycp
@clientdir@/ayast_probe.ycp
+@clientdir@/inst_autosetup_upgrade.ycp
+@clientdir@/inst_store_upgrade_software.ycp
+
@yncludedir@/autoinstall/xml.ycp
@yncludedir@/autoinstall/ask.ycp
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyast2.changes?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Wed Jan 19 15:16:35 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jan 19 15:15:20 CET 2011 - jsrain@suse.cz
+
+- adaptations for unattended migration (fate#310481)
+- 2.20.4
+
+-------------------------------------------------------------------
Tue Jan 4 11:04:33 UTC 2011 - lslezak@suse.cz
- fixed build (wrong mount call params)
Modified: trunk/autoinstallation/src/clients/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/Makefile.am?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/Makefile.am (original)
+++ trunk/autoinstallation/src/clients/Makefile.am Wed Jan 19 15:16:35 2011
@@ -13,6 +13,8 @@
inst_autoinit.ycp \
inst_autopost.ycp \
inst_autosetup.ycp \
+ inst_autosetup_upgrade.ycp \
+ inst_store_upgrade_software.ycp \
report_auto.ycp \
scripts_auto.ycp \
software_auto.ycp \
Modified: trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp (original)
+++ trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp Wed Jan 19 15:16:35 2011
@@ -42,7 +42,7 @@
"steps" : 1,
// progress step title
"title" : _("Executing autoinstall scripts in the installation environment..."),
- "when" : [ `autoinst ],
+ "when" : [ `autoinst, `autoupg ],
];
}
else if (func == "Write")
Modified: trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp (original)
+++ trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp Wed Jan 19 15:16:35 2011
@@ -40,7 +40,7 @@
"steps" : 1,
// progress step title
"title" : _("Executing autoinstall scripts in the installation environment..."),
- "when" : [ `autoinst ],
+ "when" : [ `autoinst, `autoupg ],
];
}
else if (func == "Write")
Modified: trunk/autoinstallation/src/clients/inst_autoconfigure.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autoconfigure.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autoconfigure.ycp (original)
+++ trunk/autoinstallation/src/clients/inst_autoconfigure.ycp Wed Jan 19 15:16:35 2011
@@ -112,10 +112,13 @@
y2milestone("Order: %1", maplist(map d, deps, ``(d["res"]:"")));
- if (!haskey(Profile::current , "networking") ) {
- removeNetwork(); // no networking section -> no network
- } else if( Profile::current["networking","keep_install_network"]:false == false ) {
- removeNetwork(); // networking section without keeping the install network
+ // keep network on AutoYaST ugprade
+ if (! Mode::autoupgrade()) {
+ if (!haskey(Profile::current , "networking") ) {
+ removeNetwork(); // no networking section -> no network
+ } else if( Profile::current["networking","keep_install_network"]:false == false ) {
+ removeNetwork(); // networking section without keeping the install network
+ }
}
foreach(map r, deps,
Modified: trunk/autoinstallation/src/clients/inst_autoinit.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autoinit.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autoinit.ycp (original)
+++ trunk/autoinstallation/src/clients/inst_autoinit.ycp Wed Jan 19 15:16:35 2011
@@ -23,6 +23,7 @@
// import "Arch";
import "Call";
import "Console";
+ import "Mode";
import "Popup";
@@ -165,10 +166,22 @@
}
Progress::Title(_("Probing hardware..."));
- WFM::CallFunction("inst_system_analysis", [] );
+
+ if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart))
+ WFM::CallFunction("inst_system_analysis", [] );
AutoInstallRules::ProbeRules();
if( ! profileFetched ) {
+
+
+ // if profile is defined, first read it, then probe hardware
+ any autoinstall = SCR::Read(.etc.install_inf.AutoYaST);
+ if (Mode::autoupgrade() && ! (autoinstall != nil && is ( autoinstall , string ) && (string)autoinstall != ""))
+ {
+ AutoinstConfig::ParseCmdLine("file:///mnt/root/autoupg.xml");
+ AutoinstConfig::ProfileInRootPart = true;
+ }
+
symbol ret = processProfile();
if( ret != `ok ) {
return ret;
Added: trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp?rev=63230&view=auto
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp (added)
+++ trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp Wed Jan 19 15:16:35 2011
@@ -0,0 +1,434 @@
+/**
+ * File: clients/inst_autosetup.ycp
+ * Package: Auto-installation
+ * Summary: Setup and prepare system for auto-installation
+ * Authors: Anas Nashif
+ * Uwe Gansert
+ *
+ * $Id: inst_autosetup.ycp 61521 2010-03-29 09:10:07Z ug $
+ */
+
+{
+ textdomain "autoinst";
+
+ import "AutoinstConfig";
+ import "AutoInstall";
+ import "Installation";
+ import "Profile";
+ import "Progress";
+ import "Report";
+ import "AutoinstStorage";
+ import "AutoinstScripts";
+ import "AutoinstGeneral";
+ import "AutoinstSoftware";
+ import "Bootloader";
+ import "BootCommon";
+ import "Popup";
+ import "RunlevelEd";
+ import "Arch";
+ import "AutoinstLVM";
+ import "AutoinstRAID";
+ import "Storage";
+ import "Timezone";
+ import "Keyboard";
+ import "Call";
+ import "ProductControl";
+ import "LanUdevAuto";
+ import "Language";
+ import "Console";
+
+ include "bootloader/routines/autoinstall.ycp";
+ include "autoinstall/ask.ycp";
+
+ define symbol readModified() {
+ if (SCR::Read(.target.size, AutoinstConfig::modified_profile) > 0 ) {
+ if (! Profile::ReadXML( AutoinstConfig::modified_profile ) || Profile::current == $[] ) {
+ Popup::Error(_("Error while parsing the control file.
+Check the log files for more details or fix the
+control file and try again.
+"));
+ return `abort;
+ }
+ string cpcmd = sformat("mv %1 %2","/tmp/profile/autoinst.xml", "/tmp/profile/pre-autoinst.xml");
+ y2milestone("copy original profile: %1",cpcmd);
+ SCR::Execute(.target.bash, cpcmd);
+
+ cpcmd = sformat("mv %1 %2", AutoinstConfig::modified_profile, "/tmp/profile/autoinst.xml");
+ y2milestone("moving modified profile: %1",cpcmd);
+ SCR::Execute(.target.bash, cpcmd);
+ return `found;
+ }
+ return `not_found;
+ }
+
+ string help_text = _("<P>Please wait while the system is prepared for autoinstallation.</P>");
+ list<string> progress_stages =
+ [
+ _("Configure General Settings "),
+ _("Execute pre-install user scripts"),
+ _("Set up language"),
+ _("Configure Software selections"),
+ ];
+
+ list<string> progress_descriptions =
+ [
+ _("Configuring general settings..."),
+ _("Executing pre-install user scripts..."),
+ _("Configuring Software selections...")
+ ];
+
+ Progress::New(
+ _("Preparing System for Automated Installation"),
+ "", // progress_title
+ size( progress_stages ), // progress bar length
+ progress_stages,
+ progress_descriptions,
+ help_text );
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+ Progress::NextStage();
+
+
+ // configure general settings
+
+
+
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ Progress::NextStage();
+
+ // 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.
+
+ if( readModified() == `abort )
+ return `abort;
+
+ //
+ // Partitioning and Storage
+ ////////////////////////////////////////////////////////////////////////
+
+ boolean modified = true;
+ do {
+ askDialog();
+ // Pre-Scripts
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ AutoinstScripts::Write("pre-scripts", false);
+ symbol ret = readModified();
+ if( ret == `abort )
+ return `abort;
+ if( ret == `not_found )
+ modified = false;
+ } while( modified == true );
+
+ // reimport scripts, for the case <ask> has changed them
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ //
+ // Set Mouse and other workflow variables
+ //
+ AutoinstGeneral::Import(Profile::current["general"]:$[]);
+ y2milestone("general: %1", Profile::current["general"]:$[] );
+ AutoinstGeneral::Write();
+
+ if( haskey( Profile::current, "add-on" ) ) {
+ Call::Function("add-on_auto", ["Import", Profile::current["add-on"]:$[]] );
+ Call::Function("add-on_auto", ["Write"]);
+ }
+
+ boolean use_utf8 = true; // utf8 is default
+
+ map displayinfo = UI::GetDisplayInfo();
+ if ( ! displayinfo["HasFullUtf8Support"]:true )
+ {
+ use_utf8 = false; // fallback to ascii
+ }
+
+
+ //
+ // Set it in the Language module.
+ //
+ Progress::NextStep();
+ Progress::Title(_("Configuring language..."));
+ Language::Import( Profile::current["language"]:$[] );
+
+ //
+ // Set Console font
+ //
+ Installation::encoding = Console::SelectFont( Language::language );
+
+ if (displayinfo["HasFullUtf8Support"]:true)
+ {
+ Installation::encoding = "UTF-8";
+ }
+
+ UI::SetLanguage (Language::language, Installation::encoding);
+ WFM::SetLanguage (Language::language, "UTF-8");
+
+ if( haskey( Profile::current, "timezone" ) )
+ Timezone::Import(Profile::current["timezone"]:$[]);
+ if( haskey( Profile::current, "keyboard" ) )
+ Keyboard::Import(Profile::current["keyboard"]:$[]);
+
+
+ // one can override the <confirm> option by the commandline parameter y2confirm
+ string tmp = (string)SCR::Read (.target.string, "/proc/cmdline");
+ if (tmp != nil && contains (splitstring (tmp, " \n"), "y2confirm")) {
+ AutoinstConfig::Confirm = true;
+ y2milestone("y2confirm found and confirm turned on");
+ }
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ // moved here from autoinit for fate #301193
+ // needs testing
+ if( Arch::s390 () && AutoinstConfig::remoteProfile == true ) {
+ y2milestone("arch=s390 and remote_profile=true");
+ if( haskey(Profile::current, "dasd") ) {
+ y2milestone("dasd found");
+ Call::Function("dasd_auto", ["Import", Profile::current["dasd"]:$[] ]);
+ }
+ if( haskey(Profile::current, "zfcp") ) {
+ y2milestone("zfcp found");
+ Call::Function("zfcp_auto", ["Import", Profile::current["zfcp"]:$[] ]);
+ }
+ }
+
+ Progress::NextStage();
+
+ Storage::ReReadTargetMap();
+
+ if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart)) {
+ if (`abort == WFM::CallFunction("inst_update_partition_auto", []))
+ return `abort;
+ }
+
+
+ // Software
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ Progress::NextStage();
+
+ // initialize package manager
+ import "Packages";
+ import "PackageCallbacks";
+ import "Update";
+ import "RootPart";
+ import "ProductFeatures";
+ import "Product";
+
+// FIXME FIXME FIXME copy-paste from update_proposal
+ map GetUpdateConf () {
+ // 'nil' values are skipped, in that case, ZYPP uses own default values
+ map ret = $[];
+
+// not supported by libzypp anymore
+// if (Update::deleteOldPackages != nil) {
+// ret["delete_unmaintained"] = Update::deleteOldPackages;
+// }
+
+ if (Update::silentlyDowngradePackages != nil) {
+ ret["silent_downgrades"] = Update::silentlyDowngradePackages;
+ }
+
+ y2milestone ("Using update configuration: %1", ret);
+
+ return ret;
+ }
+
+ Packages::Init(true);
+
+ // initialize target
+ if (true)
+ {
+ PackageCallbacks::SetConvertDBCallbacks ();
+
+ Pkg::TargetInit (Installation::destdir, false);
+
+ Update::GetProductName ();
+ }
+
+ // FATE #301990, Bugzilla #238488
+ // Set initial update-related (packages/patches) values from control file
+ Update::InitUpdate();
+
+ // some products are listed in media control file and at least one is compatible
+ // with system just being updated
+ boolean update_not_possible = false;
+
+ // FATE #301844
+ y2milestone ("Previous '%1', New '%2' RootPart",
+ RootPart::previousRootPartition, RootPart::selectedRootPartition);
+ if (RootPart::previousRootPartition != RootPart::selectedRootPartition) {
+ RootPart::previousRootPartition = RootPart::selectedRootPartition;
+
+ // check whether update is possible
+ // reset deleteOldPackages and onlyUpdateInstalled in respect to the selected system
+ Update::Reset();
+ if (! Update::IsProductSupportedForUpgrade()) {
+ y2milestone ("Upgrade is not supported");
+ update_not_possible = true;
+ }
+ }
+
+ // this is new - override the default upgrade mode
+ if (Profile::current["upgrade","only_installed_packages"]:nil != nil)
+ Update::onlyUpdateInstalled = Profile::current["upgrade","only_installed_packages"]:true;
+
+ // connect target with package manager
+ if (!Update::did_init1)
+ {
+ Update::did_init1 = true;
+
+ if (size (Pkg::ResolvableProperties ("", `pattern, "")) > 0)
+ {
+ y2milestone ("No base selection found, but patterns found...");
+ Packages::using_patterns = true;
+ }
+
+ list<string> restore = [];
+ list