Add new template for debian trixie without luks encryption; fix disk resizing on first boot; set default user and ssh keys for cloud init

This commit is contained in:
Philip Henning 2026-05-11 17:50:49 +02:00
parent 775215f230
commit e57f2d977b
19 changed files with 2341 additions and 17 deletions

View file

@ -114,7 +114,7 @@ build {
inline = [
"export DEBIAN_FRONTEND=noninteractive",
"apt-get update",
"apt-get install -y age apt-transport-https aria2 bat bc bmon btop ca-certificates curl duf eza fastfetch fzf git gnupg htop iftop iotop iperf jq lsof magic-wormhole mosh mtr ncdu parted progress pv ripgrep rsync smartmontools socat sudo tmux usbutils vim wget yq zsh zstd"
"apt-get install -y age apt-transport-https aria2 bat bc bmon btop ca-certificates curl duf eza fastfetch fzf gdisk git gnupg htop iftop iotop iperf jq lsof magic-wormhole mosh mtr ncdu parted progress pv ripgrep rsync smartmontools socat sudo tmux usbutils vim wget yq zsh zstd"
]
}

View file

@ -279,6 +279,28 @@ refresh_partition_table() {
fi
}
repair_gpt_backup_header() {
local disk="$1"
if command -v sgdisk >/dev/null 2>&1; then
if sgdisk -e "$disk" >/dev/null 2>&1; then
refresh_partition_table "$disk"
return 0
fi
fi
if parted -s "$disk" print >/dev/null 2>&1; then
return 0
fi
if printf 'Fix\n' | parted ---pretend-input-tty "$disk" print >/dev/null 2>&1; then
refresh_partition_table "$disk"
return 0
fi
return 1
}
wait_for_partition_growth() {
local part="$1"
local old_bytes="$2"
@ -436,6 +458,10 @@ resize_lvm_on_luks() {
log_info "Disk: ${DISK_DEV} | Partition number: ${PART_NUM}"
[ -n "$LUKS_NAME" ] && log_info "LUKS mapper name: ${LUKS_NAME}"
if ! repair_gpt_backup_header "$DISK_DEV"; then
log_warn "Unable to repair or verify GPT backup header on ${DISK_DEV}; resize may fail."
fi
if ! is_last_partition_on_disk "$DISK_DEV" "$PART_NUM"; then
log_warn "Partition ${PART_NUM} is not the last partition on ${DISK_DEV}. Automatic growth is skipped."
return 0