2019-09-10 19:00:07 +00:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
2019-09-16 17:00:05 +00:00
|
|
|
. /root/config/chroot
|
2019-09-10 19:00:07 +00:00
|
|
|
|
|
|
|
# Specific ubuntu-image chroot configuration goes here.
|
2019-09-20 03:00:05 +00:00
|
|
|
# Currently the none IMAGEFORMAT is equivalent to building a rootfs for an image
|
2019-09-10 19:00:07 +00:00
|
|
|
# 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.
|
2019-09-20 03:00:05 +00:00
|
|
|
if [ "$IMAGEFORMAT" == "none" ]; then
|
2019-09-10 19:00:07 +00:00
|
|
|
# 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
|