fixed:
xorriso zscaler first_install hostname added: qemu script timzone realname disabled systemd-networkd-wait-online
This commit is contained in:
13
build-iso.sh
13
build-iso.sh
@@ -138,17 +138,21 @@ GRUBENTRY
|
|||||||
mv "$WORK_DIR/grub_merged.cfg" "$GRUB_CFG"
|
mv "$WORK_DIR/grub_merged.cfg" "$GRUB_CFG"
|
||||||
fi
|
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 ─────────────────────────────────────────────────────────────────
|
# ── Repack ISO ─────────────────────────────────────────────────────────────────
|
||||||
info "Repacking ISO → $OUTPUT_ISO ..."
|
|
||||||
xorriso -as mkisofs \
|
xorriso -as mkisofs \
|
||||||
-r -V "Ubuntu-AutoInstall" -o "$OUTPUT_ISO" \
|
-r -V "Ubuntu-AutoInstall" -o "$OUTPUT_ISO" \
|
||||||
-J -joliet-long \
|
-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 \
|
--protective-msdos-label \
|
||||||
-partition_offset 16 \
|
-partition_offset 16 \
|
||||||
--mbr-force-bootable \
|
--mbr-force-bootable \
|
||||||
-append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b \
|
-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 \
|
-appended_part_as_gpt \
|
||||||
-iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
|
-iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
|
||||||
-c '/boot.catalog' \
|
-c '/boot.catalog' \
|
||||||
@@ -156,8 +160,9 @@ xorriso -as mkisofs \
|
|||||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||||
--grub2-boot-info \
|
--grub2-boot-info \
|
||||||
-eltorito-alt-boot \
|
-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 \
|
-no-emul-boot \
|
||||||
|
-boot-load-size $EFI_COUNT \
|
||||||
"$WORK_DIR/iso"
|
"$WORK_DIR/iso"
|
||||||
|
|
||||||
info "Done! ✓"
|
info "Done! ✓"
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ function displaylink_driver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function zscaler() {
|
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
|
echo zscaler >>/tmp/installer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
31
qemu.sh
Normal file
31
qemu.sh
Normal 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
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#cloud-config
|
#cloud-config
|
||||||
autoinstall:
|
autoinstall:
|
||||||
version: 1
|
version: 1
|
||||||
|
timezone: Europe/Budapest
|
||||||
|
|
||||||
# Network configuration – Ethernet + optional Wi‑Fi
|
# Network configuration – Ethernet + optional Wi‑Fi
|
||||||
network:
|
network:
|
||||||
@@ -14,8 +15,9 @@ autoinstall:
|
|||||||
|
|
||||||
# ─── IDENTITY ──────────────────────────────────────────────────────────────
|
# ─── IDENTITY ──────────────────────────────────────────────────────────────
|
||||||
identity:
|
identity:
|
||||||
hostname: nokia
|
hostname: nokia-l13g4-sisu
|
||||||
username: alfoldi
|
username: alfoldi
|
||||||
|
realname: "Zsolt Alfoldi"
|
||||||
password: "${USER_PASSWORD_HASH}"
|
password: "${USER_PASSWORD_HASH}"
|
||||||
|
|
||||||
# ─── SSH ───────────────────────────────────────────────────────────────────
|
# ─── SSH ───────────────────────────────────────────────────────────────────
|
||||||
@@ -66,6 +68,17 @@ autoinstall:
|
|||||||
encoding: b64
|
encoding: b64
|
||||||
content: "${NOKIA_CLIENT_KEY_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
|
# - path: /etc/himmelblau/himmelblau.conf
|
||||||
# owner: ${TARGET_USER}:${TARGET_USER}
|
# owner: ${TARGET_USER}:${TARGET_USER}
|
||||||
# content: |
|
# content: |
|
||||||
@@ -178,7 +191,7 @@ autoinstall:
|
|||||||
- bash -x /cdrom/nocloud/wifi.sh
|
- bash -x /cdrom/nocloud/wifi.sh
|
||||||
- mkdir -p /target/home/${TARGET_USER}/nocloud
|
- mkdir -p /target/home/${TARGET_USER}/nocloud
|
||||||
- cp /cdrom/nocloud/* /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
|
updates: all
|
||||||
shutdown: poweroff
|
shutdown: poweroff
|
||||||
|
|||||||
Reference in New Issue
Block a user