Add IMAGETYPE to support classic image creation by ubuntu-image.

ubuntu/cosmic
Gary.Wzl 7 years ago
parent 5c1b9f5c5c
commit 84da578380

@ -16,11 +16,17 @@ if [ -z "${PROJECT:-}" ]; then
fi fi
if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
# Use ubuntu-image instead of live-build if [ "${IMAGETYPE:-}" = "classic" ]; then
env SNAPPY_STORE_NO_CDN=1 \ # Use ubuntu-image instead of live-build
ubuntu-image -c edge \ 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 \
-o livecd."$PROJECT".img livecd."$PROJECT".model-assertion -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion
xz -0 -T4 livecd."$PROJECT".img xz -0 -T4 livecd."$PROJECT".img
fi
exit 0 exit 0
fi fi

@ -153,34 +153,48 @@ case $IMAGEFORMAT in
;; ;;
ubuntu-image) ubuntu-image)
case "$ARCH+${SUBARCH:-}" in case $IMAGETYPE in
amd64+*) classic)
MODEL=pc-amd64 ;; echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
i386+*) # TODO livecd-rootfs needs to take a branch URI for the gadget as input,
MODEL=pc-i386 ;; # stage it, and pass it to ubuntu-image, where do we get it?
arm64+snapdragon)
MODEL=dragonboard ;; # Fake finished configuration for lb build
armhf+raspi2) mkdir -p .build
MODEL=pi2 ;; touch .build/config
armhf+raspi3) exit 0
MODEL=pi3 ;; ;;
armhf+cm3) *) # backport compatibility for core image creation.
MODEL=cm3 ;; case "$ARCH+${SUBARCH:-}" in
*) amd64+*)
echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2 MODEL=pc-amd64 ;;
exit 1 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
;; ;;
esac 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
;; ;;
*) *)

Loading…
Cancel
Save