Merge branch 'develop'

This commit is contained in:
2025-07-23 01:28:30 +02:00
2 changed files with 34 additions and 11 deletions

View File

@ -55,7 +55,11 @@ compare_checksum()
CHECKSUM_TMP_FOLDER=$(mktemp) CHECKSUM_TMP_FOLDER=$(mktemp)
curl -s -o "${CHECKSUM_TMP_FOLDER}" "${VM_CHECKSUMS_URL}" curl -s -o "${CHECKSUM_TMP_FOLDER}" "${VM_CHECKSUMS_URL}"
if [[ "$VM_OS_TYPE" == "freebsd" ]]; then if [[ "$VM_OS_TYPE" == "freebsd" ]]; then
VM_BASE_IMAGE_CHECKSUM=$(grep "FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT" "${CHECKSUM_TMP_FOLDER}" | grep "ufs.qcow2.xz" | awk '{print $4}') if [[ "${VM_BASE_IMAGE}" == *"zfs"* ]]; then
VM_BASE_IMAGE_CHECKSUM=$(grep "FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT" "${CHECKSUM_TMP_FOLDER}" | grep "zfs.qcow2.xz" | awk '{print $4}')
else
VM_BASE_IMAGE_CHECKSUM=$(grep "FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT" "${CHECKSUM_TMP_FOLDER}" | grep "ufs.qcow2.xz" | awk '{print $4}')
fi
else else
VM_BASE_IMAGE_CHECKSUM=$(grep "$VM_BASE_IMAGE_NAME.${VM_BASE_IMAGE_EXTENSION}" "${CHECKSUM_TMP_FOLDER}" | awk '{print $1}') VM_BASE_IMAGE_CHECKSUM=$(grep "$VM_BASE_IMAGE_NAME.${VM_BASE_IMAGE_EXTENSION}" "${CHECKSUM_TMP_FOLDER}" | awk '{print $1}')
fi fi
@ -192,7 +196,11 @@ vm_delete ()
vm_download_base_image() vm_download_base_image()
{ {
if [[ "$VM_OS_TYPE" == "freebsd" ]]; then if [[ "$VM_OS_TYPE" == "freebsd" ]]; then
VM_BASE_IMAGE_NAME="${VM_OS_VARIANT}" if [[ "${VM_BASE_IMAGE}" == *"zfs"* ]]; then
VM_BASE_IMAGE_NAME="${VM_OS_VARIANT}-zfs"
else
VM_BASE_IMAGE_NAME="${VM_OS_VARIANT}-ufs"
fi
VM_BASE_IMAGE_EXTENSION="qcow2.xz" VM_BASE_IMAGE_EXTENSION="qcow2.xz"
else else
VM_BASE_IMAGE_NAME=${VM_BASE_IMAGE%%.*} VM_BASE_IMAGE_NAME=${VM_BASE_IMAGE%%.*}
@ -251,18 +259,23 @@ VM_ROOT_PASS_HASH=$(mkpasswd --method=SHA-512 --rounds=4096 ${VM_ROOT_PASS})
cat <<EOF > "$VM_BASE_DIR/init/${VM_HOSTNAME}-user-data" cat <<EOF > "$VM_BASE_DIR/init/${VM_HOSTNAME}-user-data"
#cloud-config #cloud-config
hostname: ${VM_HOSTNAME} hostname: ${VM_HOSTNAME}
package_reboot_if_required: true
package_update: true
package_upgrade: true
packages:
- sudo
- vim
ssh_pwauth: false
users: users:
- name: root - name: root
lock_passwd: false lock_passwd: false
hashed_passwd: ${VM_ROOT_PASS} hashed_passwd: ${VM_ROOT_PASS_HASH}
ssh_pwauth: false
- name: ${VM_USERNAME} - name: ${VM_USERNAME}
ssh_authorized_keys: ssh_authorized_keys:
- ${SSH_PUB_KEY}. - ${SSH_PUB_KEY}
hashed_passwd: ${VM_USER_PASS} lock_passwd: true
groups: wheel groups: wheel
ssh_pwauth: true shell: /bin/tcsh
write_files: write_files:
- path: /usr/local/etc/sudoers - path: /usr/local/etc/sudoers
content: | content: |
@ -343,5 +356,6 @@ vm_guest_install()
eval virt-install $VM_INSTALL_OPTS eval virt-install $VM_INSTALL_OPTS
virsh dumpxml "${VM_HOSTNAME}" > "${VM_BASE_DIR}/xml/${VM_HOSTNAME}.xml" virsh dumpxml "${VM_HOSTNAME}" > "${VM_BASE_DIR}/xml/${VM_HOSTNAME}.xml"
echo "Root password: $VM_ROOT_PASS"
echo "User password: $VM_USER_PASS"
} }

View File

@ -73,12 +73,21 @@
} , } ,
{ {
"id": 8, "id": 8,
"name": "FreeBSD 14.3", "name": "FreeBSD 14.3 UFS",
"os_type": "freebsd", "os_type": "freebsd",
"variant": "freebsd14.2", "variant": "freebsd14.2",
"url": "https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.3-STABLE/amd64/Latest/FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT-ufs.qcow2.xz", "url": "https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.3-STABLE/amd64/Latest/FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT-ufs.qcow2.xz",
"origin_image_name": "FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT-ufs.qcow2.xz", "origin_image_name": "FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT-ufs.qcow2.xz",
"md5sum": "https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.3-STABLE/amd64/Latest/CHECKSUM.SHA512" "md5sum": "https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.3-STABLE/amd64/Latest/CHECKSUM.SHA512"
} } ,
{
"id": 9,
"name": "FreeBSD 14.3 ZFS",
"os_type": "freebsd",
"variant": "freebsd14.2",
"url": "https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.3-STABLE/amd64/Latest/FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT-zfs.qcow2.xz",
"origin_image_name": "FreeBSD-14.3-STABLE-amd64-BASIC-CLOUDINIT-zfs.qcow2.xz",
"md5sum": "https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.3-STABLE/amd64/Latest/CHECKSUM.SHA512"
}
] ]
} }