diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-01-09 01:11:20 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-01-09 01:11:20 +0000 |
commit | 072ea1346b0510302ceb5cedf9a39d18d079c4ca (patch) | |
tree | 3ef6d258247198f788c5b1d0a34f55ee9be42639 /partedUtils.py | |
parent | 5ddca7b335478a76efa853b2585ac707f92317ec (diff) | |
download | anaconda-072ea1346b0510302ceb5cedf9a39d18d079c4ca.tar.gz anaconda-072ea1346b0510302ceb5cedf9a39d18d079c4ca.tar.xz anaconda-072ea1346b0510302ceb5cedf9a39d18d079c4ca.zip |
1) handle an empty /etc/redhat-release
2) make it so you have to boot with 'linux upgradeany' to use any random linux
partition that has a fstab
Diffstat (limited to 'partedUtils.py')
-rw-r--r-- | partedUtils.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/partedUtils.py b/partedUtils.py index 13678a127..10df57f7e 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -340,6 +340,8 @@ def getRedHatReleaseString(mountpoint): lines = f.readlines() f.close() # return the first line with the newline at the end stripped + if len(lines) == 0: + return "" relstr = string.strip(lines[0][:-1]) # clean it up some @@ -350,14 +352,14 @@ def getRedHatReleaseString(mountpoint): # # - if relstr[:13] == 'Red Hat Linux': + if relstr.startswith(productName): try: # look for version string vers = string.split(relstr[14:])[1] for a in string.split(vers, '.'): anum = string.atof(a) - relstr = "Red Hat Linux " + vers + relstr = productName + " " + vers except: # didnt pass test dont change relstr pass @@ -500,8 +502,13 @@ class DiskSet: part = disk.next_partition(part) continue if os.access (mountpoint + '/etc/fstab', os.R_OK): - rootparts.append ((node, part.fs_type.name, - getRedHatReleaseString(mountpoint))) + relstr = getRedHatReleaseString(mountpoint) + cmdline = open('/proc/cmdline', 'r').read() + + if (relstr.startswith(productName) or + cmdline.find("upgradeany") != -1): + rootparts.append ((node, part.fs_type.name, + relstr)) isys.umount(mountpoint) part = disk.next_partition(part) |