Skip to content

Commit

Permalink
[custom] install.site - fix #5789 and reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
hcartiaux committed Oct 8, 2024
1 parent c4bcd42 commit 613c13a
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions custom/install.site
Original file line number Diff line number Diff line change
Expand Up @@ -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.*

Expand Down

0 comments on commit 613c13a

Please sign in to comment.