Exemple #1
0
	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
Exemple #2
0
	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