def setup(self): self.copy2rootfs(config.confpath("root")) debconfsrc=config.confpath("debconf.cfg") if os.path.isfile(config.confpath("debconf.cfg")): debconfdst=config.rootfs("/tmp/debconf.cfg") shutil.copy2(debconfsrc, debconfdst) if host.runner.chroot(["debconf-set-selections", "-v", "/tmp/debconf.cfg"]): raise RaptzException("Debconf failed") os.unlink(debconfdst)
def configure(self): cfgroot = config.confpath("conf") srcroot, dirs, files = os.walk(cfgroot).next() ch = host.runner i = 0 for d in dirs: src = os.path.join(srcroot, d) dst = tempfile.mkdtemp(dir=config.rootfs("/tmp")) dstinit = config.rmrootfs(os.path.join(dst, "init.sh")) dstarg = config.rmrootfs(dst) self.copy2rootfs(src, dstarg) ret = ch.chroot([dstinit, dstarg], stdoutfunc=self._stdout, stderrfunc=self._stdout) # Run dev scripts if avalible, disabel as of now #dstinit = config.rmrootfs(os.path.join(dst, "init.dev.sh")) #if config.args.dev and os.path.isdir(config.rootfs(dstinit)): # dstarg = config.rmrootfs(dst) # ret = ch.chroot([dstinit, dstarg], # stdoutfunc=self._stdout, # stderrfunc=self._stdout) shutil.rmtree(dst) if ret != 0: raise RaptzException("Configure " + d + " failed") i+=1
def configure(self): cfgroot = config.confpath("conf") srcroot, dirs, files = os.walk(cfgroot).next() ch = host.runner i = 0 for d in dirs: src = os.path.join(srcroot, d) dst = tempfile.mkdtemp(dir=config.rootfs("/tmp")) dstinit = config.rmrootfs(os.path.join(dst, "init.sh")) dstarg = config.rmrootfs(dst) self.copy2rootfs(src, dstarg) ret = ch.chroot([dstinit, dstarg], stdoutfunc=self._stdout, stderrfunc=self._stdout) shutil.rmtree(dst) if ret != 0: raise RaptzException("Configure " + d + " failed") i+=1