Author: snwint
Date: Tue Jul 19 14:20:00 2011
New Revision: 64886
URL: http://svn.opensuse.org/viewcvs/yast?rev=64886&view=rev
Log:
- fix using uuid names (bnc #594482, bnc #687878, bnc #704101)
Modified:
branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION
branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes
branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp
branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lib_iface.ycp
branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION?rev=64886&r1=64885&r2=64886&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION Tue Jul 19 14:20:00 2011
@@ -1 +1 @@
-2.17.73
+2.17.74
Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes?rev=64886&r1=64885&r2=64886&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/bootloader/package/yast2-bootloader.changes Tue Jul 19 14:20:00 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jul 19 14:13:52 CEST 2011 - snwint@suse.de
+
+- fix using uuid names (bnc #594482, bnc #687878, bnc #704101)
+- 2.17.74
+
+-------------------------------------------------------------------
Thu May 6 12:33:08 CEST 2010 - juhliarik@suse.cz
- added fix for deleting gfxmenu in console is defined (bnc#602743)
Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp?rev=64886&r1=64885&r2=64886&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/modules/BootCommon.ycp Tue Jul 19 14:20:00 2011
@@ -100,6 +100,33 @@
*/
global map multipath_mapping = $[];
+// it is ugly hack because y2-storage doesn't known to indicate
+// that it finish (create partitions) proposed partitioning
+// of disk in installation
+/** bnc#687878 - mountby uuid not respected in menu.lst
+ * Indicate if storage already finish partitioning of disk
+ * if some partition includes any keyword "create"
+ * the value is the first found partition with flag "create" e.g. /dev/sda2
+ * empty string means all partitions are created
+ */
+string proposed_partition = "";
+
+/** bnc#687878 - mountby uuid not respected in menu.lst
+ * 0 - if all devices in variable all_devices are created.
+ * 1 - if partition with flag "create" was found in MapDevices()
+ * 2 - if proposed_partition was created or flag "create" was deleted
+ * by y2-storage. the value is set in CheckProposedPartition ()
+ */
+integer all_devices_created = 0;
+
+/** bnc#687878 - mountby uuid not respected in menu.lst
+ * 0 - if all devices in variable all_partitions and all_disks are created
+ * 1 - if partition with flag "create" was found in MapDevices()
+ * 2 - if proposed_partition was created or flag "create" was deleted
+ * by y2-storage. the value is set in CheckProposedPartition ()
+ */
+integer all_partitions_created = 0;
+
/**
* Flag indicates that bios_id_missing in disk
* true if missing false if at least one disk has bios_id
Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lib_iface.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lib_iface.ycp?rev=64886&r1=64885&r2=64886&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lib_iface.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lib_iface.ycp Tue Jul 19 14:20:00 2011
@@ -149,6 +149,7 @@
if (!force && loader == library_initialized)
return false;
+ InitMapDevices ();
y2milestone ("Initializing lib for %1", loader);
System::Bootloader_API::setLoaderType (loader);
y2milestone ("Putting partitioning into library");
Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp?rev=64886&r1=64885&r2=64886&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/misc.ycp Tue Jul 19 14:20:00 2011
@@ -211,6 +211,14 @@
foreach (map p, (list<map>)(v["partitions"]:[]),
{
+ // bnc#687878 - mountby uuid not respected in menu.lst
+ // if there is "not created" partition and flag for "it" is not set
+ if ((p["create"]:nil == true) && (Mode::installation()))
+ {
+ if (BootCommon::proposed_partition == "")
+ BootCommon::proposed_partition = p["device"]:"";
+ BootCommon::all_devices_created = 1;
+ }
// map partition by uuid
if ((p["uuid"]:nil != "") && (p["uuid"]:nil != nil))
{
@@ -242,6 +250,12 @@
}); // end of foreach (map p, (list<map>)(v["partitions"]:[]),
}); // end of foreach (string k, map v, devices,
+ if (Mode::installation() && BootCommon::all_devices_created == 2)
+ {
+ BootCommon::all_devices_created = 0;
+ y2milestone("set status for all_devices to \"created\"");
+ }
+
y2milestone("disks mapping by-id: %1", id_disks);
y2milestone("disks mapping by-uuid: %1", uuid_disks);
y2milestone("disks mapping by-path: %1", path_disks);
@@ -582,6 +596,107 @@
return temp_sec;
}
+/** bnc#687878 - mountby uuid not respected in menu.lst
+ * Function check if proposed_partition still includes
+ * flag "create"
+ *
+ * @param map tm
+ * @return true if partition is still not created
+ */
+
+boolean CheckProposedPartition (map tm)
+{
+
+ boolean ret = true;
+ if (!Mode::installation())
+ {
+ y2debug("Skip CheckProposedPartition() -> it is not running installation");
+ return false;
+ }
+ if (size(tm) == 0 || BootCommon::proposed_partition == "")
+ {
+ y2debug("proposed_partition is empty: %1", BootCommon::proposed_partition);
+ return false;
+ }
+ map dp = Storage::GetDiskPartition (proposed_partition);
+ string disk = dp["disk"]:"";
+ list <map> partitions = (list<map>)tm[disk,"partitions"]:[];
+ foreach (map p, partitions,
+ {
+ if (p["device"]:"" == BootCommon::proposed_partition)
+ {
+ if (p["create"]:nil != true)
+ {
+ BootCommon::proposed_partition = "";
+ y2milestone("proposed_partition is already created: %1", p);
+ if (BootCommon::all_devices_created == 1)
+ BootCommon::all_devices_created = 2;
+ if (BootCommon::all_partitions_created == 1)
+ BootCommon::all_partitions_created = 2;
+ ret = false;
+ } else {
+ y2milestone("proposed_partition: %1 is NOT created", BootCommon::proposed_partition);
+ }
+ break;
+ }
+ });
+ return ret;
+}
+
+/** bnc#687878 - mountby uuid not respected in menu.lst
+ * Check if it is necessary rebuild all_devices
+ *
+ * @return true -> rebuild all_devices
+ */
+
+boolean RebuildMapDevices()
+{
+ boolean ret = false;
+ boolean ret_CheckProposedPartition = CheckProposedPartition((map)Storage::GetTargetMap());
+
+ if (!ret_CheckProposedPartition && BootCommon::all_devices_created == 2)
+ return true;
+
+ return ret;
+}
+
+/** bnc#687878 - mountby uuid not respected in menu.lst
+ * Init and fullfil internal data for perl-Bootloader
+ *
+ * @return true if init reset/fullfil data or false and used cached data
+ */
+
+global boolean InitMapDevices ()
+{
+ boolean ret = false;
+ if (saved_last_change_time_from_storage != Storage::GetTargetChangeTime() || RebuildMapDevices())
+ {
+ y2milestone("Init internal data from storage");
+ MapDevices();
+ saved_last_change_time_from_storage = Storage::GetTargetChangeTime();
+ ret = true;
+ }
+
+ return ret;
+}
+
+/** bnc#687878 - mountby uuid not respected in menu.lst
+ * Check if it is necessary rebuild all_partitions and all_disks
+ *
+ * @return true -> rebuild all_partitions and all_disks
+ */
+
+boolean RebuildMapAllPartitions()
+{
+ boolean ret = false;
+ boolean ret_CheckProposedPartition = CheckProposedPartition((map)Storage::GetTargetMap());
+
+ if (!ret_CheckProposedPartition && BootCommon::all_partitions_created == 2)
+ return true;
+
+ return ret;
+}
+
/**
* bnc #468922 - problem with longtime running the parsing a huge number of disks
* Function initialize BootCommon::all_partitions only if storage change
@@ -592,7 +707,10 @@
boolean MapAllPartitions()
{
boolean ret = false;
- if (saved_last_change_time_from_storage != Storage::GetTargetChangeTime())
+ if ((saved_last_change_time_from_storage != Storage::GetTargetChangeTime())
+ || (size(BootCommon::all_partitions) < 1)
+ || (size(BootCommon::target_map) < 1)
+ || RebuildMapAllPartitions())
{
// save last change time from storage for MapAllPartitions()
saved_last_change_time_from_storage = Storage::GetTargetChangeTime();
@@ -606,11 +724,24 @@
{
foreach (map p, (list<map>)(v["partitions"]:[]),
{
+ // bnc#687878 - mountby uuid not respected in menu.lst
+ // if there is "not created" partition and flag for "it" is not set
+ if ((p["create"]:nil == true) && (Mode::installation()))
+ {
+ if (BootCommon::proposed_partition == "")
+ BootCommon::proposed_partition = p["device"]:"";
+ BootCommon::all_partitions_created = 1;
+ }
all_partitions[p["device"]:""] = p;
});
});
ret = true;
}
+ if (Mode::installation() && BootCommon::all_partitions_created == 2)
+ {
+ BootCommon::all_partitions_created = 0;
+ y2milestone("set status for all_partitions to \"created\"");
+ }
return ret;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org