[yast-commit] r57240 - in /branches/tmp/SLE-11-SP1-Stash/bootloader: package/yast2-bootloader.changes src/clients/bootloader_proposal.ycp src/grub/misc.ycp src/modules/BootGRUB.ycp src/modules/BootSupportCheck.ycp

Author: juhliarik Date: Mon May 18 17:27:57 2009 New Revision: 57240 URL: http://svn.opensuse.org/viewcvs/yast?rev=57240&view=rev Log: added 3 fixes for soft-raids Modified: branches/tmp/SLE-11-SP1-Stash/bootloader/package/yast2-bootloader.changes branches/tmp/SLE-11-SP1-Stash/bootloader/src/clients/bootloader_proposal.ycp branches/tmp/SLE-11-SP1-Stash/bootloader/src/grub/misc.ycp branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootGRUB.ycp branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootSupportCheck.ycp Modified: branches/tmp/SLE-11-SP1-Stash/bootloader/package/yast2-bootloader.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/SLE-11-SP1-Stash/bootloade... ============================================================================== --- branches/tmp/SLE-11-SP1-Stash/bootloader/package/yast2-bootloader.changes (original) +++ branches/tmp/SLE-11-SP1-Stash/bootloader/package/yast2-bootloader.changes Mon May 18 17:27:57 2009 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Mon May 18 17:26:50 CEST 2009 - juhliarik@suse.cz + +- added fix for checking soft-raid devices in device.map + (bnc#494630) +- added fix for changing device map in y2-bootloader (bnc#497944) +- added warning message if there is not valid configuration for + soft-raid (bnc#501043) + +------------------------------------------------------------------- Thu Apr 16 15:19:37 CEST 2009 - juhliarik@suse.cz - added fix for commandline interface (bnc#479069) Modified: branches/tmp/SLE-11-SP1-Stash/bootloader/src/clients/bootloader_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/SLE-11-SP1-Stash/bootloade... ============================================================================== --- branches/tmp/SLE-11-SP1-Stash/bootloader/src/clients/bootloader_proposal.ycp (original) +++ branches/tmp/SLE-11-SP1-Stash/bootloader/src/clients/bootloader_proposal.ycp Mon May 18 17:27:57 2009 @@ -119,7 +119,6 @@ The range is limited by BIOS to the first 8 devices."), ] ); - return ret; } Modified: branches/tmp/SLE-11-SP1-Stash/bootloader/src/grub/misc.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/SLE-11-SP1-Stash/bootloade... ============================================================================== --- branches/tmp/SLE-11-SP1-Stash/bootloader/src/grub/misc.ycp (original) +++ branches/tmp/SLE-11-SP1-Stash/bootloader/src/grub/misc.ycp Mon May 18 17:27:57 2009 @@ -185,9 +185,24 @@ list<list<string> > underlying_devs = []; list<string> devs = []; + list<string> boot_devices = []; + + // bnc#494630 - add also boot partitions from soft-raids + string boot_device = BootCommon::getBootPartition(); + if (substring (boot_device, 0, 7) == "/dev/md") + { + boot_devices = add(boot_devices, boot_device); + foreach (string dev, BootCommon::GetBootloaderDevices(), { + boot_devices = add(boot_devices, dev); + }); + } else { + + boot_devices = BootCommon::GetBootloaderDevices(); + } + // get a list of all bootloader devices or their underlying soft-RAID // devices, if necessary - underlying_devs = maplist (string dev, BootCommon::GetBootloaderDevices(), { + underlying_devs = maplist (string dev, boot_devices, { md = BootCommon::Md2Partitions(dev); if ( size(md) > 0 ) { devs = maplist (string k, integer v, md, ``(k)); @@ -1203,6 +1218,7 @@ { boolean result = false; + if (size(BootCommon::device_mapping)>8) { result = false; @@ -1242,7 +1258,7 @@ } }); } else { - y2milestone("Device map includes less than 9 devices."); + y2milestone("Device map includes less than 9 devices."); } return result; } Modified: branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootGRUB.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/SLE-11-SP1-Stash/bootloade... ============================================================================== --- branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootGRUB.ycp (original) +++ branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootGRUB.ycp Mon May 18 17:27:57 2009 @@ -865,14 +865,75 @@ ]; } +/** bnc#494630 GRUB configuration in installation workflow fail with more than 8 disks on software raid + * Return all disks for checking in device map + * + * @param string boot disk + * @return list<string> disk devices + */ +list <string> ReturnAllDisks(string boot_disk) +{ + list <string> ret = []; + map tm = Storage::GetTargetMap (); + map b_disk = tm[boot_disk]:$[]; + if (b_disk["type"]:nil == `CT_MD) + { + string boot_partition = BootCommon::getBootPartition(); + list b_disk_partitions = b_disk["partitions"]:[]; + foreach (map p, (list<map>)b_disk_partitions, + { + if (p["device"]:"" == boot_partition) + { + if ((size(p["devices"]:[]) > 0) && (p["type"]:nil == `sw_raid)) + { + foreach(string dev, p["devices"]:[], + { + map p_dev = Storage::GetDiskPartition (dev); + string disk_dev = p_dev["disk"]:""; + if (disk_dev != "") + ret = add(ret, disk_dev); + else + y2error("Real disk was not found for device: %1", dev); + }); + } else { + if (p["type"]:nil == `sw_raid) + y2error("soft raid partition: %1 doesn't include any devices: %2", + boot_partition, p["devices"]:[]); + else + y2error("Disk is not soft-raid %1", b_disk); + ret = add(ret, boot_disk); + + } + } + }); + } else { + y2milestone("Boot disk is not on MD-RAID"); + ret = add(ret, boot_disk); + } + y2milestone("Devices for checking if they are in device map: %1", ret); + return ret; +} + +/** bnc#494630 GRUB configuration in installation workflow fail with more than 8 disks on software raid + * Function check if boot disk is in device map + * + * @return boolean true if boot device is not in device map + */ global boolean CheckDeviceMap() { // FATE #303548 - Grub: limit device.map to devices detected by BIOS boolean ret = false; string boot_disk = BootCommon::getBootDisk(); - if (boot_disk != "") - ret = checkBootDeviceInDeviceMap(boot_disk, BootCommon::Dev2MountByDev(boot_disk)); + list <string> disks = ReturnAllDisks(boot_disk); + if (size(disks) > 0) + { + foreach(string disk, disks, + { + ret = ret || checkBootDeviceInDeviceMap(disk, BootCommon::Dev2MountByDev(disk)); + }); + + } return ret; Modified: branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootSupportCheck.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/SLE-11-SP1-Stash/bootloade... ============================================================================== --- branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootSupportCheck.ycp (original) +++ branches/tmp/SLE-11-SP1-Stash/bootloader/src/modules/BootSupportCheck.ycp Mon May 18 17:27:57 2009 @@ -170,58 +170,76 @@ global boolean check_BootDevice() { - boolean result = true; - string boot_device = ""; + boolean result = true; + string boot_device = ""; - map<string,map> devices = (map<string,map>)Storage::GetTargetMap(); + map<string,map> devices = (map<string,map>)Storage::GetTargetMap(); - boot_device = BootCommon::getBootPartition(); + boot_device = BootCommon::getBootPartition(); - // if (BootCommon::BootPartitionDevice == BootCommon::RootPartitionDevice) - // AddNewProblem (_("Doesn't exist separete /boot partition")); + // if (BootCommon::BootPartitionDevice == BootCommon::RootPartitionDevice) + // AddNewProblem (_("Doesn't exist separete /boot partition")); - boolean found_boot = false; - // check if boot device is on raid0 - if (boot_device != "") + boolean found_boot = false; + // check if boot device is on raid0 + if (boot_device != "") + { + foreach (string k, map v, devices, { - foreach (string k, map v, devices, + foreach (map p, (list<map>)(v["partitions"]:[]), + { + if (p["device"]:"" == boot_device) { - foreach (map p, (list<map>)(v["partitions"]:[]), + if ((p["raid_type"]:"" != "raid1") && (p["type"]:nil ==`sw_raid)) + { + AddNewProblem (sformat(_("The boot device is on raid type: %1. System will not boot."), + p["raid_type"]:"")); + y2error("The boot device: %1 is on raid type: %2", boot_device, p["raid_type"]:""); + result = false; + break; + } else { + // bnc#501043 added check for valid configuration + if ((p["raid_type"]:"" == "raid1") && (p["type"]:nil ==`sw_raid)) { - if (p["device"]:"" == boot_device) - { - if ((p["raid_type"]:"" != "raid1") && (p["type"]:nil ==`sw_raid)) - { - AddNewProblem (sformat(_("The boot device is on raid type: %1. System will not boot."), p["raid_type"]:"")); - y2error("The boot device: %1 is on raid type: %2", boot_device, p["raid_type"]:""); - result = false; - break; - } else { - found_boot = true; - y2milestone("The boot device: %1 is on raid: %2", boot_device, p["raid_type"]:""); - //break; - } - - // check if /boot directory is on supported filesystem - if (p["used_fs"]:nil == `xfs) { - AddNewProblem (_("The /boot directory is on an XFS filesystem. System will not boot.")); - y2error ("The /boot directory is on an XFS filesystem"); - result = false; - break; - } else { - found_boot = true; - y2milestone ("/boot filesystem is OK"); - break; - } - - } - }); - if ((!result) || (found_boot)) - break; - }); - } - return result; + if ((tolower(p["fstype"]:"") == "md raid") && + (BootCommon::globals["boot_mbr"]:"false" != "true")) + { + result = false; + AddNewProblem (_("The boot device is on software RAID1. Select other bootloader location, e.g. Master Boot Record")); + y2error("Booting from soft-raid: %1 and bootloader setting are not valid: %2", + p, BootCommon::globals); + } else { + found_boot = true; + y2milestone("Valid configuration for soft-raid"); + } + + } else { + found_boot = true; + y2milestone("The boot device: %1 is on raid: %2", boot_device, p["raid_type"]:""); + } + } + + // check if /boot directory is on supported filesystem + if (p["used_fs"]:nil == `xfs) + { + AddNewProblem (_("The /boot directory is on an XFS filesystem. System will not boot.")); + y2error ("The /boot directory is on an XFS filesystem"); + result = false; + break; + } else { + found_boot = true; + y2milestone ("/boot filesystem is OK"); + break; + } + + } + }); + if ((!result) || (found_boot)) + break; + }); + } + return result; } /** -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
juhliarik@svn.opensuse.org