Add AlmaLinux 9 template (Alma.sh), configurable root grow command
This commit is contained in:
1 parent
665eadc8d6
commit
b61de5de22
4 files changed
+21
-2
No files matched your search
@@ -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
|
||||||
@@ -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-Small.sh | 2000 | no |
|
||||||
| Ubuntu-LTS-Medium.sh | 3000 | yes |
|
| Ubuntu-LTS-Medium.sh | 3000 | yes |
|
||||||
| Ubuntu-LTS-Large.sh | 4000 | yes |
|
| Ubuntu-LTS-Large.sh | 4000 | yes |
|
||||||
|
| Alma.sh (AlmaLinux 9, for FreeIPA) | 5000 | no |
|
||||||
| Debian.sh (Debian 13) | 9998 | yes |
|
| Debian.sh (Debian 13) | 9998 | yes |
|
||||||
| Ubuntu-22-04-LTS.sh | 9999 | yes |
|
| Ubuntu-22-04-LTS.sh | 9999 | yes |
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
set -e
|
set -e
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
./Debian.sh
|
./Debian.sh
|
||||||
|
./Alma.sh
|
||||||
./Ubuntu-LTS-Small.sh
|
./Ubuntu-LTS-Small.sh
|
||||||
./Ubuntu-LTS-Medium.sh
|
./Ubuntu-LTS-Medium.sh
|
||||||
./Ubuntu-LTS-Large.sh
|
./Ubuntu-LTS-Large.sh
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
# IMAGE_URL - cloud image to start from
|
# IMAGE_URL - cloud image to start from
|
||||||
# PACKAGES - extra apt packages, comma separated
|
# PACKAGES - extra apt packages, comma separated
|
||||||
# DOCKER=1 - install Docker from get.docker.com
|
# 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:
|
# Override where it lands with environment variables:
|
||||||
# STORAGE=ssd BRIDGE=vmbr1 ./Ubuntu-LTS-Small.sh
|
# STORAGE=ssd BRIDGE=vmbr1 ./Ubuntu-LTS-Small.sh
|
||||||
@@ -30,9 +31,9 @@ build_template() {
|
|||||||
cp "$IMAGE_DIR/$(basename "$IMAGE_URL")" "$disk"
|
cp "$IMAGE_DIR/$(basename "$IMAGE_URL")" "$disk"
|
||||||
|
|
||||||
# The cloud image's root filesystem is only ~2 GB, too small for Docker.
|
# 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
|
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
|
# 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}"
|
virt-customize -a "$disk" --install "qemu-guest-agent${PACKAGES:+,$PACKAGES}"
|
||||||
|
|||||||
Reference in new issue
Block a user