From 228ed7c87b21cfd6521aa4a83bcd41d6a995d374 Mon Sep 17 00:00:00 2001 From: "Gary.Wzl" Date: Mon, 18 Sep 2017 09:38:20 +0800 Subject: [PATCH] Remove 'IMAGETYPE' and 'IMAGEFORMAT' bits per the suggestions. --- live-build/auto/build | 14 +++------ live-build/auto/config | 66 +++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 50 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index d5b8a87e..156f7789 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -16,17 +16,11 @@ if [ -z "${PROJECT:-}" ]; then fi if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then - if [ "${IMAGETYPE:-}" = "classic" ]; then - # Use ubuntu-image instead of live-build - OPTS="${PROJECT:+--project=$PROJECT} ${SUITE:+--suite=$SUITE} ${ARCH:+--arch=$ARCH} ${SUBPROJECT:+--subproject=$SUBPROJECT} ${SUBARCH:+--subarch=$SUBARCH} ${PROPOSED:+--with-proposed=$PROPOSED} ${IMAGEFORMAT:+--image-format=$IMAGEFORMAT} ${EXTRA_PPAS:+--extra-ppas=$EXTRA_PPAS}" - ubuntu-image classic $OPTS gadget_tree - else - # Use ubuntu-image instead of live-build - env SNAPPY_STORE_NO_CDN=1 \ - ubuntu-image snap -c edge \ + # Use ubuntu-image instead of live-build + env SNAPPY_STORE_NO_CDN=1 \ + ubuntu-image -c edge \ -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion - xz -0 -T4 livecd."$PROJECT".img - fi + xz -0 -T4 livecd."$PROJECT".img exit 0 fi diff --git a/live-build/auto/config b/live-build/auto/config index 8d350ad3..3f504463 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -153,48 +153,34 @@ case $IMAGEFORMAT in ;; ubuntu-image) - case $IMAGETYPE in - classic) - echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common - # TODO livecd-rootfs needs to take a branch URI for the gadget as input, - # stage it, and pass it to ubuntu-image, where do we get it? - - # Fake finished configuration for lb build - mkdir -p .build - touch .build/config - exit 0 - ;; - *) # backport compatibility for core image creation. - case "$ARCH+${SUBARCH:-}" in - amd64+*) - MODEL=pc-amd64 ;; - i386+*) - MODEL=pc-i386 ;; - arm64+snapdragon) - MODEL=dragonboard ;; - armhf+raspi2) - MODEL=pi2 ;; - armhf+raspi3) - MODEL=pi3 ;; - armhf+cm3) - MODEL=cm3 ;; - *) - echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2 - exit 1 - ;; - esac - echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common - # Store model assertion in top dir to get it picked up later as a build artifact - env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > livecd."$PROJECT".model-assertion - echo "Configured ubuntu-image for the following model assertion:" - cat livecd."$PROJECT".model-assertion - echo "----------------------------------------------------------" - # Fake finished configuration for lb build - mkdir -p .build - touch .build/config - exit 0 + case "$ARCH+${SUBARCH:-}" in + amd64+*) + MODEL=pc-amd64 ;; + i386+*) + MODEL=pc-i386 ;; + arm64+snapdragon) + MODEL=dragonboard ;; + armhf+raspi2) + MODEL=pi2 ;; + armhf+raspi3) + MODEL=pi3 ;; + armhf+cm3) + MODEL=cm3 ;; + *) + echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2 + exit 1 ;; esac + echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common + # Store model assertion in top dir to get it picked up later as a build artifact + env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > livecd."$PROJECT".model-assertion + echo "Configured ubuntu-image for the following model assertion:" + cat livecd."$PROJECT".model-assertion + echo "----------------------------------------------------------" + # Fake finished configuration for lb build + mkdir -p .build + touch .build/config + exit 0 ;; *)