From 61eae75d5ef216724fc42fc8519e2995b13cb2be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 4 Jun 2020 21:18:05 +0200 Subject: [PATCH] Support building arbitraty named appliance images. --- live-build/auto/config | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index 3df12674..12bdf73f 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -177,6 +177,8 @@ case $IMAGEFORMAT in ubuntu-image) UBUNTU_IMAGE_ARGS="" + BRAND_ID="canonical" + case "$ARCH+${SUBARCH:-}" in amd64+*) MODEL=pc-amd64 ;; @@ -190,6 +192,14 @@ case $IMAGEFORMAT in MODEL=pi-arm64 ;; armhf+imx6) MODEL=nitrogen6x ;; + # Handle appliance images + *+appliance_*) + BRAND_ID="ubuntu" + COMPOSED="${SUBARCH#appliance_}" + APPLIANCE="${COMPOSED%_*}" + DEVICE="${COMPOSED#*_}" + MODEL="${APPLIANCE}-core18-${DEVICE}" + ;; *) echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2 exit 1 @@ -206,7 +216,6 @@ case $IMAGEFORMAT in if [ $PROJECT = "ubuntu-core" ]; then # snap-based core images - BRAND_ID="canonical" case $MODEL in pc-amd64|pc-i386) [ -z "${SUBARCH:-}" ] \ @@ -219,19 +228,8 @@ case $IMAGEFORMAT in ;; *) # Ubuntu Core 18 - case $SUBARCH in - # Handle appliance images - *plexmediaserver|*adguard-home|*nextcloud|*openhab|*frr) - BRAND_ID="ubuntu" - APPLIANCE="${SUBARCH#raspi3-}" - [ "$MODEL" = "pi-arm64" ] && MODEL="pi" - MODEL="${APPLIANCE}-core18-${MODEL#pc-}" - ;; - # Default generic images - *) - MODEL="ubuntu-core-18-${MODEL#pc-}" - ;; - esac + [ -z "${APPLIANCE:-}" ] \ + && MODEL="ubuntu-core-18-${MODEL#pc-}" ;; esac