From 4a66acc6f5463390469ed109c3db0330670d8873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 27 Jan 2025 13:57:56 +0100 Subject: [PATCH] osbuilder: ubuntu: Abort if multistrap fails (but not on 20.04) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have gotten Ubuntu 20.04 working pretty much "by luck", as multistrap fails the deployment, and then a hacky function was introduced to add the proper dbus links. However, this does not scale at all, and we should: * Fail if multistrap fails * I won't do this for Ubuntu 20.04 as it's working for now and soon enough it'll be EOL * Add better logging to ensure someone can know when multistrap fails Below you can find the failure that we're hitting on Ubuntu 20.04: ```sh Errors were encountered while processing: dbus ERR: dpkg configure reported an error. Native mode configuration reported an error! I: Tidying up apt cache and list data. Multistrap system reported 1 error in /rootfs/. I: Tidying up apt cache and list data. ``` Signed-off-by: Fabiano FidĂȘncio --- tools/osbuilder/rootfs-builder/ubuntu/rootfs_lib.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/osbuilder/rootfs-builder/ubuntu/rootfs_lib.sh b/tools/osbuilder/rootfs-builder/ubuntu/rootfs_lib.sh index 99712b2d23..389249605d 100644 --- a/tools/osbuilder/rootfs-builder/ubuntu/rootfs_lib.sh +++ b/tools/osbuilder/rootfs-builder/ubuntu/rootfs_lib.sh @@ -45,7 +45,14 @@ EOF apt update if ! multistrap -a "$DEB_ARCH" -d "$rootfs_dir" -f "$multistrap_conf"; then - build_dbus $rootfs_dir + if [ "$OS_VERSION" = "focal" ]; then + echo "WARN: multistrap failed, proceed with hack for Ubuntu 20.04" + build_dbus $rootfs_dir + else + echo "ERROR: multistrap failed, cannot proceed" && exit 1 + fi + else + echo "INFO: multistrap succeeded" fi rm -rf "$rootfs_dir/var/run" ln -s /run "$rootfs_dir/var/run"