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:
parent
775215f230
commit
e57f2d977b
19 changed files with 2341 additions and 17 deletions
26
debian/13-trixie-luks/files/initial-setup.sh
vendored
26
debian/13-trixie-luks/files/initial-setup.sh
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue