[yast-commit] r56993 - in /trunk/reipl: VERSION package/yast2-reipl.changes src/Reipl.ycp

Author: jsrain Date: Mon Apr 27 15:29:41 2009 New Revision: 56993 URL: http://svn.opensuse.org/viewcvs/yast?rev=56993&view=rev Log: fixed handling of more than 26 disks (bnc #492326) Modified: trunk/reipl/VERSION trunk/reipl/package/yast2-reipl.changes trunk/reipl/src/Reipl.ycp Modified: trunk/reipl/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/VERSION?rev=56993&r1=56... ============================================================================== --- trunk/reipl/VERSION (original) +++ trunk/reipl/VERSION Mon Apr 27 15:29:41 2009 @@ -1 +1 @@ -2.17.3 +2.18.0 Modified: trunk/reipl/package/yast2-reipl.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/package/yast2-reipl.changes... ============================================================================== --- trunk/reipl/package/yast2-reipl.changes (original) +++ trunk/reipl/package/yast2-reipl.changes Mon Apr 27 15:29:41 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Apr 20 12:01:39 CEST 2009 - jsrain@suse.cz + +- fixed handling of more than 26 disks (bnc #492326) +- 2.18.0 + +------------------------------------------------------------------- Mon Feb 9 09:38:05 CET 2009 - hare@suse.de - Final fix for reboot (bnc#471522) Modified: trunk/reipl/src/Reipl.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/reipl/src/Reipl.ycp?rev=56993&... ============================================================================== --- trunk/reipl/src/Reipl.ycp (original) +++ trunk/reipl/src/Reipl.ycp Mon Apr 27 15:29:41 2009 @@ -246,19 +246,24 @@ if (substring (fullDisk, 0, 4) == "dasd") { - string disk = substring (fullDisk, 0, 5); /* broken with more than 26 DASD devices */ - /* - fullDisk contains a device name either starting with "dasd" or with "sd". - I suppose it might be a full block device or just a partition on such a - block device. If it is a partition we have to get rid of the suffix - specifying the partition in order to get the containing block device. - We need something regex-like to get rid of the suffix. - This would work even if we have thousands - of block devices, which is not uncommon on s390. In such a case the - devices would have names such as "dasdaab" or "dasdaab1" and taking the - first five characters would no longer work. Analogous thing applies for - SCSI devices in the FCP case. - */ + string disk = nil; + /* + fullDisk might be a full block device or just a partition on such a + block device. If it is a partition we have to get rid of the suffix + specifying the partition in order to get the containing block device. + This device could have thousands of block devices, which is not uncommon + on s390. In such a case the devices would have names such as "dasdaab" or + "dasdaab1." + */ + list<string> split = regexptokenize (fullDisk, "^(dasd)([a-z]*)([0-9]*)$"); + + if (split == nil || size (split) != 3) { + y2error ("FindBootPartition: Could not regexptokenize fullDisk, split = %1", split); + + fError = true; + } else { + disk = split[0]:"" + split[1]:""; + } y2milestone ("FindBootPartition: found that the MBR uses dasd (%1)", disk); @@ -298,18 +303,23 @@ } else if (substring (fullDisk, 0, 2) == "sd") { - // Handle sdb or sdb4 string disk = nil; + /* + fullDisk might be a full block device or just a partition on such a + block device. If it is a partition we have to get rid of the suffix + specifying the partition in order to get the containing block device. + This device could have thousands of block devices, which is not uncommon + on s390. In such a case the devices would have names such as "sdaab" or + "sdaab1." + */ + list<string> split = regexptokenize (fullDisk, "^(sd)([a-z]*)([0-9]*)$"); + + if (split == nil || size (split) != 3) { + y2error ("FindBootPartition: Could not regexptokenize fullDisk, split = %1", split); - // /dev/sda - if (size (fullDisk) == 3) { - disk = fullDisk; - } - else if (size (fullDisk) == 4) { - disk = substring (fullDisk, 0, 3); /* broken with more than 26 SCSI disk devices */ - } - else { fError = true; + } else { + disk = split[0]:"" + split[1]:""; } y2milestone ("FindBootPartition: found that the MBR uses SCSI (%1)", disk); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsrain@svn.opensuse.org