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."
示例#2
0
def isPaeAvailable():
    global isPAE
    if isPAE is not None:
        return isPAE

    isPAE = False
    if not iutil.isX86():
        return isPAE

    try:
        f = open("/proc/iomem", "r")
        lines = f.readlines()
        for line in lines:
            if line[0].isspace():
                continue
            start = line.split(" ")[0].split("-")[0]
            start = long(start, 16)

            if start >= 0x100000000L:
                isPAE = True
                break

        f.close()
    except:
        pass

    return isPAE
示例#3
0
文件: x86.py 项目: 274914765/python
    def getBootloaderConfig(self, instRoot, bl, kernelList,
                            chainList, defaultDev):
        config = bootloaderInfo.getBootloaderConfig(self, instRoot,
                                                    bl, kernelList, chainList,
                                                    defaultDev)

        liloTarget = bl.getDevice()

        config.addEntry("boot", '/dev/' + liloTarget, replace = 0)
        config.addEntry("map", "/boot/map", replace = 0)
        config.addEntry("install", "/boot/boot.b", replace = 0)
        message = "/boot/message"

        if self.pure is not None and not self.useGrubVal:
            config.addEntry("restricted", replace = 0)
            config.addEntry("password", self.pure, replace = 0)

        if self.serial == 1:
           # grab the 0-based number of the serial console device
            unit = self.serialDevice[-1]
            # FIXME: we should probably put some options, but lilo
            # only supports up to 9600 baud so just use the defaults
            # it's better than nothing :(
            config.addEntry("serial=%s" %(unit,))
        else:
            # message screws up serial console
            if os.access(instRoot + message, os.R_OK):
                config.addEntry("message", message, replace = 0)

        if not config.testEntry('lba32'):
            if bl.above1024 and not iutil.isX86(bits=32):
                config.addEntry("lba32", replace = 0)

        return config
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."
示例#5
0
文件: x86.py 项目: icomfort/anaconda
    def getBootloaderConfig(self, instRoot, bl, kernelList, chainList,
                            defaultDev):
        config = bootloaderInfo.getBootloaderConfig(self, instRoot, bl,
                                                    kernelList, chainList,
                                                    defaultDev)

        liloTarget = bl.getDevice()

        config.addEntry("boot", '/dev/' + liloTarget, replace=0)
        config.addEntry("map", "/boot/map", replace=0)
        config.addEntry("install", "/boot/boot.b", replace=0)
        message = "/boot/message"

        if self.pure is not None and not self.useGrubVal:
            config.addEntry("restricted", replace=0)
            config.addEntry("password", self.pure, replace=0)

        if self.serial == 1:
            # grab the 0-based number of the serial console device
            unit = self.serialDevice[-1]
            # FIXME: we should probably put some options, but lilo
            # only supports up to 9600 baud so just use the defaults
            # it's better than nothing :(
            config.addEntry("serial=%s" % (unit, ))
        else:
            # message screws up serial console
            if os.access(instRoot + message, os.R_OK):
                config.addEntry("message", message, replace=0)

        if not config.testEntry('lba32'):
            if bl.above1024 and not iutil.isX86(bits=32):
                config.addEntry("lba32", replace=0)

        return config
示例#6
0
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)
示例#7
0
def setSteps(anaconda):
    dispatch = anaconda.dispatch
    dispatch.setStepList(
                "language",
                "keyboard",
                "filtertype",
                "filter",
                "storageinit",
                "findrootparts",
                "findinstall",
                "upgrademount",
                "restoretime",
                "upgrademigfind",
                "upgrademigratefs",
                "enablefilesystems",
                "upgradecontinue",
                "reposetup",
                "upgbootloader",
                "checkdeps",
                "dependencies",
                "postselection",
                "reipl",
                "install",
                "preinstallconfig",
                "installpackages",
                "postinstallconfig",
                "instbootloader",
                "dopostaction",
                "methodcomplete",
                "postscripts",
                "copylogs",
                "complete"
            )

    if not iutil.isX86():
        dispatch.skipStep("bootloader")

    if not iutil.isX86():
        dispatch.skipStep("upgbootloader")

    dispatch.skipStep("cleardiskssel", permanent=1)
示例#8
0
    def setSteps(self, anaconda):
        dispatch = anaconda.dispatch
        dispatch.setStepList(
            "language", "keyboard", "welcome", "filtertype", "filter",
            "storageinit", "findrootparts", "betanag", "installtype",
            "cleardiskssel", "parttype", "autopartitionexecute", "partition",
            "storagedone", "bootloadersetup", "bootloader", "network",
            "timezone", "accounts", "useraccounts", "reposetup", "basepkgsel",
            "tasksel", "postselection", "confirminstall", "reipl", "install",
            "enablefilesystems", "setuptime", "preinstallconfig",
            "installpackages", "postinstallconfig", "writeconfig", "firstboot",
            "instbootloader", "dopostaction", "postscripts", "writeksconfig",
            "methodcomplete", "copylogs", "setfilecon", "complete")

        if not BETANAG:
            dispatch.skipStep("betanag", permanent=1)

        if not iutil.isX86():
            dispatch.skipStep("bootloader", permanent=1)

        # allow backends to disable interactive package selection
        if not anaconda.backend.supportsPackageSelection:
            dispatch.skipStep("tasksel", skip=1, permanent=1)
            dispatch.skipStep("group-selection", skip=1, permanent=1)

        # allow install classes to turn off the upgrade
        if not self.showUpgrade or not anaconda.backend.supportsUpgrades:
            dispatch.skipStep("findrootparts", skip=1)

        # 'noupgrade' can be used on the command line to force not looking
        # for partitions to upgrade.  useful in some cases...
        if flags.cmdline.has_key("noupgrade"):
            dispatch.skipStep("findrootparts", skip=1)

        # upgrade will also always force looking for an upgrade.
        if flags.cmdline.has_key("upgrade"):
            dispatch.skipStep("findrootparts", skip=0)

        # if there's only one install class, it doesn't make much sense
        # to show it
        if len(availableClasses()) < 2:
            dispatch.skipStep("installtype", permanent=1)

        # allow interface backends to skip certain steps.
        anaconda.intf.setSteps(anaconda)
示例#9
0
def isPaeAvailable():
    global isPAE
    if isPAE is not None:
        return isPAE

    isPAE = False
    if not iutil.isX86():
        return isPAE

    f = open("/proc/cpuinfo", "r")
    lines = f.readlines()
    f.close()

    for line in lines:
        if line.startswith("flags") and line.find("pae") != -1:
            isPAE = True
            break

    return isPAE
示例#10
0
def isPaeAvailable():
    global isPAE
    if isPAE is not None:
        return isPAE

    isPAE = False
    if not iutil.isX86():
        return isPAE

    f = open("/proc/cpuinfo", "r")
    lines = f.readlines()
    f.close()

    for line in lines:
        if line.startswith("flags") and line.find("pae") != -1:
            isPAE = True
            break

    return isPAE
示例#11
0
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)
示例#12
0
    def setSteps(self, anaconda):
        dispatch = anaconda.dispatch
	dispatch.setStepList(
		 "language",
		 "keyboard",
		 "welcome",
                 "filtertype",
                 "filter",
                 "storageinit",
                 "findrootparts",
		 "betanag",
		 "installtype",
                 "cleardiskssel",
                 "parttype",
                 "autopartitionexecute",
                 "partition",
		 "storagedone",
		 "bootloadersetup",                 
		 "bootloader",
		 "network",
		 "timezone",
		 "accounts",
		 "useraccounts",
                 "reposetup",
                 "basepkgsel",
		 "tasksel",                                  
		 "postselection",
		 "confirminstall",
                 "reipl",
		 "install",
		 "enablefilesystems",
                 "setuptime",
                 "preinstallconfig",
		 "installpackages",
                 "postinstallconfig",
		 "writeconfig",
		 "firstboot",
		 "instbootloader",
                 "dopostaction",
                 "postscripts",
		 "writeksconfig",
                 "methodcomplete",
                 "copylogs",
                 "setfilecon",
		 "complete"
		)

	if not BETANAG:
	    dispatch.skipStep("betanag", permanent=1)

        if not iutil.isX86():
            dispatch.skipStep("bootloader", permanent=1)

        # allow backends to disable interactive package selection
        if not anaconda.backend.supportsPackageSelection:
            dispatch.skipStep("tasksel", skip = 1, permanent=1)
            dispatch.skipStep("group-selection", skip = 1, permanent=1)

        # allow install classes to turn off the upgrade 
        if not self.showUpgrade or not anaconda.backend.supportsUpgrades:
            dispatch.skipStep("findrootparts", skip = 1)

        # 'noupgrade' can be used on the command line to force not looking
        # for partitions to upgrade.  useful in some cases...
        if flags.cmdline.has_key("noupgrade"):
            dispatch.skipStep("findrootparts", skip = 1)

        # upgrade will also always force looking for an upgrade. 
        if flags.cmdline.has_key("upgrade"):
            dispatch.skipStep("findrootparts", skip = 0)

        # if there's only one install class, it doesn't make much sense
        # to show it
        if len(availableClasses()) < 2:
            dispatch.skipStep("installtype", permanent=1)

        # allow interface backends to skip certain steps.
        anaconda.intf.setSteps(anaconda)
示例#13
0
    def setSteps(self, anaconda):
        dispatch = anaconda.dispatch
	dispatch.schedule_steps(
		 "language",
		 "keyboard",
                 "filtertype",
                 "filter",
                 "storageinit",
                 "findrootparts",
		 "betanag",
                 "cleardiskssel",
                 "parttype",
                 "autopartitionexecute",
		 "storagedone",
		 "bootloader",
		 "network",
		 "timezone",
		 "accounts",
                 "reposetup",
                 "basepkgsel",
		 "tasksel",
		 "postselection",
                 "reipl",
		 "install",
		 "enablefilesystems",
                 "setuptime",
                 "preinstallconfig",
		 "installpackages",
                 "postinstallconfig",
		 "writeconfig",
                 "firstboot",
		 "instbootloader",
                 "dopostaction",
                 "postscripts",
		 "writeksconfig",
                 "methodcomplete",
                 "copylogs",
                 "setfilecon",
		 "complete"
		)

	if isFinal:
	    dispatch.skip_steps("betanag")

        if iutil.isEfi() or not iutil.isX86():
            dispatch.skip_steps("bootloader")

        # allow backends to disable interactive package selection
        if not anaconda.backend.supportsPackageSelection:
            dispatch.skip_steps("tasksel")
            dispatch.skip_steps("group-selection")

        # allow install classes to turn off the upgrade
        if not self.showUpgrade or not anaconda.backend.supportsUpgrades:
            dispatch.skip_steps("findrootparts")

        # 'noupgrade' can be used on the command line to force not looking
        # for partitions to upgrade.  useful in some cases...
        if flags.cmdline.has_key("noupgrade"):
            dispatch.skip_steps("findrootparts")

        # upgrade will also always force looking for an upgrade.
        if flags.cmdline.has_key("upgrade"):
            dispatch.request_steps("findrootparts")

        # allow interface backends to skip certain steps.
        map(lambda s: dispatch.skip_steps(s), anaconda.intf.unsupported_steps())
示例#14
0
def doProbeBiosDisks():
    if not iutil.isX86():
        return None
    return _isys.biosDiskProbe()