コード例 #1
0
ファイル: debootstrap.py プロジェクト: ahedlund/raptz
	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
ファイル: multistrap.py プロジェクト: ahedlund/raptz
	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
ファイル: cdebootstrap.py プロジェクト: ahedlund/raptz
	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")