Beispiel #1
0
    def __init__(self, ks, name, fslabel=None, releasever=None, tmpdir="/tmp",
                 useplugins=False, cacheonly=False, docleanup=True):
        """Initialize a LoopImageCreator instance.

        This method takes the same arguments as ImageCreator.__init__() with
        the addition of:

        fslabel -- A string used as a label for any filesystems created.

        """
        ImageCreator.__init__(self, ks, name, releasever=releasever, tmpdir=tmpdir,
                              useplugins=useplugins, cacheonly=cacheonly, docleanup=docleanup)

        self.__fslabel = None
        self.fslabel = fslabel

        self.__minsize_KB = 0
        self.__blocksize = 4096
        self.__fstype = kickstart.get_image_fstype(self.ks, "ext3")

        self.__instloop = None
        self.__imgdir = None

        self.__image_size = kickstart.get_image_size(self.ks,
                                                     4096L * 1024 * 1024)
Beispiel #2
0
    def __init__(self,
                 ks,
                 name,
                 releasever=None,
                 tmpdir="/tmp",
                 useplugins=False,
                 cacheonly=False,
                 docleanup=True):
        """Initialize an ImageCreator instance.

        ks -- a pykickstart.KickstartParser instance; this instance will be
              used to drive the install by e.g. providing the list of packages
              to be installed, the system configuration and %post scripts

        name -- a name for the image; used for e.g. image filenames or
                filesystem labels

        releasever -- Value to substitute for $releasever in repo urls

        tmpdir -- Top level directory to use for temporary files and dirs

        cacheonly -- Only read from cache, work offline
        """
        self.ks = ks
        """A pykickstart.KickstartParser instance."""

        self.name = name
        """A name for the image."""

        self.releasever = releasever
        self.useplugins = useplugins

        self.tmpdir = tmpdir
        """The directory in which all temporary files will be created."""
        if not os.path.exists(self.tmpdir):
            makedirs(self.tmpdir)

        self.cacheonly = cacheonly
        self.docleanup = docleanup
        self.excludeWeakdeps = kickstart.exclude_weakdeps(self.ks)

        self.__builddir = None
        self.__bindmounts = []
        self.__fstype = kickstart.get_image_fstype(self.ks, "ext4")

        self.__sanity_check()

        # get selinuxfs mountpoint
        self.__selinux_mountpoint = "/sys/fs/selinux"
        with open("/proc/self/mountinfo", "r") as f:
            for line in f.readlines():
                fields = line.split()
                if fields[-2] == "selinuxfs":
                    self.__selinux_mountpoint = fields[4]
                    break
Beispiel #3
0
    def __init__(self, ks, name, releasever=None, tmpdir="/tmp", useplugins=False,
                 cacheonly=False, docleanup=True):
        """Initialize an ImageCreator instance.

        ks -- a pykickstart.KickstartParser instance; this instance will be
              used to drive the install by e.g. providing the list of packages
              to be installed, the system configuration and %post scripts

        name -- a name for the image; used for e.g. image filenames or
                filesystem labels

        releasever -- Value to substitute for $releasever in repo urls

        tmpdir -- Top level directory to use for temporary files and dirs

        cacheonly -- Only read from cache, work offline
        """
        self.ks = ks
        """A pykickstart.KickstartParser instance."""

        self.name = name
        """A name for the image."""

        self.releasever = releasever
        self.useplugins = useplugins

        self.tmpdir = tmpdir
        """The directory in which all temporary files will be created."""
        if not os.path.exists(self.tmpdir):
            makedirs(self.tmpdir)

        self.cacheonly = cacheonly
        self.docleanup = docleanup
        self.excludeWeakdeps = kickstart.exclude_weakdeps(self.ks)

        self.__builddir = None
        self.__bindmounts = []
        self.__fstype = kickstart.get_image_fstype(self.ks, "ext3")

        self.__sanity_check()

        # get selinuxfs mountpoint
        self.__selinux_mountpoint = "/sys/fs/selinux"
        with open("/proc/self/mountinfo", "r") as f:
            for line in f.readlines():
                fields = line.split()
                if fields[-2] == "selinuxfs":
                    self.__selinux_mountpoint = fields[4]
                    break
Beispiel #4
0
    def __init__(self, ks, name, fslabel = None):
        """Initialize a LoopImageCreator instance.

        This method takes the same arguments as ImageCreator.__init__() with
        the addition of:

        fslabel -- A string used as a label for any filesystems created.

        """
        ImageCreator.__init__(self, ks, name)

        self.__fslabel = None
        self.fslabel = fslabel

        self.__minsize_KB = 0
        self.__blocksize = 4096
        self.__fstype = kickstart.get_image_fstype(self.ks, "ext3")

        self.__instloop = None
        self.__imgdir = None

        self.__image_size = kickstart.get_image_size(self.ks,
                                                     4096L * 1024 * 1024)