Exemple #1
0
    def __init__(self, xml, path, build_sources=False, clean=False, arch="default"):

        # pylint: disable=too-many-arguments

        self.xml = xml
        self.path = path
        self.rpcaptcache = None
        self.arch = arch

        self.rfs = BuildImgFs(path, xml.defs["userinterpr"])

        if clean:
            self.rfs.rmtree("")

        # TODO think about reinitialization if elbe_version differs
        if not self.rfs.isfile("etc/elbe_version"):
            # avoid starting daemons inside the buildenv
            self.rfs.mkdir_p("usr/sbin")
            # grub-legacy postinst will fail if /boot/grub does not exist
            self.rfs.mkdir_p("boot/grub")
            self.rfs.write_file(
                "usr/sbin/policy-rc.d",
                0o755,
                "#!/bin/sh\nexit 101\n")
            self.debootstrap(arch)
            self.fresh_debootstrap = True
            self.need_dumpdebootstrap = True
        else:
            self.fresh_debootstrap = False
            self.need_dumpdebootstrap = False

        self.initialize_dirs(build_sources=build_sources)
        create_apt_prefs(self.xml, self.rfs)
Exemple #2
0
    def __init__ (self, xml, log, path, build_sources=False, clean=False ):

        self.xml = xml
        self.log = log
        self.path = path

        self.rfs = BuildImgFs (path, xml.defs["userinterpr"])

        if clean:
            self.rfs.rmtree("")

        # TODO think about reinitialization if elbe_version differs
        if not self.rfs.isfile( "etc/elbe_version" ):
            # avoid starting daemons inside the buildenv
            self.rfs.mkdir_p ("usr/sbin")
            self.rfs.write_file ("usr/sbin/policy-rc.d",
                0755, "#!/bin/sh\nexit 101\n")
            self.debootstrap ()
            self.fresh_debootstrap = True
            self.need_dumpdebootstrap = True
        else:
            print 'work on existing rfs'
            self.fresh_debootstrap = False
            self.need_dumpdebootstrap = False

        self.initialize_dirs (build_sources=build_sources)