Fix USB install reliability: bash, LV resize, deps, idempotency
- autoinstall/user-data: move lvextend/growpart/pvresize BEFORE playbook so 130GB of drivers+PPKGs fits during first-boot copy. Use tr -d "[:space:]" to avoid breaking outer bash -c single-quote wrap. - playbook: add executable: /bin/bash to Dell driver deploy (process substitution) and Blancco initramfs builder (brace expansion). - playbook: make "Ensure Samba user for Blancco reports" idempotent via pdbedit check so re-runs don't abort the play. - download-packages.sh: also download dist-upgrade package set. Explicit --simulate misses transitive version bumps (e.g. gnupg 17.4 needs matching gpgv 17.4) causing offline dpkg "dependency problems" when ISO baseline is older than noble-updates.
This commit is contained in:
@@ -72,6 +72,16 @@ autoinstall:
|
||||
curtin in-target --target=/target -- bash -c '
|
||||
cat <<"EOF" > /opt/first-boot.sh
|
||||
#!/bin/bash
|
||||
# Expand root LV to full disk BEFORE playbook (playbook copies ~130GB of drivers+PPKGs)
|
||||
ROOT_DEV=$(findmnt -n -o SOURCE /)
|
||||
ROOT_DISK=$(lsblk -n -o PKNAME "$(readlink -f "$ROOT_DEV")" | tail -1)
|
||||
PV_PART=$(pvs --noheadings -o pv_name 2>/dev/null | tr -d "[:space:]" | head -1)
|
||||
if [ -n "$ROOT_DISK" ] && [ -n "$PV_PART" ]; then
|
||||
PART_NUM=$(echo "$PV_PART" | grep -o "[0-9]*$")
|
||||
growpart "/dev/${ROOT_DISK}" "${PART_NUM}" 2>&1 || true
|
||||
pvresize "$PV_PART" 2>&1 || true
|
||||
fi
|
||||
lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv 2>&1 || true
|
||||
CIDATA_DEV=$(blkid -L CIDATA)
|
||||
if [ -n "$CIDATA_DEV" ]; then
|
||||
mkdir -p /mnt/usb
|
||||
@@ -88,7 +98,6 @@ autoinstall:
|
||||
umount /mnt/usb
|
||||
fi
|
||||
sed -i "s|^/opt/first-boot.sh.*|# &|" /etc/rc.local
|
||||
lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv || true
|
||||
EOF
|
||||
chmod +x /opt/first-boot.sh
|
||||
'
|
||||
|
||||
Reference in New Issue
Block a user