From cec7b9966575340b464e961164b23f08ff7f27cb Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 22 Sep 2023 22:34:01 -0700 Subject: [PATCH] live-build/auto/config: fail immediately on unknown arch/subarch. When trying to make changes to refactor livecd-rootfs, it is difficult to know what side effects a change may have because of the use of globs on arch/subarch and the lack of an authoritative list of supported arch combinations. This assembles a list of all possible values for $ARCH:$SUBARCH by looking at all existing uses of $SUBARCH in live-build/auto/config and combining with etc/default-arches from ubuntu-cdimage: $ grep + etc/default-arches |grep -vE '(trusty|xenial|bionic|focal)[[:space:]]|appliance' It also includes a special-case *appliance* glob, because there are many Ubuntu Core appliance builds and there may be more in the future, and we don't want to have to update livecd-rootfs with a hard-coded list. Otherwise, this includes all currently used / supported combinations. The amd64+kassel subarch is referenced in the code, but stopped being built a while ago because "end of contract"; and there are some older no-longer-used subarchs for particular raspi variants, which there is work to clean up separately. So this should be a no-op wrt buildability of any existing images on mantic - and if not, that's important for us to know! --- debian/changelog | 6 ++++++ live-build/auto/config | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/debian/changelog b/debian/changelog index 85d736f9..e224dcbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (23.10.45) UNRELEASED; urgency=medium + + * live-build/auto/config: fail immediately on unknown arch/subarch. + + -- Steve Langasek Fri, 22 Sep 2023 22:19:57 -0700 + livecd-rootfs (23.10.44) mantic; urgency=medium * Fix the subarch used in the hook to identify images for sifive diff --git a/live-build/auto/config b/live-build/auto/config index 6b257987..5d83cb66 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1,6 +1,24 @@ #! /bin/sh set -e +case $ARCH:$SUBARCH in + amd64:|amd64:generic|amd64:intel-iot|\ + arm64:|arm64:generic|arm64:raspi|arm64:snapdragon|\ + arm64:tegra|arm64:tegra-igx|\ + armhf:|armhf:raspi|\ + i386:\ + ppc64el:\ + riscv64:icicle|riscv64:nezha|riscv64:licheerv|riscv64:unmatched|\ + riscv64:visionfive|riscv64:visionfive2|\ + s390x:\ + *appliance*) + ;; + *) + echo "Unknown architecture target $ARCH:$SUBARCH" + exit 1 + ;; +esac + if [ -e config/germinate-output ]; then mv -T config/germinate-output germ-tmp rm -rf config