Backport support for building core images with ubuntu-image.

core-include-dmsetup
Łukasz 'sil2100' Zemczak 6 years ago
parent 11a9a25fbb
commit 706685a5a2

10
debian/changelog vendored

@ -1,3 +1,13 @@
livecd-rootfs (2.408.38) UNRELEASED; urgency=medium
* Backport support for building ubuntu-core images with ubuntu-image (using
IMAGEFORMAT=ubuntu-image).
* Decide what model assertion series to fetch depending on the suite. Use 16
for xenial and 18 for other series (bionic+). This enables core18 image
builds.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 04 Oct 2018 19:30:17 +0200
livecd-rootfs (2.408.37) xenial; urgency=medium
* debian/dirs: add debian/dirs entry for empty includes.chroot dir

1
debian/control vendored

@ -30,6 +30,7 @@ Depends: ${misc:Depends},
python3-software-properties,
qemu-utils,
rsync,
snapd,
squashfs-tools (>= 1:3.3-1),
vmdk-stream-converter [amd64 i386],
xz-utils,

@ -10,6 +10,28 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
if [ -z "${PROJECT:-}" ]; then
echo "PROJECT environment variable has to be set" >&2
exit 1
fi
. config/functions
# Link output files somewhere BuildLiveCD will be able to find them.
PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
# Use ubuntu-image instead of live-build
CHANNEL="${CHANNEL:-edge}"
env SNAPPY_STORE_NO_CDN=1 \
ubuntu-image -c "$CHANNEL" $UBUNTU_IMAGE_ARGS \
-o "$PREFIX".img "$PREFIX".model-assertion
xz -0 -T4 "$PREFIX".img
mv seed.manifest "$PREFIX".manifest
exit 0
fi
# Setup cleanup function
Setup_cleanup

@ -96,6 +96,7 @@ LIVE_TASK=
PREINSTALLED=false
PREINSTALL_POOL=
PREINSTALL_POOL_SEEDS=
PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
CHROOT_HOOKS=
BINARY_HOOKS=
@ -144,6 +145,51 @@ case $IMAGEFORMAT in
PREINSTALLED=true
;;
ubuntu-image)
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
case $MODEL in
pc-amd64|pc-i386)
UBUNTU_IMAGE_ARGS="--image-size 3700M" ;;
*)
UBUNTU_IMAGE_ARGS="" ;;
esac
case $SUITE in
xenial)
CORE_SERIES=16 ;;
*)
CORE_SERIES=18 ;;
esac
echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> 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=$CORE_SERIES model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion
echo "Configured ubuntu-image for the following model assertion:"
cat "$PREFIX".model-assertion
echo "----------------------------------------------------------"
# Fake finished configuration for lb build
mkdir -p .build
touch .build/config
exit 0
;;
none)
OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT"
;;

Loading…
Cancel
Save