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

This commit is contained in:
Gary.Wzl 2017-08-28 11:24:51 +08:00
parent 5c1b9f5c5c
commit 84da578380
2 changed files with 50 additions and 30 deletions

View File

@ -16,11 +16,17 @@ 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 -c edge \
ubuntu-image snap -c edge \
-o livecd."$PROJECT".img livecd."$PROJECT".model-assertion
xz -0 -T4 livecd."$PROJECT".img
fi
exit 0
fi

View File

@ -153,6 +153,18 @@ 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 ;;
@ -182,6 +194,8 @@ case $IMAGEFORMAT in
touch .build/config
exit 0
;;
esac
;;
*)
case $PROJECT in