Backport the 999-ubuntu-image-customization changes, add a delta on top to still support the old legacy raspi2 images.

sil2100/backport-datasource-raspi3
Łukasz 'sil2100' Zemczak 5 years ago
parent f8dd8502ce
commit ce1b1cf815

5
debian/changelog vendored

@ -2,8 +2,11 @@ livecd-rootfs (2.525.32) UNRELEASED; urgency=medium
* Fix a terrible typo in auto/build that causes all core18 builds to fail on
this series (LP: #1849343).
* Backport 999-ubuntu-image-customization.chroot to have a common place for
our cloud-init datasource. Add some modifications on top to make sure the
legacy raspi2 configuration stays the same. (LP: #1849472)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 22 Oct 2019 17:09:57 +0200
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 22 Oct 2019 17:34:31 +0200
livecd-rootfs (2.525.31) bionic; urgency=medium

@ -930,6 +930,8 @@ echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary
echo "BUILDSTAMP=\"$NOW\"" >> config/binary
echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary
echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary
echo "IMAGEFORMAT=\"$IMAGEFORMAT\"" >> config/chroot
echo "SUBARCH=\"$SUBARCH\"" >> config/chroot
case $ARCH+$SUBARCH in
armhf+raspi2|armhf+raspi3|arm64+raspi3)

@ -142,22 +142,17 @@ fi
#### END COMMON ARCH FUNCTIONS
case $arch in
# ARM images are special
armhf|arm64)
# Dirty hack because SUBARCH doesn't exist when running chroot hooks,
# and we don't want raspi2 images to depend on a cloud data source:
if _xchroot "${rootd}" dpkg -l linux-image-raspi2 2>/dev/null | grep -q '^.i'; then
fake_cloud_init
fi
echo "Image architecture is ARM. Existing vmbuilder-fixups"
exit 0
;;
powerpc|ppc64el|s390x)
exit 0
;;
case $arch+${SUBARCH:-} in
# raspi2 images are special
armhf+raspi2)
fake_cloud_init
echo "Image architecture is ARM. Existing vmbuilder-fixups"
exit 0
;;
armhf+*|arm64+*|powerpc+*|ppc64el+*|s390x+*)
exit 0
;;
esac
psuedo_grub_probe() {

@ -0,0 +1,23 @@
#!/bin/bash -ex
. /root/config/chroot
# Specific ubuntu-image chroot configuration goes here.
# Currently the none IMAGEFORMAT is equivalent to building a rootfs for an image
# for a physical device, not a cloud instance. For such images we want some
# special cloud-init configuration that should not be happening for cloud
# cases. This check should be changed to a per-MODEL/per-SUBARCH check once
# we support building cloud images via ubuntu-image.
if [ "$IMAGEFORMAT" == "none" ]; then
# If the cloud does not provide a meta-data service this should be run
# This will setup a nocloud datasource on the boot partition.
# This is the default behavior for our ubuntu-image built preinstalled
# images.
cat << EOF > /etc/cloud/cloud.cfg.d/99-fake_cloud.cfg
# configure cloud-init for NoCloud
datasource_list: [ NoCloud, None ]
datasource:
NoCloud:
fs_label: system-boot
EOF
fi
Loading…
Cancel
Save