From cdcb44ebf94ff49ef8f9564bdfd1997bea13d682 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 20 Dec 2023 22:02:24 -0800 Subject: [PATCH] include a sanity check that no layered image has more than one "live" layer This would cause undefined behavior with the LAYERFS_LIVE handling in the hook. --- debian/changelog | 3 +++ live-build/auto/config | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index 42f0b835..d83edac0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ livecd-rootfs (24.04.15) UNRELEASED; urgency=medium layer ending in .live so this can be reused across flavors * live-build/ubuntu/hooks/020-ubuntu-live.chroot_early: check for glib-compile-schemas presence before calling + * live-build/auto/config: include a sanity check that no layered image has + more than one "live" layer that would cause undefined behavior with the + above hook. -- Steve Langasek Wed, 20 Dec 2023 19:45:34 -0800 diff --git a/live-build/auto/config b/live-build/auto/config index 8024c53b..0034f834 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -107,6 +107,18 @@ _register_pass () { # $1 Name of the pass [ "$PASSES_TO_LAYERS" != "true" ] && return + # live-build/ubuntu/hooks/020-ubuntu-live.chroot_early assumes the + # layer ending in '.live' is THE live layer to use, so ensure that + # we only define a single layer ending in '.live'. It principle it + # is not invalid to have multiple layers with .live in the name but + # we should not let this happen accidentally. + case "$PASSES $1" in + *.live *.live) + EXPLODE + ;; + *) + ;; + esac PASSES="$PASSES $1" }