Skip to content

Commit

Permalink
openbsd: run cloud-init from /etc/rc.local
Browse files Browse the repository at this point in the history
Do not modify the system /etc/rc.
  • Loading branch information
goneri committed Dec 4, 2021
1 parent c82180e commit 4b8a95f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/package/cloud-init/tasks/77-cloud-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ done
chroot $TARGET ldconfig /usr/local/lib
PKG_PATH="https://mirror.csclub.uwaterloo.ca/pub/OpenBSD/${OS_VERSION}/packages/amd64/" chroot $TARGET sh -c 'cd /tmp/cloud-init; ./tools/build-on-openbsd'

gsed -i "/^echo 'starting network'/i \/usr\/local\/bin\/cloud-init --debug init -l" $TARGET/etc/rc
gsed -i "/^reorder_libs$/i \/usr\/local\/bin\/cloud-init --debug init" $TARGET/etc/rc
gsed -i "/.*rc.local.*/i \/usr\/local\/bin\/cloud-init --debug modules --mode config" $TARGET/etc/rc
gsed -i "/^date/i \/usr\/local\/bin\/cloud-init --debug modules --mode final" $TARGET/etc/rc

cat $TARGET/etc/rc
echo "#!/bin/sh" > $TARGET/etc/rc.local
echo "/usr/local/bin/cloud-init --debug init -l" >> $TARGET/etc/rc.local
echo "/usr/local/bin/cloud-init --debug init" >> $TARGET/etc/rc.local
echo "/usr/local/bin/cloud-init --debug modules --mode config" >> $TARGET/etc/rc.local
echo "/usr/local/bin/cloud-init --debug modules --mode final" >> $TARGET/etc/rc.local
echo "exit 0" >> $TARGET/etc/rc.local

rm -r $TARGET/tmp/cloud-init

0 comments on commit 4b8a95f

Please sign in to comment.