Skip to content

Commit 96e3548

Browse files
committed
cloud-init: guess os version from the current kernel
1 parent 7f400ef commit 96e3548

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/package/cloud-init/tasks/77-cloud-init.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
OS_VERSION=$(sysctl -n kern.osrelease)
2+
13
git clone -b master http://github.com/goneri/cloud-init $TARGET/tmp/cloud-init
24

35
echo 'nameserver 8.8.8.8' > $TARGET/etc/resolv.conf
@@ -16,10 +18,10 @@ pkgs="
1618
sudo--
1719
"
1820
for pkg in ${pkgs}; do
19-
PKG_PATH="https://mirror.csclub.uwaterloo.ca/pub/OpenBSD/6.6/packages/amd64/" chroot $TARGET pkg_add ${pkg}
21+
PKG_PATH="https://mirror.csclub.uwaterloo.ca/pub/OpenBSD/${OS_VERSION}/packages/amd64/" chroot $TARGET pkg_add ${pkg}
2022
done
2123
chroot $TARGET ldconfig /usr/local/lib
22-
PKG_PATH="https://mirror.csclub.uwaterloo.ca/pub/OpenBSD/6.6/packages/amd64/" chroot $TARGET sh -c 'cd /tmp/cloud-init; ./tools/build-on-openbsd'
24+
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'
2325

2426
gsed -i "/^echo 'starting network'/i \/usr\/local\/bin\/cloud-init --debug init -l" $TARGET/etc/rc
2527
gsed -i "/^reorder_libs$/i \/usr\/local\/bin\/cloud-init --debug init" $TARGET/etc/rc

0 commit comments

Comments
 (0)