Exemplo n.º 1
0
    def __init__(self, cfg, jobData):
        self.filesystems = {"/": StubFilesystem()}
        self.scsiModules = False

        ImageGenerator.__init__(self, cfg, jobData)
        log.info("building trove: %s" % self.baseTup.asString())

        # Settings
        self.workingDir = os.path.join(self.workDir, self.basefilename)
        self.outputDir = os.path.join(constants.finishedDir, self.UUID)
        self.root = os.path.join(self.workDir, "root")
        self.tempRoot = os.path.join(self.workDir, "temp_root")
        self.changesetDir = os.path.join(self.workDir, "changesets")
        util.mkdirChain(self.outputDir)
        util.mkdirChain(self.workingDir)
        self.swapSize = (self.getBuildData("swapSize") or 0) * 1048576
        self.swapPath = "/var/swap"

        # Runtime variables
        self.bootloader = None
        self.outputFileList = []
        self.uJob = None
        self.mountDict = self.getFilesystems() or self.getDefaultFilesystems()

        # List of devicePath (realative to the rootPath's /dev), device
        # type 'c' or 'b', major, and minor numbers.
        self.devices = [
            # common character devices
            ("console", "c", 5, 1, 0600),
            ("null", "c", 1, 3, 0666),
            ("zero", "c", 1, 5, 0666),
            ("full", "c", 1, 7, 0666),
            ("tty", "c", 5, 0, 0666),
            ("ptmx", "c", 5, 2, 0666),
            ("random", "c", 1, 8, 0666),
            ("urandom", "c", 1, 9, 0666),
            # common block devices
            ("sda", "b", 8, 0, 0660),
            ("sda1", "b", 8, 1, 0660),
            ("sda2", "b", 8, 2, 0660),
        ]

        # SLES 11 is too smart, and finds our loop device by major/minor
        if os.path.exists("/dev/loop0"):
            rootLoopDev = os.stat("/dev/loop0")
            rootLoopMajor = os.major(rootLoopDev.st_rdev)
            rootLoopMinor = os.minor(rootLoopDev.st_rdev)
            self.devices.append(("loop%d" % rootLoopMinor, "b", rootLoopMajor, rootLoopMinor, 0660))
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     ImageGenerator.__init__(self, *args, **kwargs)
     self.showMediaCheck = self.getBuildData('showMediaCheck')
     self.maxIsoSize = int(self.getBuildData('maxIsoSize'))