Author: snwint Date: Fri Nov 4 17:13:03 2011 New Revision: 66707 URL: http://svn.opensuse.org/viewcvs/yast?rev=66707&view=rev Log: - fix activating partition on raid setups (bnc #715436) - 2.17.81 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/grub/misc.ycp branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lilolike.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=66707&r1=66706&r2=66707&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/VERSION Fri Nov 4 17:13:03 2011 @@ -1 +1 @@ -2.17.80 +2.17.81 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=66707&r1=66706&r2=66707&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 Fri Nov 4 17:13:03 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Oct 17 14:57:39 CEST 2011 - snwint@suse.de + +- fix activating partition on raid setups (bnc #715436) +- 2.17.81 + +------------------------------------------------------------------- Wed Sep 21 11:35:04 CEST 2011 - snwint@suse.de - enable resume for s390x (bnc #692606) Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/grub/misc.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/src/grub/misc.ycp?rev=66707&r1=66706&r2=66707&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/src/grub/misc.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/grub/misc.ycp Fri Nov 4 17:13:03 2011 @@ -73,6 +73,9 @@ integer num = BootCommon::myToInteger( p_dev["nr"]:nil ); string mbr_dev = p_dev["disk"]:""; + y2milestone("getPartitionToActivate(%1): mbr_dev = %2, num = %3", loader_device, mbr_dev, num); + y2milestone("getPartitionToActivate: p_dev = %1", p_dev); + // If loader_device is /dev/md* (which means bootloader is installed to // /dev/md*), return the info map for the first device in BIOS ID order // that underlies the soft-RAID and that has a BIOS ID (devices without @@ -101,6 +104,7 @@ map p_dev = Storage::GetDiskPartition (device); num = BootCommon::myToInteger( p_dev["nr"]:nil ); mbr_dev = p_dev["disk"]:""; + y2milestone("getPartitionToActivate: raid setup: mbr_dev = %1, num = %2", mbr_dev, num); } } // If loader_device is a disk device ("/dev/sda"), that means that we @@ -145,29 +149,33 @@ // (bnc # 337742) - Unable to boot the openSUSE (32 and 64 bits) after installation // if loader_device is disk device activate BootCommon::BootPartitionDevice // - only if boot partition is on mbr device + // - watch out for raid setups: mbr_dev != loader_device if (num == 0) { p_dev = Storage::GetDiskPartition (BootCommon::BootPartitionDevice); string p_disk = p_dev["disk"]:""; integer p_num = BootCommon::myToInteger( p_dev["nr"]:nil ); - y2milestone ("loader_device is disk device: mbr = %1, dev = %2, num = %3, activate = %4", - mbr_dev, p_disk, p_num, p_disk == mbr_dev - ); + boolean activate = p_disk == mbr_dev || p_disk == loader_device; + // as it's not really possible to say 'no', we return num = 0 which will // eventually result in not activating the partition - dead ugly, I know - if (p_disk == mbr_dev) { num = p_num; } + if (activate) { num = p_num; } + + y2milestone ("getPartitionToActivate: mbr_dev = %1, disk = %2, num = %3, p_num = %4, activate = %5", + mbr_dev, p_disk, num, p_num, activate + ); } if (num > 4) { - y2milestone ("Bootloader partition type is logical"); + y2milestone ("getPartitionToActivate: logical partition"); map tm = Storage::GetTargetMap (); list<map> partitions = tm[mbr_dev, "partitions"]:[]; foreach (map p, partitions, ``{ if (p["type"]:nil == `extended) { num = p["nr"]:num; - y2milestone ("Using extended partition %1 instead",num); + y2milestone ("getPartitionToActivate: using extended partition %1", num); } }); } @@ -178,7 +186,8 @@ "dev" : Storage::GetDeviceName (mbr_dev, num), ]; - y2milestone("Partition for activating: %1", ret); + y2milestone("getPartitionToActivate: activating partition: %1", ret); + return ret; } Modified: branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lilolike.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lilolike.ycp?rev=66707&r1=66706&r2=66707&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lilolike.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/bootloader/src/routines/lilolike.ycp Fri Nov 4 17:13:03 2011 @@ -110,19 +110,21 @@ * @return string mbr device */ global string FindMBRDisk() { + y2milestone("FindMBRDisk: current MBR = %1", BootCommon::mbrDisk); + // check the disks order, first has MBR list<string> order = DisksOrder (); if (size (order) > 0) { string ret = order[0]:""; - y2milestone ("First disk in the order: %1, using for MBR", ret); + y2milestone ("FindMBRDisk: using first disk, new MBR = %1", ret); return ret; } // OK, order empty, use the disk with boot partition map mp = Storage::GetMountPoints(); string boot_disk = mp["/boot",2]:(mp["/",2]:""); - y2milestone ("Disk with boot partition: %1, using for MBR", boot_disk); + y2milestone ("FindMBRDisk: using disk with /boot, new MBR = %1", boot_disk); return boot_disk; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org