- go-schroot-build is http://paste.ubuntu.com/16706114/
- lxc-chroot is http://paste.ubuntu.com/16705984/
- the schroot 'cidev' has been prepped to build cloud-init
deb="/tmp/cloud-init_all.deb"
UNCOMMITTED=1 ./packages/bddeb -S && rm -Rf ../build/ &&
schroot -rc cidev -- ../go-schroot-build cloud-init.dsc ../build -us -uc && cp cloud-init_all.deb "$deb"
lxc init xenial x1
lxc-chroot x1 -- sh -ec 'd=/tmp/my.deb; trap "rm -f $d" EXIT; cat > $d && dpkg -i $d' < "$deb"
add a seed datasource and clean others. The example path here is in https://code.launchpad.net/~smoser/+junk/cloudinit-ds-test/
dsdir=$HOME/src/cloud-init/cloudinit-ds-test/tests/config-drive/network_json_and_interfaces/local/configdrive/
tar -C "$dsdir" -cf - . |
lxc-chroot x1 -- sh -ec \
'vlc=/var/lib/cloud; sdir=$vlc/seed/config_drive;
rm -Rf $vlc && mkdir -p $sdir && tar -C "$sdir" -xvf -'
lxc-chroot x1 -- sed -i "/[*]log_syslog/s/^[^#]/#/" /etc/cloud/cloud.cfg.d/05_logging.cfg
lxc start x1
- remove cloud-iinit things other than seed for rapid testing rm -Rf /var/lib/cloud/{data,handlers,instance,instances,scripts,sem} /var/log/cloud-init*.log
- add a nic to a container (y1) with name some-name2 lxc config device add y1 some-name2 nic nictype=bridged parent=lxdbr0 name=eth1
- remove nic lxc config device remove y1 some-name2