diff --git a/custom/install.site b/custom/install.site index 2a914f1..56c7e70 100755 --- a/custom/install.site +++ b/custom/install.site @@ -30,27 +30,39 @@ wget "https://github.com/canonical/cloud-init/archive/refs/tags/${CLOUD_INIT_VER tar xzf ${CLOUD_INIT_VERSION}.tar.gz cd "cloud-init-${CLOUD_INIT_VERSION}" -echo "Installing cloud-init" -./tools/build-on-openbsd -rm -f /etc/rc.local +# Patching cloud-init bugs -# Temporary fix -sed -i '/rc_bg=/d' /etc/rc.d/cloud* +# Cloud-init 24.3.1 is broken on OpenBSD without this hack. +# Should be solved by PR #5770. See #5781 for explanations: +# https://github.com/canonical/cloud-init/pull/5781 +sed -i '112d' cloudinit/cmd/main.py +# Fix wrong hardcoded path, see #5789 +sed -i 's!_ROOT_TMPDIR = "/run/cloud-init/tmp"!_ROOT_TMPDIR = "/var/run/cloud-init/tmp"!' cloudinit/temp_utils.py + +# Fix sysvinit scripts, included in PR #5790 +sed -i '/rc_bg=/d' sysvinit/openbsd/cloud* + + +####################### +# Installing cloud-init +./tools/build-on-openbsd +####################### + +# Enable cloud-init services, see PR #5790 rcctl enable cloudinitlocal rcctl enable cloudinit rcctl enable cloudconfig rcctl enable cloudfinal +# rc.local should not be used anymore, see PR #5790 +rm -f /etc/rc.local + + cd /tmp rm -r "/tmp/cloud-init-${CLOUD_INIT_VERSION}" -# Cloud-init 24.3.1 is broken on OpenBSD without this hack. -# Should be solved by PR #5770. See #5781 for explanations: -# https://github.com/canonical/cloud-init/pull/5781 -sed -i '112d' /usr/local/lib/python3*/site-packages/cloud_init-*/cloudinit/cmd/main.py - # Clean-up the network config rm -f /etc/resolv.conf /etc/hostname.*