From 28813c1bb606713fa7aff1cd77c5a176b0fb862f Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 14 Oct 2022 19:24:45 -0300 Subject: 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. --- vmdb/plugins/debootstrap_plugin.py | 10 ++++++---- 1 file 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"] -- cgit v1.2.1