def getPlatform(anaconda): """Check the architecture of the system and return an instance of a Platform subclass to match. If the architecture could not be determined, raise an exception.""" if iutil.isAlpha(): return Alpha(anaconda) elif iutil.isIA64(): return IA64(anaconda) elif iutil.isPPC(): ppcMachine = iutil.getPPCMachine() if (ppcMachine == "PMac" and iutil.getPPCMacGen() == "NewWorld"): return NewWorldPPC(anaconda) elif ppcMachine in ["iSeries", "pSeries"]: return IPSeriesPPC(anaconda) elif ppcMachine == "PS3": return PS3(anaconda) else: raise SystemError, "Unsupported PPC machine type" elif iutil.isS390(): return S390(anaconda) elif iutil.isSparc(): return Sparc(anaconda) elif iutil.isX86(): return X86(anaconda) else: raise SystemError, "Could not determine system architecture."
def getBootloader(anaconda): """Get the bootloader info object for your architecture""" if iutil.isX86(): import x86 return x86.x86BootloaderInfo(anaconda) elif iutil.isIA64(): import ia64 return ia64.ia64BootloaderInfo(anaconda) elif iutil.isS390(): import s390 return s390.s390BootloaderInfo(anaconda) elif iutil.isAlpha(): import alpha return alpha.alphaBootloaderInfo(anaconda) elif iutil.isPPC(): import ppc return ppc.ppcBootloaderInfo(anaconda) elif iutil.isSparc(): import sparc return sparc.sparcBootloaderInfo(anaconda) else: return bootloaderInfo(anaconda)
def driveDict(klassArg): import parted global cachedDrives if cachedDrives is None: new = {} for dev in minihal.get_devices_by_type("storage"): if dev["device"] is None: # none devices make no sense continue device = dev["device"].replace("/dev/", "") # we can't actually use the sg devices, so ignore them if device.startswith("sg"): log.info("ignoring sg device %s" % (device,)) continue # we can't actually use the st devices, so ignore them if device.startswith("st"): log.info("ignoring st device %s" % (device,)) continue # we want to ignore md devices as they're not hard disks in our pov if device.startswith("md"): continue if dev["storage.drive_type"] != "disk": new[device] = dev continue try: if not mediaPresent(device): new[device] = dev continue # blacklist the device which the live image is running from # installing over that is almost certainly the wrong # thing to do. if os.path.exists("/dev/live") and stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]): livetarget = os.path.realpath("/dev/live") if livetarget.startswith(dev["device"]): log.info("%s looks to be the live device; ignoring" % (device,)) continue if device.startswith("sd"): peddev = parted.PedDevice.get(dev["device"]) model = peddev.model # blacklist *STMF on power5 iSeries boxes if iutil.isPPC() and model.find("IBM *STMF KERNEL") != -1: log.info("%s looks like STMF, ignoring" % (device,)) del peddev continue # blacklist PS3 flash if iutil.isPPC() and model.find("SCEI Flash-5") != -1: log.info("%s looks like PS3 flash, ignoring" % (device,)) del peddev continue # blacklist DGC/EMC LUNs for which we have no ACL. # We should be ignoring LUN_Z for all vendors, but I # don't know how (if) other vendors encode this into # the model info. # # XXX I need to work some SCC2 LUN mode page detection # into libbdevid, and then this should use that instead. # -- pjones if str(peddev.model) == "DGC LUNZ": log.info("%s looks like a LUN_Z device, ignoring" % (device,)) del peddev continue del peddev new[device] = dev except Exception, e: log.debug("exception checking disk blacklist on %s: %s" % (device, e)) cachedDrives = new