summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Terceiro <terceiro@debian.org>2022-10-14 19:24:45 -0300
committerLars Wirzenius <liw@liw.fi>2022-10-17 20:20:21 +0300
commit28813c1bb606713fa7aff1cd77c5a176b0fb862f (patch)
tree77b1e00c966b11a329a183c9bf6bde6da5650932
parent457f53e6dc24741e7cc2dafe00a358e9a48cee12 (diff)
downloadvmdb2-28813c1bb606713fa7aff1cd77c5a176b0fb862f.tar.gz
fix(debootstrap plugin): set architecture for later stages
debootstrap takes an architecture argument, but does not propagate that to later stages of the image build. This causes, for example, the GRUB plugin to fail to install the correct packages when creating an images for a foreign archiecture. The call to dpkg --print-architecture to discover the native architecture is already done when state is first populated, so there is no need to do it again in the grub plugin.
-rw-r--r--vmdb/plugins/debootstrap_plugin.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/vmdb/plugins/debootstrap_plugin.py b/vmdb/plugins/debootstrap_plugin.py
index a28bf94..c96ed01 100644
--- a/vmdb/plugins/debootstrap_plugin.py
+++ b/vmdb/plugins/debootstrap_plugin.py
@@ -51,10 +51,8 @@ class DebootstrapStepRunner(vmdb.StepRunnerInterface):
install_keyring = values["install_keyring"]
include = values["include"]
require_empty = values["require_empty_target"]
- arch = (
- values["arch"]
- or subprocess.check_output(["dpkg", "--print-architecture"]).strip()
- )
+ arch = values["arch"] or state.arch
+ state.arch = arch
variant = values["variant"]
components = values["components"]
@@ -113,3 +111,7 @@ class DebootstrapStepRunner(vmdb.StepRunnerInterface):
]
+ remove_pkgs,
)
+
+ def run_even_if_skipped(self, values, settings, state):
+ if values["arch"]:
+ state.arch = values["arch"]