From e6f04ab5542cd5ad05f8153aac3eaf59edefbcc6 Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 4 Oct 1999 16:34:35 +0000 Subject: Use start sector to find out in which partition if any is MBR located in. --- silo.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'silo.py') diff --git a/silo.py b/silo.py index 43812bbf2..c9b912ab1 100644 --- a/silo.py +++ b/silo.py @@ -88,7 +88,7 @@ class SiloInstall: todo.liloImages = {} nSolaris = 0 nSunOS = 0 - for (dev, devName, type) in drives: + for (dev, devName, type, start, size) in drives: # ext2 partitions get listed if # 1) they're / # 2) they're not mounted @@ -139,6 +139,27 @@ class SiloInstall: return (bootpart, boothd) + def getSiloMbrDefault(self): + # Check partition at cylinder 0 on the boot disk + # is /, /boot or Linux swap + (bootpart, boothd) = self.getSiloOptions() + (drives, raid) = self.todo.ddruid.partitionList() + for (dev, devName, type, start, size) in drives: + i = len (dev) - 1 + while i > 0 and dev[i] in string.digits: + i = i - 1 + devhd = dev[:i+1] + if devhd == boothd and start == 0: + if type == 5: + return "mbr'" + elif type == 2: + if dev == bootpart: + return "mbr" + elif dev == self.todo.mounts['/'][0]: + return "mbr" + return "partition" + return "partition" + def hasUsableFloppy(self): try: f = open("/proc/devices", "r") -- cgit