Support building arbitraty named appliance images.

sil2100/appliance-images
Łukasz 'sil2100' Zemczak 5 years ago
parent 467065461b
commit 61eae75d5e

@ -177,6 +177,8 @@ case $IMAGEFORMAT in
ubuntu-image) ubuntu-image)
UBUNTU_IMAGE_ARGS="" UBUNTU_IMAGE_ARGS=""
BRAND_ID="canonical"
case "$ARCH+${SUBARCH:-}" in case "$ARCH+${SUBARCH:-}" in
amd64+*) amd64+*)
MODEL=pc-amd64 ;; MODEL=pc-amd64 ;;
@ -190,6 +192,14 @@ case $IMAGEFORMAT in
MODEL=pi-arm64 ;; MODEL=pi-arm64 ;;
armhf+imx6) armhf+imx6)
MODEL=nitrogen6x ;; 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 echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2
exit 1 exit 1
@ -206,7 +216,6 @@ case $IMAGEFORMAT in
if [ $PROJECT = "ubuntu-core" ]; then if [ $PROJECT = "ubuntu-core" ]; then
# snap-based core images # snap-based core images
BRAND_ID="canonical"
case $MODEL in case $MODEL in
pc-amd64|pc-i386) pc-amd64|pc-i386)
[ -z "${SUBARCH:-}" ] \ [ -z "${SUBARCH:-}" ] \
@ -219,19 +228,8 @@ case $IMAGEFORMAT in
;; ;;
*) *)
# Ubuntu Core 18 # Ubuntu Core 18
case $SUBARCH in [ -z "${APPLIANCE:-}" ] \
# Handle appliance images && MODEL="ubuntu-core-18-${MODEL#pc-}"
*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
;; ;;
esac esac

Loading…
Cancel
Save