From a4daf87a3497d4d85a02eb473afe3ec51e1fd8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rn=20=C3=85ne=20de=20Jong?= Date: Sun, 29 May 2022 16:29:43 +0200 Subject: [PATCH] Make cloudsetup version overrideable This is useful for applying hotfixes before the updated port lands in FreeBSD ports. --- opennebula-images/freebsd-build-opennebula-image.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/opennebula-images/freebsd-build-opennebula-image.sh b/opennebula-images/freebsd-build-opennebula-image.sh index 8051921..5161cbd 100755 --- a/opennebula-images/freebsd-build-opennebula-image.sh +++ b/opennebula-images/freebsd-build-opennebula-image.sh @@ -15,6 +15,10 @@ IMAGE_PATH_ZFS="freebsd-zfs-$RELEASE-$(date -I).img.qcow2" IMAGE_PATH_UFS="freebsd-ufs-$RELEASE-$(date -I).img.qcow2" IMAGE_SIZE=10G +# Comment out to simply use latest version +# Hash checking is disabled when specifying this +CLOUDSETUP_VERSION=1.1 + DIST_BASE="https://download.freebsd.org/ftp/releases/$ARCH/$RELEASE" ZPOOL=zroot ZPOOL_TMP="zinstalling" @@ -63,6 +67,12 @@ then else portsnap extract fi + +if [ -n "$CLOUDSETUP_VERSION" ] +then + sed -i .bak -e '/^PORTVERSION=/ s/[0-9]*\.[0-9]*/'"$CLOUDSETUP_VERSION/" /usr/ports/sysutils/firstboot-cloudsetup/Makefile + make -C /usr/ports/sysutils/firstboot-cloudsetup makesum +fi make -C /usr/ports/sysutils/firstboot-cloudsetup clean package CLOUDSETUP_VERSION="$(fgrep VERSION /usr/ports/sysutils/firstboot-cloudsetup/Makefile | cut -f2- | tr -d \\t)" CLOUDSETUP_PKG="/usr/ports/sysutils/firstboot-cloudsetup/work/pkg/firstboot-cloudsetup-${CLOUDSETUP_VERSION}.pkg"