xorriso
 zscaler
 first_install
 hostname
added:
  qemu script
  timzone
  realname
disabled systemd-networkd-wait-online
This commit is contained in:
Zsolt Alföldi
2026-02-28 11:50:21 +01:00
parent 6bce4f9cf1
commit f35fc00243
4 changed files with 56 additions and 7 deletions

View File

@@ -138,17 +138,21 @@ GRUBENTRY
mv "$WORK_DIR/grub_merged.cfg" "$GRUB_CFG"
fi
EFI_LINE=$(fdisk -l "$UBUNTU_ISO" | grep "EFI System")
EFI_START=$(echo "$EFI_LINE" | awk '{print $(NF-5)}')
EFI_END=$(echo "$EFI_LINE" | awk '{print $(NF-4)}')
EFI_COUNT=$((EFI_END - EFI_START + 1))
# ── Repack ISO ─────────────────────────────────────────────────────────────────
info "Repacking ISO → $OUTPUT_ISO ..."
xorriso -as mkisofs \
-r -V "Ubuntu-AutoInstall" -o "$OUTPUT_ISO" \
-J -joliet-long \
--grub2-mbr "$WORK_DIR/mbr_template.bin" \
--grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt,zero_gpt:"$UBUNTU_ISO" \
--protective-msdos-label \
-partition_offset 16 \
--mbr-force-bootable \
-append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b \
--interval:local_fs:1s-300s::"$UBUNTU_ISO" \
--interval:local_fs:${EFI_START}d-${EFI_END}d::"$UBUNTU_ISO" \
-appended_part_as_gpt \
-iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
-c '/boot.catalog' \
@@ -156,8 +160,9 @@ xorriso -as mkisofs \
-no-emul-boot -boot-load-size 4 -boot-info-table \
--grub2-boot-info \
-eltorito-alt-boot \
-e '--interval:appended_partition_2:::' \
-e "--interval:appended_partition_2_start_${EFI_START}s_size_${EFI_COUNT}d:all::" \
-no-emul-boot \
-boot-load-size $EFI_COUNT \
"$WORK_DIR/iso"
info "Done! ✓"

View File

@@ -127,7 +127,7 @@ function displaylink_driver() {
}
function zscaler() {
apt install /home/${TARGET_USER}/zscaler-client_3.7.1.71-1_amd64.deb -y
apt install /home/${TARGET_USER}/nocloud/zscaler-client_3.7.1.71-1_amd64.deb -y
echo zscaler >>/tmp/installer
}

31
qemu.sh Normal file
View File

@@ -0,0 +1,31 @@
set -ex
last_autoinstaller=$(ls -t1 autoinstall-2026* | head -n1)
echo " ....... $last_autoinstaller"
sleep 1
# qemu-system-x86_64 \
# -m 2048 \
# -enable-kvm \
# -drive file=${last_autoinstaller},format=raw,if=none,id=usbdisk \
# -device usb-ehci \
# -device usb-storage,drive=usbdisk \
# -bios /usr/share/ovmf/OVMF.fd
_cdrom=""
if [[ "$1" = "cdrom" ]]; then
_cdrom="-drive file=${last_autoinstaller},format=raw,if=none,id=usbdisk
-device usb-ehci \
-device usb-storage,drive=usbdisk \
"
fi
# Create a virtual disk first
# qemu-img create -f qcow2 /tmp/test-disk.qcow2 20G
# Boot the ISO as USB with the virtual disk as install target
qemu-system-x86_64 \
-m 4096 \
-enable-kvm \
-drive file=/tmp/test-disk.qcow2,format=qcow2 $_cdrom \
-bios /usr/share/ovmf/OVMF.fd

View File

@@ -1,6 +1,7 @@
#cloud-config
autoinstall:
version: 1
timezone: Europe/Budapest
# Network configuration Ethernet + optional WiFi
network:
@@ -14,8 +15,9 @@ autoinstall:
# ─── IDENTITY ──────────────────────────────────────────────────────────────
identity:
hostname: nokia
hostname: nokia-l13g4-sisu
username: alfoldi
realname: "Zsolt Alfoldi"
password: "${USER_PASSWORD_HASH}"
# ─── SSH ───────────────────────────────────────────────────────────────────
@@ -66,6 +68,17 @@ autoinstall:
encoding: b64
content: "${NOKIA_CLIENT_KEY_B64}"
- path: /home/${TARGET_USER}/first_install.sh
permissions: "0755"
owner: ${TARGET_USER}:${TARGET_USER}
content: |
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
chown ${TARGET_USER}:${TARGET_USER} -R /home/${TARGET_USER}/nocloud/
bash -x /home/${TARGET_USER}/nocloud/post-install.sh main
# - path: /etc/himmelblau/himmelblau.conf
# owner: ${TARGET_USER}:${TARGET_USER}
# content: |
@@ -178,7 +191,7 @@ autoinstall:
- bash -x /cdrom/nocloud/wifi.sh
- mkdir -p /target/home/${TARGET_USER}/nocloud
- cp /cdrom/nocloud/* /target/home/${TARGET_USER}/nocloud/
- chown ${TARGET_USER}:${TARGET_USER} -R /target/home/${TARGET_USER}/nocloud/
- curtin in-target -- systemctl disable systemd-networkd-wait-online.service
updates: all
shutdown: poweroff