Mailinglist Archive: yast-commit (953 mails)

< Previous Next >
[yast-commit] r49630 - in /trunk/bootloader: VERSION package/yast2-bootloader.changes src/grub/misc.ycp src/modules/BootGRUB.ycp
  • From: juhliarik@xxxxxxxxxxxxxxxx
  • Date: Mon, 04 Aug 2008 11:34:56 -0000
  • Message-id: <20080804113456.7E9A731C87@xxxxxxxxxxxxxxxx>
Author: juhliarik
Date: Mon Aug 4 13:34:56 2008
New Revision: 49630

URL: http://svn.opensuse.org/viewcvs/yast?rev=49630&view=rev
Log:
- new version 2.17.8
- added support for reducing devices from device.map (fate #303548)
- correct typo checkWidnowsSection() -> checkWindowsSection

M bootloader/src/grub/misc.ycp
M bootloader/src/modules/BootGRUB.ycp
* added support for deleting devices from device.map (devices > 8)

Modified:
trunk/bootloader/VERSION
trunk/bootloader/package/yast2-bootloader.changes
trunk/bootloader/src/grub/misc.ycp
trunk/bootloader/src/modules/BootGRUB.ycp

Modified: trunk/bootloader/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/VERSION?rev=49630&r1=49629&r2=49630&view=diff
==============================================================================
--- trunk/bootloader/VERSION (original)
+++ trunk/bootloader/VERSION Mon Aug 4 13:34:56 2008
@@ -1 +1 @@
-2.17.7
+2.17.8

Modified: trunk/bootloader/package/yast2-bootloader.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/package/yast2-bootloader.changes?rev=49630&r1=49629&r2=49630&view=diff
==============================================================================
--- trunk/bootloader/package/yast2-bootloader.changes (original)
+++ trunk/bootloader/package/yast2-bootloader.changes Mon Aug 4 13:34:56 2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Aug 4 13:29:01 CEST 2008 - juhliarik@xxxxxxx
+
+- added support for reducing devices from device.map to 8 devices
+ (fate #303548)
+- 2.17.8
+
+-------------------------------------------------------------------
Thu Jul 31 10:27:42 CEST 2008 - juhliarik@xxxxxxx

- added support for remaping windows chainloader boot section

Modified: trunk/bootloader/src/grub/misc.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/grub/misc.ycp?rev=49630&r1=49629&r2=49630&view=diff
==============================================================================
--- trunk/bootloader/src/grub/misc.ycp (original)
+++ trunk/bootloader/src/grub/misc.ycp Mon Aug 4 13:34:56 2008
@@ -1080,7 +1080,7 @@
* @return list of sections
*/

-define list<map<string,any> > checkWidnowsSection(list<map<string,any> >
sections)
+define list<map<string,any> > checkWindowsSection(list<map<string,any> >
sections)
{

// list of idexes from sections where is chainloader
@@ -1118,13 +1118,11 @@

/**
* FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
- * The function reduce record (devices) in device.map
+ * The function reduces records (devices) in device.map
* Grub doesn't support more than 8 devices in device.map
- * There is selected the first 7 devices + boot or root device
- * @param string boot device with udev id name
- * @return boolean true if there was added boot device (disk) and it the 9th
or following disk in order
+ * @return boolean true if device map was reduced
*/
-global boolean ReduceDeviceMapTo8(string boot_dev, string boot_dev_mountby)
+global boolean ReduceDeviceMapTo8()
{
boolean result = false;

@@ -1146,42 +1144,88 @@

y2debug("inverse_device_map: %1", inverse_device_map);
integer index = 0;
- boolean boot_device_added = false;
+
foreach(string key, bios_order,
{
string device_name = inverse_device_map[key]:"";
+
if (index < 8)
{
y2debug("adding device: %1 with key: %2 and index is: %3",
device_name, key, index);
new_device_map[device_name]=key;
+ index = index + 1;
+ } else {
+ break;
+ }
+ });
+ BootCommon::device_mapping = new_device_map;
+ y2milestone("Device map after reducing: %1",
BootCommon::device_mapping);
+ } else {
+ y2milestone("Device map includes less than 9 devices. It is not
reduced. device_map: %1", BootCommon::device_mapping);
+ }
+ return result;
+}
+
+
+/**
+ * FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
+ * The function check if boot device is in device.map
+ * Grub doesn't support more than 8 devices in device.map
+ * @param string boot device
+ * @param string boot device with name by mountby
+ * @return boolean true if there is missing boot device
+ */
+define boolean checkBootDeviceInDeviceMap(string boot_dev, string
boot_dev_mountby)
+{
+ boolean result = false;
+
+ if (size(BootCommon::device_mapping)>8)
+ {
+ result = false;
+ list <string> bios_order = (list <string> )
Map::Values(BootCommon::device_mapping);
+ //delete all grub devices with order more than 9
+ bios_order = filter(string key, bios_order, {return (size(key) < 4);});
+ bios_order = lsort(bios_order);
+ y2debug("ordered values (grub devices): %1", bios_order);
+ map<string,string> inverse_device_map = $[];
+ foreach(string key, string value, BootCommon::device_mapping,
+ {
+ inverse_device_map[value]=key;
+ });
+
+ y2debug("inverse_device_map: %1", inverse_device_map);
+ integer index = 0;
+ boolean boot_device_added = false;
+ foreach(string key, bios_order,
+ {
+ string device_name = inverse_device_map[key]:"";
+
+ if (index < 8)
+ {
if ((device_name == boot_dev) || (device_name ==
boot_dev_mountby))
boot_device_added = true;
index = index + 1;
} else {
if (boot_device_added)
{
- //new_device_map[device_name]=key;
-
y2milestone("Device map includes boot disk");
break;
} else {
-
y2error("Device map doesn't include boot disk");
result = true;
break;
-
}
}
});
- BootCommon::device_mapping = new_device_map;
- y2milestone("Device map with the first 7 device + boot device: %1",
BootCommon::device_mapping);
} else {
- y2milestone("Device map includes less than 9 devices. It is not
reduced. device_map: %1", BootCommon::device_mapping);
+ y2milestone("Device map includes less than 9 devices.");
}
return result;
}


+
+
} //last "}"

/*

Modified: trunk/bootloader/src/modules/BootGRUB.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootGRUB.ycp?rev=49630&r1=49629&r2=49630&view=diff
==============================================================================
--- trunk/bootloader/src/modules/BootGRUB.ycp (original)
+++ trunk/bootloader/src/modules/BootGRUB.ycp Mon Aug 4 13:34:56 2008
@@ -626,7 +626,11 @@
{
// check if windows is on second disk and add remap if it is necessary
// FATE #301994: Correct device mapping in case windows is installed on
the second HD
- BootCommon::sections = checkWidnowsSection(BootCommon::sections);
+ BootCommon::sections = checkWindowsSection(BootCommon::sections);
+
+ // reduce device map to 8 devices
+ // FATE #303548 - Grub: limit device.map to devices detected by BIOS Int 13
+ ReduceDeviceMapTo8();

// now really save the settings
boolean ret = BootCommon::Save (clean, init, flush);
@@ -849,8 +853,10 @@
global boolean CheckDeviceMap()
{
// FATE #303548 - Grub: limit device.map to devices detected by BIOS
+ boolean ret = false;
string boot_disk = BootCommon::getBootDisk();
- boolean ret = ReduceDeviceMapTo8(boot_disk,
BootCommon::DevToLabelUdevID(boot_disk));
+ if (boot_disk != "")
+ ret = checkBootDeviceInDeviceMap(boot_disk,
BootCommon::DevToLabelUdevID(boot_disk));

return ret;


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages