mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-23 11:21:12 +00:00
Import patches-unapplied version 2.377 to ubuntu/xenial-proposed
Imported using git-ubuntu import. Changelog parent: 0ae1111c558c96f1ddd7b15e79e3c179301a7ac5 New changelog entries: * live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot: Add fake_cloud_init function to create a nocloud data source for cloud images that aren't meant to be used on real clouds and use it by default on armhf+raspi2
This commit is contained in:
parent
0ae1111c55
commit
13d50e4fa1
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
||||
livecd-rootfs (2.377) xenial; urgency=medium
|
||||
|
||||
* live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot: Add fake_cloud_init
|
||||
function to create a nocloud data source for cloud images that aren't
|
||||
meant to be used on real clouds and use it by default on armhf+raspi2
|
||||
|
||||
-- Adam Conrad <adconrad@ubuntu.com> Sun, 14 Feb 2016 03:12:37 -0700
|
||||
|
||||
livecd-rootfs (2.376) xenial; urgency=medium
|
||||
|
||||
[ Michael Terry ]
|
||||
|
@ -50,6 +50,33 @@ EOF
|
||||
sed -i "s/CONDEV/${condev}/g" "$idir/${condev}.conf"
|
||||
}
|
||||
|
||||
fake_cloud_init() {
|
||||
# If the cloud does not provide a meta-data service this should be run
|
||||
# This will setup a nocloud datasource.
|
||||
|
||||
seed_d="${rootd}/var/lib/cloud/seed/nocloud-net"
|
||||
mkdir -p "${seed_d}"
|
||||
|
||||
# fake instance-id
|
||||
cat << EOF > "${seed_d}/meta-data"
|
||||
instance_id: cloud-image
|
||||
EOF
|
||||
|
||||
# fake user-data to create the default user/password
|
||||
cat << EOF > "${seed_d}/user-data"
|
||||
#cloud-config
|
||||
password: ubuntu
|
||||
chpasswd: ubuntu
|
||||
ssh_pwauth: True
|
||||
EOF
|
||||
|
||||
# tell cloud-init not to look for meta-data sources
|
||||
cat << EOF > ${rootd}/etc/cloud/cloud.cfg.d/99-fake_cloud.cfg
|
||||
# configure cloud-init for NoCloud
|
||||
datasource_list: [ NoCloud, None ]
|
||||
EOF
|
||||
}
|
||||
|
||||
## --------------
|
||||
# remove 127.0.1.1 entry (LP: #440757)
|
||||
_xchroot "${rootd}" sh -c 'sed -i "/^127.0.1.1/d" /etc/hosts'
|
||||
@ -132,6 +159,11 @@ case $arch in
|
||||
armhf|arm64)
|
||||
echo "Configuring ARM Serial Port"
|
||||
add_serial_console ttyAMA0
|
||||
# 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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user