diff --git a/Alma.sh b/Alma.sh new file mode 100755 index 0000000..cdd8731 --- /dev/null +++ b/Alma.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +cd "$(dirname "$0")" && source ./lib.sh + +VM_ID=5000 +VM_NAME="AlmaLinux-9" +CPU_CORE=2 +CPU_SOCKET=1 +RAM=4096 +DISK=30 +IMAGE_URL="https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2" +PACKAGES="" +DOCKER=0 +# Alma keeps root on partition 4 with XFS +GROW_CMD="growpart /dev/sda 4 && xfs_growfs /" + +build_template diff --git a/README.md b/README.md index f7dba5e..cab17f9 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ The older per-distro scripts are still here. `./all.sh` builds them all, or run | Ubuntu-LTS-Small.sh | 2000 | no | | Ubuntu-LTS-Medium.sh | 3000 | yes | | Ubuntu-LTS-Large.sh | 4000 | yes | +| Alma.sh (AlmaLinux 9, for FreeIPA) | 5000 | no | | Debian.sh (Debian 13) | 9998 | yes | | Ubuntu-22-04-LTS.sh | 9999 | yes | diff --git a/all.sh b/all.sh index 928f161..17f6445 100755 --- a/all.sh +++ b/all.sh @@ -3,6 +3,7 @@ set -e cd "$(dirname "$0")" ./Debian.sh +./Alma.sh ./Ubuntu-LTS-Small.sh ./Ubuntu-LTS-Medium.sh ./Ubuntu-LTS-Large.sh diff --git a/lib.sh b/lib.sh index b3ec129..6bdb929 100755 --- a/lib.sh +++ b/lib.sh @@ -5,6 +5,7 @@ # IMAGE_URL - cloud image to start from # PACKAGES - extra apt packages, comma separated # DOCKER=1 - install Docker from get.docker.com +# GROW_CMD - grows the root fs (default: ext4 on sda1) # # Override where it lands with environment variables: # STORAGE=ssd BRIDGE=vmbr1 ./Ubuntu-LTS-Small.sh @@ -30,9 +31,9 @@ build_template() { cp "$IMAGE_DIR/$(basename "$IMAGE_URL")" "$disk" # The cloud image's root filesystem is only ~2 GB, too small for Docker. - # Grow the image by 4 GB and the root partition (sda1) with it. + # Grow the image by 4 GB and the root partition with it. qemu-img resize -q "$disk" +4G - virt-customize -a "$disk" --run-command "growpart /dev/sda 1 && resize2fs /dev/sda1" + virt-customize -a "$disk" --run-command "${GROW_CMD:-growpart /dev/sda 1 && resize2fs /dev/sda1}" # Guest agent, extra packages, optional Docker, and an empty machine-id so clones get their own DHCP lease virt-customize -a "$disk" --install "qemu-guest-agent${PACKAGES:+,$PACKAGES}"