Author: jsrain
Date: Wed Jan 19 14:14:55 2011
New Revision: 63222
URL: http://svn.opensuse.org/viewcvs/yast?rev=63222&view=rev
Log:
adaptations for unattended migration (fate#310481)
Added:
branches/SuSE-Code-11-SP2-Branch/update/src/clients/inst_update_partition_auto.ycp
Modified:
branches/SuSE-Code-11-SP2-Branch/update/package/yast2-update.changes
branches/SuSE-Code-11-SP2-Branch/update/src/clients/Makefile.am
branches/SuSE-Code-11-SP2-Branch/update/src/include/rootpart.ycp
branches/SuSE-Code-11-SP2-Branch/update/src/modules/RootPart.ycp
branches/SuSE-Code-11-SP2-Branch/update/yast2-update.spec.in
Modified: branches/SuSE-Code-11-SP2-Branch/update/package/yast2-update.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/update/package/yast2-update.changes?rev=63222&r1=63221&r2=63222&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/update/package/yast2-update.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/update/package/yast2-update.changes Wed Jan 19 14:14:55 2011
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Jan 19 14:12:00 CET 2011 - jsrain@suse.cz
+
+- adaptations for unattended migration (fate#310481)
+
+-------------------------------------------------------------------
Mon Mar 22 14:36:27 CET 2010 - jsrain@suse.cz
- leave kernel selection purely on dependencies during update
Modified: branches/SuSE-Code-11-SP2-Branch/update/src/clients/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/update/src/clients/Makefile.am?rev=63222&r1=63221&r2=63222&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/update/src/clients/Makefile.am (original)
+++ branches/SuSE-Code-11-SP2-Branch/update/src/clients/Makefile.am Wed Jan 19 14:14:55 2011
@@ -13,6 +13,7 @@
backup_proposal.ycp \
update.ycp \
inst_update_partition.ycp \
+ inst_update_partition_auto.ycp \
run_update.ycp
EXTRA_DIST = $(client_DATA)
Added: branches/SuSE-Code-11-SP2-Branch/update/src/clients/inst_update_partition_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/update/src/clients/inst_update_partition_auto.ycp?rev=63222&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/update/src/clients/inst_update_partition_auto.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/update/src/clients/inst_update_partition_auto.ycp Wed Jan 19 14:14:55 2011
@@ -0,0 +1,68 @@
+/**
+ * Module: inst_update_partition.ycp
+ *
+ * Authors: Stefan Schubert
+ * Arvin Schnell
+ *
+ * Purpose: Select root partition for update or booting.
+ * RootPart::rootPartitions must be filled before
+ * calling this module.
+ *
+ * $Id:$
+ */
+{
+textdomain "update";
+
+import "ProductControl";
+import "RootPart";
+
+include "update/rootpart.ycp";
+
+if (RootPart::Mounted ()) {
+ Update::Detach ();
+ RootPart::UnmountPartitions (false);
+}
+
+RootPart::Detect ();
+// if there is only one suitable partition which can be mounted, use it without asking
+string target_system = "";
+
+
+map partitions = filter (string name, map p, RootPart::rootPartitions, {
+ if (p[`valid]:false)
+ target_system = name;
+ return p[`valid]:false;
+});
+
+if (size (partitions) == 1)
+{
+ y2milestone ("Auto-mounting system located at %1", target_system);
+ RootPart::selectedRootPartition = target_system;
+ RootPart::targetOk = RootPart::mount_target ();
+
+ // Not mounted correctly
+ if (! RootPart::targetOk) {
+ // error report
+ Report::Error (_("Failed to mount target system"));
+ UmountMountedPartition();
+ // Correctly mounted but incomplete installation found
+ } else if (RootPart::IncompleteInstallationDetected (Installation::destdir)) {
+ Report::Error (_("A possibly incomplete installation has been detected."));
+ UmountMountedPartition();
+ }
+ else if (!(Pkg::TargetInitialize (Installation::destdir) && Pkg::TargetLoad()))
+ {
+ Report::Error ("Initializing the target system failed");
+ UmountMountedPartition();
+ Pkg::TargetFinish();
+ }
+ else
+ {
+ return `next;
+ }
+}
+symbol ret = RootPartitionDialog (`update_dialog);
+
+return ret;
+
+}
Modified: branches/SuSE-Code-11-SP2-Branch/update/src/include/rootpart.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/update/src/include/rootpart.ycp?rev=63222&r1=63221&r2=63222&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/update/src/include/rootpart.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/update/src/include/rootpart.ycp Wed Jan 19 14:14:55 2011
@@ -20,6 +20,7 @@
import "Report";
import "Update";
import "Installation";
+import "Mode";
// Returns boolean whether partition can be
// a Linux 'root' file system
@@ -222,6 +223,8 @@
if (flavor == `update_dialog)
{
Wizard::SetContents (title, contents, help_text, true, true);
+ if (Mode::autoupgrade())
+ Wizard::EnableAbortButton();
}
else if (flavor == `update_dialog_proposal)
{
@@ -285,6 +288,8 @@
else
ret = UI::UserInput ();
+ if (ret == `cancel)
+ ret = `abort;
if (ret == `abort && Popup::ConfirmAbort (`painless))
break;
@@ -371,6 +376,8 @@
if (flavor != `update_dialog)
UI::CloseDialog ();
+ else if (Mode::autoupgrade())
+ Wizard::DisableAbortButton();
// New partition has been mounted
if (flavor == `update_dialog && ret == `next) {
Modified: branches/SuSE-Code-11-SP2-Branch/update/src/modules/RootPart.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/update/src/modules/RootPart.ycp?rev=63222&r1=63221&r2=63222&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/update/src/modules/RootPart.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/update/src/modules/RootPart.ycp Wed Jan 19 14:14:55 2011
@@ -29,6 +29,7 @@
import "Report";
import "Label";
import "Stage";
+ import "Wizard";
include "partitioning/custom_part_dialogs.ycp";
@@ -604,6 +605,12 @@
// such as /dev/sdc4 -> /dev/hdb4
map backward_translation = $[];
+ string update_mount_options (string options) {
+ if (regexpmatch (options, "^\(.*,\)\?hotplug\(,.*\)\?$"))
+ return regexpsub (options, "^\(.*,\)\?hotplug\(,.*\)\?$", "\\1nofail\\2");
+ return options;
+ }
+
/**
* Translates FS or Cryptotab (old devices to new ones).
* Such as /dev/hda5 to /dev/sda5.
@@ -652,6 +659,8 @@
translate[i, key_preserve_as] = default_val;
backward_translation[new_val] = default_val;
+ translate[i, "mntops"] = update_mount_options (translate[i, "mntops"]:"");
+
i = i + 1;
};
@@ -1398,10 +1407,16 @@
if (FstabUsesKernelDeviceNameForHarddisks(fstab))
{
y2warning("fstab on %1 uses kernel device name for hard disks", root_device_current);
- Popup::Warning(sformat(_("Some partitions in the system on %1 are mounted by kernel-device name. This is
+ string warning = sformat(_("Some partitions in the system on %1 are mounted by kernel-device name. This is
not reliable for the update since kernel-device names are unfortunately not
persistent. It is strongly recommended to start the old system and change the
-mount-by method to any other method for all partitions."), root_device_current));
+mount-by method to any other method for all partitions."), root_device_current);
+
+ if (Mode::autoupgrade()) {
+ Popup::TimedWarning(warning, 10);
+ } else {
+ Popup::Warning(warning);
+ }
}
if (size (fstab) == 0)
Modified: branches/SuSE-Code-11-SP2-Branch/update/yast2-update.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/update/yast2-update.spec.in?rev=63222&r1=63221&r2=63222&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/update/yast2-update.spec.in (original)
+++ branches/SuSE-Code-11-SP2-Branch/update/yast2-update.spec.in Wed Jan 19 14:14:55 2011
@@ -73,6 +73,7 @@
@clientdir@/packages_proposal.ycp
@clientdir@/backup_proposal.ycp
@clientdir@/inst_update_partition.ycp
+@clientdir@/inst_update_partition_auto.ycp
@clientdir@/rootpart_check_keyboard.ycp
@yncludedir@/update
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org