Author: juhliarik
Date: Wed Feb 4 12:19:32 2009
New Revision: 55225
URL: http://svn.opensuse.org/viewcvs/yast?rev=55225&view=rev
Log:
synchronize with branch Code11 and added fix for finding the smallest
(boot) partition for pmac
Modified:
trunk/bootloader/package/yast2-bootloader.changes
trunk/bootloader/src/generic/sections_widget.ycp
trunk/bootloader/src/modules/BootCommon.ycp
trunk/bootloader/src/modules/BootELILO.ycp
trunk/bootloader/src/modules/BootPOWERLILO.ycp
trunk/bootloader/src/routines/misc.ycp
Modified: trunk/bootloader/package/yast2-bootloader.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloader.changes?rev=55225&r1=55224&r2=55225&view=diff
==============================================================================
--- trunk/bootloader/package/yast2-bootloader.changes (original)
+++ trunk/bootloader/package/yast2-bootloader.changes Wed Feb 4 12:19:32 2009
@@ -1,4 +1,18 @@
-------------------------------------------------------------------
+Wed Feb 4 12:15:21 CET 2008 - juhliarik@suse.cz
+
+- added fix for finding the smallest partition on pmac machine
+ (bnc #459860)
+- updated function Dev2MountByDev() which can run long time if
+ machine included huge number of disks (bnc #468922)
+- added fix for problem with adding boot entry to EFI if
+ installation run on different disk but with same boot partition
+ (bnc #450682)
+- added fix for using translated text in bootloader e.g. Image,
+ Other (bug #445999)
+- 2.18.0
+
+-------------------------------------------------------------------
Tue Jan 20 14:11:38 CET 2009 - juhliarik@suse.cz
- added fix for problem with calling parted each time when
Modified: trunk/bootloader/src/generic/sections_widget.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/generic/sections_widget.ycp?rev=55225&r1=55224&r2=55225&view=diff
==============================================================================
--- trunk/bootloader/src/generic/sections_widget.ycp (original)
+++ trunk/bootloader/src/generic/sections_widget.ycp Wed Feb 4 12:19:32 2009
@@ -81,13 +81,13 @@
),
", "
);
- // Upcase word 'type'
- type = toupper(substring(type,0,1)) + substring(type,1);
return `item (`id (name),
BootCommon::globals["default"]:"" == name ? UI::Glyph (`CheckMark) : "",
name,
- type,
+ (type == "image")
+ ? _("Image")
+ : _("Other"),
summary
);
});
Modified: trunk/bootloader/src/modules/BootCommon.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootCommon.ycp?rev=55225&r1=55224&r2=55225&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootCommon.ycp (original)
+++ trunk/bootloader/src/modules/BootCommon.ycp Wed Feb 4 12:19:32 2009
@@ -56,6 +56,14 @@
*/
global map exports = $[];
+
+/**
+ * boolean value indicate if "/" is on logical
+ * and primary /boot doesn't exist
+ */
+
+global boolean boot_device_on_logical = false;
+
/**
* map of global options and values
*/
@@ -73,6 +81,14 @@
global integer cached_settings_base_data_change_time = nil;
/**
+ * Saved change time from target map - only for MapAllPartitions()
+ */
+
+global integer saved_last_change_time_from_storage = nil;
+
+
+
+/**
* device mapping between Linux and firmware
*/
global map device_mapping = $[];
@@ -363,6 +379,20 @@
+/**
+ * bnc #468922 - problem with longtime running the parsing a huge number of disks
+ * map the map of all partitions with info about it ->
+ * necessary for Dev2MountByDev() in routines/misc.ycp
+ */
+global map all_partitions = $[];
+
+/**
+ * bnc #468922 - problem with longtime running the parsing a huge number of disks
+ * map target map try to minimalize calling Storage::GetTargetMap()
+ *
+ */
+map target_map = $[];
+
global define string getLoaderType (boolean recheck);
global define list<string> getBootloaders ();
global define list<string> Summary ();
Modified: trunk/bootloader/src/modules/BootELILO.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootELILO.ycp?rev=55225&r1=55224&r2=55225&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootELILO.ycp (original)
+++ trunk/bootloader/src/modules/BootELILO.ycp Wed Feb 4 12:19:32 2009
@@ -65,6 +65,13 @@
string efi_vendor = "SuSE";
/**
+ * bnc #450682 - adding boot entry to EFI
+ * true is label was added
+ */
+
+global boolean added_label_to_efi = false;
+
+/**
* Is the /sys/firmware/efi directory available?
*/
boolean efi_available = true;
@@ -450,6 +457,9 @@
// error popup - label, %1 is bootloader name
_("Error Occurred while Installing %1"),
BootCommon::getLoaderName (BootCommon::getLoaderType (false), `summary)), log);
+ } else {
+ added_label_to_efi = true;
+ y2milestone("Adding label to EFI finish successful");
}
return ret;
}
@@ -566,13 +576,51 @@
return ret;
}
+/** FIXME: efibootmgr doesn't provide info about disk!
+ * bnc #450682 - adding boot entry to EFI
+ * function delete all existing boot entry with same name and partition number
+ * @param string name of label
+ * @param string number of partition
+ */
+
+void deleteSameEFIBootEntry(string name, any part_no)
+{
+ boolean still_exist = true;
+
+ string cmd = sformat("efibootmgr -v |grep \"%1.*HD(%2.*File(.\\efi.\\SuSE.\\elilo.efi)\" | cut -d \" \" -f 1",
+ name, tomyhexa(part_no));
+ y2milestone("run command %1", cmd);
+ map out = (map)SCR::Execute (.target.bash_output, cmd);
+ y2milestone("output of command %1", out);
+
+ string boot_entries = out["stdout"]:"";
+ y2milestone("EFI boot entries with \"same\" boot partition %1",boot_entries);
+
+ list<string> list_boot_entries = splitstring(boot_entries, "\n");
+
+ y2milestone("list_boot_entries=%1",list_boot_entries);
+
+ foreach(string entry, list_boot_entries,
+ {
+ if ((deletechars(entry, "\n*") != "") && (deletechars(entry, "\n*") != nil))
+ {
+ cmd = sformat("/usr/sbin/efibootmgr --delete-bootnum --bootnum %1 -q;",
+ substring (deletechars(entry, "\n*"),4, 4));
+ y2milestone("run command %1", cmd);
+ out = (map)SCR::Execute (.target.bash_output, cmd);
+ y2milestone("output of command %1", out);
+ }
+ });
+}
/**
* Write bootloader settings to disk
* @return boolean true on success
*/
global define boolean Write () {
+
+ y2milestone("run Write function from BootELILO");
// SCR::Execute (.target.bash, "/sbin/elilo");
boolean ret = BootCommon::UpdateBootloader ();
if (ret == nil)
@@ -621,10 +669,23 @@
// check number of same boot entries in efi
// if boot entry is added -> don't add it again
if (deletechars(out["stdout"]:"","\n") == "0")
+ {
ret = ret && installBootLoader (bl_command, bl_logfile);
- else
- y2milestone("Skip adding boot entry: %1 to EFI. There already exist: %2 with same label and partition.",
- BootCommon::globals["boot_efilabel"]:"", deletechars(out["stdout"]:"","\n"));
+ } else {
+
+ if (added_label_to_efi)
+ {
+ y2milestone("Skip adding boot entry: %1 to EFI. There already exist and was added: %2 with
+ same label and partition.", BootCommon::globals["boot_efilabel"]:"",
+ deletechars(out["stdout"]:"","\n"));
+ } else {
+ // delete efi entry with same label name and partition
+ deleteSameEFIBootEntry(BootCommon::globals["boot_efilabel"]:"", boot_part);
+ // add new efi boot entry
+ ret = ret && installBootLoader (bl_command, bl_logfile);
+ }
+
+ }
}
Modified: trunk/bootloader/src/modules/BootPOWERLILO.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootPOWERLILO.ycp?rev=55225&r1=55224&r2=55225&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootPOWERLILO.ycp (original)
+++ trunk/bootloader/src/modules/BootPOWERLILO.ycp Wed Feb 4 12:19:32 2009
@@ -503,15 +503,41 @@
// both partition types Apple_Bootstrap and Apple_HFS can be
// handled by PPC lilo; yast2-storage maps both to fsid 258
&& (p["fsid"]:nil == 258)
- // the partition should be smaller than 20 cylinders (PPC lilo
- // takes that size as well); estimating the kiBytes:
- // 255 heads * 63 sectors * 20 cylinders * 512 bytes / 1024 bytes =
- // 160650 kiBytes
- && (p["size_k"]:0 < 160650)
&& !contains( [`lvm, `evms, `sw_raid], p["type"]:`primary )
));
y2milestone ("Filtered existing partitions: %1", partitions);
+ // bug #459860 - no boot partition found during fresh install
+ // find the smallest partition
+ integer max_size = 1000000000;
+ integer iter = -1;
+ integer min_position = -1;
+ foreach (map p, partitions,
+ {
+ iter = iter +1;
+ if (p["size_k"]:0 < max_size)
+ {
+ min_position = iter;
+ max_size = p["size_k"]:0;
+ }
+ });
+
+ // if any partition was found
+ if (min_position > -1)
+ {
+ list <map> tmp_partitions = [];
+ map partition = partitions[min_position]:$[];
+ if (partition["size_k"]:0 < 160650)
+ y2milestone("Partition smaller than 160650k: %1", partition);
+ else
+ y2warning("Partition is not smaller than 160650k: %1", partition);
+ tmp_partitions = add(tmp_partitions, partition);
+ partitions = tmp_partitions;
+ }
+
+ y2milestone ("Filtered existing partitions: %1", partitions);
+
+
// found a boot partition on the same device as the root partition?
if (hasrootdev && size (partitions) > 0
&& selected_boot_partition == "")
Modified: trunk/bootloader/src/routines/misc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/misc.ycp?rev=55225&r1=55224&r2=55225&view=diff
==============================================================================
--- trunk/bootloader/src/routines/misc.ycp (original)
+++ trunk/bootloader/src/routines/misc.ycp Wed Feb 4 12:19:32 2009
@@ -574,6 +574,38 @@
return temp_sec;
}
+/**
+ * bnc #468922 - problem with longtime running the parsing a huge number of disks
+ * Function initialize BootCommon::all_partitions only if storage change
+ * partitioning of disk
+ * true if init all_partitions
+ */
+
+boolean MapAllPartitions()
+{
+ boolean ret = false;
+ if (saved_last_change_time_from_storage != Storage::GetTargetChangeTime())
+ {
+ // save last change time from storage for MapAllPartitions()
+ saved_last_change_time_from_storage = Storage::GetTargetChangeTime();
+
+ BootCommon::all_partitions = $[];
+ BootCommon::target_map = $[];
+ // get target map
+ BootCommon::target_map = (map)Storage::GetTargetMap();
+ // map all partitions
+ foreach (string k, map v, BootCommon::target_map,
+ {
+ foreach (map p, (list<map>)(v["partitions"]:[]),
+ {
+ all_partitions[p["device"]:""] = p;
+ });
+ });
+ ret = true;
+ }
+
+ return ret;
+}
/** FATE #302219 - Use and choose persistent device names for disk devices
* Converts a device name to the corresponding device name it should be
@@ -599,18 +631,13 @@
//by_mount = `id;
y2milestone("Default mount by is %1", by_mount);
- map devices = (map)Storage::GetTargetMap();
-
- // make a map: "/dev/hda1" -> info_map_for_this_partition
- map partitions = $[];
- foreach (string k, map v, devices,
- {
- foreach (map p, (list<map>)(v["partitions"]:[]),
- {
- partitions[p["device"]:""] = p;
- });
- });
+ // add all_partitions to partitions
+ if (MapAllPartitions())
+ y2milestone("Init BootCommon::all_partitions was done");
+ map partitions = BootCommon::all_partitions;
+ map devices = BootCommon::target_map;
+
string ret = dev;
switch(by_mount)
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org