From de40b1e69eaabac3ca01774fa3a4e7abc463ac7c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 3 Oct 2026 08:52:49 -0700 Subject: Customize the disk layout via disklabel templates --- build-hcloud-snapshot.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'build-hcloud-snapshot.sh') diff --git a/build-hcloud-snapshot.sh b/build-hcloud-snapshot.sh index 00ec32d..aff6c1c 100755 --- a/build-hcloud-snapshot.sh +++ b/build-hcloud-snapshot.sh @@ -12,7 +12,7 @@ set -o nounset set -o errexit export PACKER_LOG=1 -SCRIPTDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) +_SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd) VERSION=7.9 ARCH=amd64 @@ -20,9 +20,9 @@ SSH_KEY="default-key" main() ( parse_args "$@" - img_path="${SCRIPTDIR}/openbsd-image/build/openbsd-${VERSION}-${ARCH}.raw" + img_path="${_SCRIPT_DIR}/openbsd-image/build/openbsd-${VERSION}-${ARCH}.raw" build_compressed_image "$img_path" - cd "$SCRIPTDIR/hcloud-snapshot/" + cd "$_SCRIPT_DIR/hcloud-snapshot/" packer init . packer build \ -var "hcloud_token=${HCLOUD_TOKEN:?}" \ @@ -36,6 +36,10 @@ main() ( parse_args() { while [ $# -gt 0 ]; do case "$1" in + -h | --help) + usage + exit 0 + ;; --version) VERSION="$2" shift 2 @@ -56,6 +60,22 @@ parse_args() { done } +usage() { + cat <