All pastes #278294 Raw Edit

Mine

public text v1 · immutable
·published 2006-12-13 23:32 UTC
rendered paste body
from installclass import BaseInstallClass
from rhpl.translate import *
from constants import *
import os
import iutil

from autopart import getAutopartitionBoot, autoCreatePartitionRequests

class InstallClass(BaseInstallClass):
    hidden = 0
    
    id = "rbuilder"
    name = N_("r_Builder")
    pixmap = "rpath-color-graphic-only.png"
    description = N_("rBuilder Appliance install type.")

    sortPriority = 100
    showLoginChoice = 1

    def setSteps(self, dispatch):
        BaseInstallClass.setSteps(self, dispatch);
        dispatch.skipStep("authentication")
        dispatch.skipStep("bootloader")
        dispatch.skipStep("package-selection")
        dispatch.skipStep("firewall")
        dispatch.skipStep("confirminstall")

    def setGroupSelection(self, grpset, intf):
        BaseInstallClass.__init__(self, grpset)

        grpset.unselectAll()
        grpset.selectGroup("everything")

    def setInstallData(self, id):
        BaseInstallClass.setInstallData(self, id)

        id.partitions.autoClearPartType = CLEARPART_TYPE_ALL
        id.partitions.autoClearPartDrives = []

        # (mntpt, fstype, minsize, maxsize, grow, format)
        autorequests = [ ("/",    None, 768, 1024, 1, 1, 1),
                         ("/srv", None, 1024, None, 1, 1, 1) ]

        bootreq = getAutopartitionBoot()
        if bootreq:
            autorequests.extend(bootreq)

        (minswap, maxswap) = iutil.swapSuggestion()
        autorequests.append((None, "swap", minswap, maxswap, 1, 1, 1))

        id.partitions.autoPartitionRequests = autoCreatePartitionRequests(autorequests)
        self.setFirewall(id, ports = ['22:tcp', '80:tcp', '443:tcp', '8003:tcp'])