summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-07-12 13:41:34 +0300
committerLars Wirzenius <liw@liw.fi>2021-07-12 13:41:34 +0300
commit43f06bfefa72ffee014018c6182c40e2c79a2a14 (patch)
treea5fe4fb2d4bd47430fefabace7c5fa090d53996c
parent2d4bc72511ba16473a8e45e86fe05fbd7e35f793 (diff)
parent38120ea5721b5f86bc66b6063634c7ca2077b904 (diff)
downloadvmdb2-43f06bfefa72ffee014018c6182c40e2c79a2a14.tar.gz
Merge branch 'AaronDewes/vmdb2-merge-qemu-debootstrap-into-debootstrap'
-rw-r--r--vmdb/plugins/debootstrap.mdwn4
-rw-r--r--vmdb/plugins/debootstrap_plugin.py25
-rw-r--r--vmdb/plugins/qemudebootstrap.mdwn4
3 files changed, 31 insertions, 2 deletions
diff --git a/vmdb/plugins/debootstrap.mdwn b/vmdb/plugins/debootstrap.mdwn
index c1773d3..322cf6b 100644
--- a/vmdb/plugins/debootstrap.mdwn
+++ b/vmdb/plugins/debootstrap.mdwn
@@ -21,6 +21,10 @@ Step keys:
(e.g. Raspbian) as by default debootstrap will use the keys provided
by the "debian-archive-keyring" package.
+* `arch` &mdash; OPTIONAL; the foreign architecture to use.
+
+* `variant` &mdash; OPTIONAL; the variant for debootstrap.
+
Example (in the .vmdb file):
- debootstrap: buster
diff --git a/vmdb/plugins/debootstrap_plugin.py b/vmdb/plugins/debootstrap_plugin.py
index 63579e5..9f622a1 100644
--- a/vmdb/plugins/debootstrap_plugin.py
+++ b/vmdb/plugins/debootstrap_plugin.py
@@ -17,7 +17,7 @@
import vmdb
-
+import subprocess
class DebootstrapPlugin(vmdb.Plugin):
def enable(self):
@@ -30,8 +30,10 @@ class DebootstrapStepRunner(vmdb.StepRunnerInterface):
"debootstrap": str,
"target": str,
"mirror": str,
+ "arch": "",
"keyring": "",
"variant": "-",
+ "components": ["main"],
}
def run(self, values, settings, state):
@@ -40,7 +42,9 @@ class DebootstrapStepRunner(vmdb.StepRunnerInterface):
target = state.tags.get_builder_mount_point(tag)
mirror = values["mirror"]
keyring = values["keyring"] or None
+ arch = values["arch"] or subprocess.check_output(['dpkg', '--print-architecture'])
variant = values["variant"]
+ components = values["components"]
if not (suite and tag and target and mirror):
raise Exception("missing arg for debootstrap step")
@@ -50,15 +54,32 @@ class DebootstrapStepRunner(vmdb.StepRunnerInterface):
"debootstrap",
"--keyring",
keyring,
+ "--arch",
+ arch,
"--variant",
variant,
+ "--components",
+ ",".join(components),
suite,
target,
mirror,
]
)
else:
- vmdb.runcmd(["debootstrap", "--variant", variant, suite, target, mirror])
+ vmdb.runcmd(
+ [
+ "debootstrap",
+ "--arch",
+ arch,
+ "--variant",
+ variant,
+ "--components",
+ ",".join(components),
+ suite,
+ target,
+ mirror,
+ ]
+ )
def run_even_if_skipped(self, values, settings, state):
tag = values["target"]
diff --git a/vmdb/plugins/qemudebootstrap.mdwn b/vmdb/plugins/qemudebootstrap.mdwn
index bb9adc4..6475497 100644
--- a/vmdb/plugins/qemudebootstrap.mdwn
+++ b/vmdb/plugins/qemudebootstrap.mdwn
@@ -1,6 +1,10 @@
Step: qemu-debootstrap
-----------------------------------------------------------------------------
+This command has been merged into `debootstrap`.
+If your builds run on Debian 10 or later,
+it is recommended to use `debootstrap` instead of `qemu-debootstrap`.
+
Install packages using apt, which needs to already have been
installed, for a different architecture than the host where vmdb2 is
being run. For example, for building an image for a Raspberry Pi on an