예제 #1
0
	def bootstrap(self):
		""" Will install using debootstrap """
		cmds=["debootstrap", "--variant="+self._variant]

		if config.arch():
			cmds.append("--foreign")
			cmds.append("--arch="+config.arch())
		if not config.auth():
			cmds.append("--no-check-gpg")

		keyrings = config.keyrings()
		for keyring in keyrings:
			cmds.append("--keyring="+keyring)

		cmds.append(config.suite())
		cmds.append(config.rootfs())
		cmds.append(config.source())
		cmds.append("/usr/share/debootstrap/scripts/testing")
		r = host.runner

		first = [cmds[0], "--print-debs", "--keep-debootstrap-dir" ]	+ cmds[1:]
		if r.run(first, stdoutfunc=self._setpaks, stderrfunc=self._stderr) != 0:
			raise RaptzException("Debootstrap pre stage failed")
		if r.run(cmds, stdoutfunc=self._stdout, stderrfunc=self._stderr) != 0:
			raise RaptzException("Debootstrap main stage failed")
예제 #2
0
	def bootstrap(self):
		# Lets build the multistrap configuration file
		par = SafeConfigParser()
		par.add_section("General")
		par.set("General", "arch", config.arch())
		par.set("General", "directory", config.rootfs())
		par.set("General", "cleanup", str(True))
		par.set("General", "noauth", str(not config.auth()))
		keyrings = config.keyrings()
		par.set("General", "bootstrap", " ".join(keyrings.keys()))
		repros = config.repros()
		par.set("General", "aptsources", " ".join(repros))

		for repro in config.repros():
			par.add_section(repro)
			par.set(repro, "keyring", keyrings[repro])
			par.set(repro, "packages", "dash apt apt-utils " + " ".join(config.early_packages()) + " ".join(config.packages()))
			par.set(repro, "source", config.source(repro))
			par.set(repro, "suite", config.suite(repro))
			par.set(repro, "components", " ".join(config.components(repro)))
		par.write(self._msfile)
		self._msfile.close()
		r = host.runner
		cmds = ["multistrap", "-f", self._msfile.name]
		if r.run(cmds, stdoutfunc=self._stdout, stderrfunc=self._stderr) != 0:
			raise RaptzException("Multistrap main stage failed")
예제 #3
0
파일: bootstrap.py 프로젝트: ahedlund/raptz
	def finalize(self):
		listd = config.rootfs("/etc/apt/sources.list.d")

		if not os.path.isdir(listd):
			os.makedirs(listd)
		for repro in config.repros():
			listfile = os.path.join(listd, repro.lower() + ".list")
			source = config.source(repro)
			suite = config.suite(repro)
			comp = " ".join(config.components(repro))
			f = open(listfile, "w")
			f.write("deb %s %s %s\n" % (source, suite, comp))
			if config.addsrcs(repro):
				f.write("deb-src %s %s %s\n" % (source, suite, comp))
예제 #4
0
	def bootstrap(self):
		""" Will install using debootstrap """
		cmds=["cdebootstrap", "--flavour="+self._flavour]

		if config.arch():
			cmds.append("--foreign")
			cmds.append("--arch="+config.arch())
		if not config.auth():
			cmds.append("--allow-unauthenticated")

		keyrings = config.keyrings()
		for keyring in keyrings:
			cmds.append("--keyring="+keyring)

		cmds.append(config.suite())
		cmds.append(config.rootfs())
		cmds.append(config.source())
#		cmds.append("/usr/share/debootstrap/scripts/testing")
		r = host.runner

		if r.run(cmds, stdoutfunc=self._stdout, stderrfunc=self._stderr) != 0:
			raise RaptzException("Debootstrap main stage failed")