Use ubuntu-image image definitions for riscv, raspi and ubuntu-base builds.

ui-by-default-wip
Łukasz 'sil2100' Zemczak 2 years ago
parent 90067f99e2
commit beada31662

@ -89,6 +89,10 @@ PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
# Use ubuntu-image instead of live-build # Use ubuntu-image instead of live-build
# TODO: eventually, this should be handled by a single ubuntu-image
# call without having to do a conditional on ubuntu-core/classic.
# We could already do that, but then we'd still have to do the
# compressing for the core images.
if [ "$PROJECT" = "ubuntu-core" ]; then if [ "$PROJECT" = "ubuntu-core" ]; then
env SNAPPY_STORE_NO_CDN=1 \ env SNAPPY_STORE_NO_CDN=1 \
ubuntu-image snap $UBUNTU_IMAGE_ARGS \ ubuntu-image snap $UBUNTU_IMAGE_ARGS \
@ -100,20 +104,18 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
xz -0 -T4 "$PREFIX".img xz -0 -T4 "$PREFIX".img
mv output/seed.manifest "$PREFIX".manifest mv output/seed.manifest "$PREFIX".manifest
else else
# First we need to build the gadget tree env SNAPPY_STORE_NO_CDN=1 \
make -C "config/$PREFIX-gadget" \
ARCH=$ARCH SERIES=$SUITE $GADGET_TARGET
ubuntu-image classic $UBUNTU_IMAGE_ARGS \ ubuntu-image classic $UBUNTU_IMAGE_ARGS \
-s $SUITE -p $PROJECT -a $ARCH --subarch $SUBARCH \ -O output "$PREFIX".yaml
-O output config/$PREFIX-gadget/install # Since the output of the ubuntu-image call can vary based on what
# XXX: currently we only have one image generated, but really # kind of an image we build, the safest bet is to 'export' all the
# we should be supporting more than one for models that # artifacts from the output directory. The image definition file
# define those. # should be what defines what is expected, so that we don't have
mv output/*.img "$PREFIX".img # to tweak livecd-rootfs everytime a different type of artifact
xz -0 -T4 "$PREFIX".img # is needed.
# Also link the output image to a filename that cdimage expects for artifact in output/*; do
ln "$PREFIX".img.xz livecd.ubuntu-cpc.disk1.img.xz mv $artifact $PREFIX.$(basename $artifact)
mv output/filesystem.manifest "$PREFIX".manifest done
fi fi
exit 0 exit 0

@ -333,8 +333,10 @@ _get_live_passes ()
if [ -z "${IMAGEFORMAT:-}" ]; then if [ -z "${IMAGEFORMAT:-}" ]; then
case $PROJECT:${SUBPROJECT:-} in case $PROJECT:${SUBPROJECT:-} in
ubuntu-cpc:*|ubuntu:desktop-preinstalled|ubuntu-wsl:*) ubuntu-cpc:*|ubuntu:desktop-preinstalled|ubuntu-wsl:*)
case $SUBARCH in case $ARCH+${SUBARCH:-} in
raspi|intel-iot) *+raspi|riscv64+?*)
# All raspi and RISC-V images that *have* a SUBARCH will now
# use ubuntu-image.
IMAGEFORMAT=ubuntu-image IMAGEFORMAT=ubuntu-image
;; ;;
*) *)
@ -342,25 +344,15 @@ if [ -z "${IMAGEFORMAT:-}" ]; then
;; ;;
esac esac
;; ;;
ubuntu-base:*)
IMAGEFORMAT=ubuntu-image
;;
ubuntu-server:live) ubuntu-server:live)
IMAGEFORMAT=plain IMAGEFORMAT=plain
;; ;;
esac esac
fi fi
# Configure preinstalled ubuntu-cpc images with included password
# one also must request disk1-img-xz image format
if [ "$IMAGEFORMAT" = "ext4" ] && [ "$PROJECT" = "ubuntu-cpc" ]; then
case $ARCH:$SUBARCH in
armhf:raspi2|riscv64:sifive_*|riscv64:nezha|riscv64:visionfive|riscv64:licheerv|riscv64:icicle|*:generic)
IMAGE_HAS_HARDCODED_PASSWORD=1
if [ -z "${IMAGE_TARGETS:-}" ]; then
export IMAGE_TARGETS="disk1-img-xz"
fi
;;
esac
fi
skip_lb_stage() { skip_lb_stage() {
STAGE="$1" STAGE="$1"
mkdir -p .build mkdir -p .build
@ -496,37 +488,13 @@ case $IMAGEFORMAT in
else else
# classic images # classic images
# Certain models have different names but are built from the same source gadget tree DEFINITION="$PROJECT-$MODEL.yaml"
case $MODEL in
pi-arm64|pi3-arm64)
MODEL=pi
;;
intel-iot)
MODEL=pc
;;
esac
GADGET_TARGET="server"
if [ "$SUBPROJECT" = "desktop-preinstalled" ]; then
GADGET_TARGET="desktop"
fi
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${SUBPROJECT:+ --subproject \"$SUBPROJECT\"}"
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${PROPOSED:+ --with-proposed}"
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${EXTRA_PPAS:+ --extra-ppas \"$EXTRA_PPAS\"}"
# We need to look in two places for the gadget tree: git clone git://git.launchpad.net/ubuntu-images -b $SERIES image-definitions
# - Launchpad hosted gadgets will be in the snap-gadget repo cp image-definitions/$DEFINITION "$PREFIX".yaml
# - Github hosted gadgets are mirrored into a github-mirror repo echo "Configured ubuntu-image for the following image-definition:"
BRANCH="classic" cat "$PREFIX".yaml
git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/snap-$MODEL -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror-$ARCH -b $BRANCH config/$PREFIX-gadget echo "----------------------------------------------------------"
echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
echo "SUITE=$SUITE" >> config/common
echo "GADGET_TARGET=$GADGET_TARGET" >> config/common
echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common
echo "Configured ubuntu-image for the following gadget model: $MODEL"
fi fi
# Save the model name used for building, mostly for any model-specific hook execution # Save the model name used for building, mostly for any model-specific hook execution

Loading…
Cancel
Save