示例#1
0
文件: livecd.py 项目: sledges/mic
    def __init__(self, creatoropts=None, pkgmgr=None):
        """Initialise a LiveImageCreator instance.

           This method takes the same arguments as ImageCreator.__init__().
        """
        LoopImageCreator.__init__(self, creatoropts, pkgmgr)

        #Controls whether to use squashfs to compress the image.
        self.skip_compression = False

        #Controls whether an image minimizing snapshot should be created.
        #
        #This snapshot can be used when copying the system image from the ISO in
        #order to minimize the amount of data that needs to be copied; simply,
        #it makes it possible to create a version of the image's filesystem with
        #no spare space.
        self.skip_minimize = False

        #A flag which indicates i act as a convertor default false
        self.actasconvertor = False

        #The bootloader timeout from kickstart.
        if self.ks:
            self._timeout = kickstart.get_timeout(self.ks, 10)
        else:
            self._timeout = 10

        #The default kernel type from kickstart.
        if self.ks:
            self._default_kernel = kickstart.get_default_kernel(
                self.ks, "kernel")
        else:
            self._default_kernel = None

        if self.ks:
            parts = kickstart.get_partitions(self.ks)
            if len(parts) > 1:
                raise CreatorError("Can't support multi partitions in ks file "
                                   "for this image type")
            # FIXME: rename rootfs img to self.name,
            # else can't find files when create iso
            self._instloops[0]['name'] = self.name + ".img"

        self.__isodir = None

        self.__modules = [
            "=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire", "=mmc",
            "=pcmcia", "mptsas"
        ]
        if self.ks:
            self.__modules.extend(kickstart.get_modules(self.ks))

        self._dep_checks.extend(
            ["isohybrid", "unsquashfs", "mksquashfs", "dd", "genisoimage"])
示例#2
0
    def __init__(self, creatoropts = None, pkgmgr = None):
        """Initialise a LiveImageCreator instance.

           This method takes the same arguments as ImageCreator.__init__().
        """
        LoopImageCreator.__init__(self, creatoropts, pkgmgr)

        #Controls whether to use squashfs to compress the image.
        self.skip_compression = False

        #Controls whether an image minimizing snapshot should be created.
        #
        #This snapshot can be used when copying the system image from the ISO in
        #order to minimize the amount of data that needs to be copied; simply,
        #it makes it possible to create a version of the image's filesystem with
        #no spare space.
        self.skip_minimize = False

        #A flag which indicates i act as a convertor default false
        self.actasconvertor = False

        #The bootloader timeout from kickstart.
        if self.ks:
            self._timeout = kickstart.get_timeout(self.ks, 10)
        else:
            self._timeout = 10

        #The default kernel type from kickstart.
        if self.ks:
            self._default_kernel = kickstart.get_default_kernel(self.ks, "kernel")
        else:
            self._default_kernel = None


        self.__isodir = None

        self.__modules = ["=ata",
                          "sym53c8xx",
                          "aic7xxx",
                          "=usb",
                          "=firewire",
                          "=mmc",
                          "=pcmcia",
                          "mptsas"]
        if self.ks:
            self.__modules.extend(kickstart.get_modules(self.ks))

        self._dep_checks.extend(["isohybrid",
                                 "unsquashfs",
                                 "mksquashfs",
                                 "dd",
                                 "genisoimage"])