Faster shopfloor-setup sync, prompt spacing, XP-era test client

- Deploy shopfloor-setup with rsync instead of the copy module: the
  ~4 GB tree took about 4 minutes on every re-run because copy checksums
  each file. rsync transfers only changes; changed only when it did.
- iPXE drops a trailing space, so 'Machine number:' ran into the typed
  digits. The space now comes from a hex 20 setting.
- tests/vm: pxetest-xp is a permanent client (SeaBIOS, qemu32 32-bit CPU,
  rtl8139, 1 GiB, IDE disk) for the i686 Clonezilla path; start.sh xp.
  Only one client may run at a time across all three.
This commit is contained in:
cproudlock
2026-10-15 21:43:33 -04:00
parent 23ee99a390
commit 576955785d
9 changed files with 98 additions and 29 deletions

View File

@@ -12,6 +12,10 @@
# pxetest-client 2 vCPU, 2 GiB, OVMF Secure Boot with MS keys, 1G blank
# disk, one NIC 52:54:00:9e:10:03 on pxetest-imaging,
# network boot first (UEFI IPv4 PXE).
# pxetest-client-nosb OVMF without Secure Boot, e1000e, 64G SATA disk.
# pxetest-xp XP/Win7-era PC: SeaBIOS (legacy PXE), qemu32 CPU
# (32-bit only), 1 GiB, rtl8139 52:54:00:9e:10:05,
# 8G IDE disk.
#
# Usage: tests/vm/create.sh
source "$(dirname "$0")/common.sh"
@@ -51,6 +55,10 @@ if ! vol_exists "$CLIENT_DISK_VOL"; then
virsh vol-create-as "$POOL" "$CLIENT_DISK_VOL" 1G --format qcow2 >/dev/null
log "created $CLIENT_DISK_VOL (1G blank)"
fi
if ! vol_exists "$CLIENT3_DISK_VOL"; then
virsh vol-create-as "$POOL" "$CLIENT3_DISK_VOL" 8G --format qcow2 >/dev/null
log "created $CLIENT3_DISK_VOL (8G thin, blank)"
fi
vol_exists "$USB_VOL" || log "WARNING: no $USB_VOL volume yet; run build-image.sh before start.sh"
# Disks are type='file' with the pool's path: with type='volume' sources
@@ -202,8 +210,45 @@ XML
log "defined $CLIENT2_VM"
fi
# --- third client: XP/Win7-era PC, legacy BIOS, 32-bit CPU ---
# fallback='forbid': fail rather than quietly give the guest a 64-bit CPU,
# which would send it down the amd64 Clonezilla path.
if ! dom_exists "$CLIENT3_VM"; then
cat >"$TMP/client3.xml" <<XML
<domain type='kvm'>
<name>$CLIENT3_VM</name>
<memory unit='MiB'>$CLIENT3_MEM_MIB</memory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
</os>
<features><acpi/></features>
<cpu mode='custom' match='exact'><model fallback='forbid'>qemu32</model></cpu>
<clock offset='localtime'/>
<devices>
<interface type='network'>
<source network='$IMAGING_NET'/>
<mac address='$CLIENT3_MAC'/>
<model type='rtl8139'/>
<boot order='1'/>
</interface>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='$POOL_DIR/$CLIENT3_DISK_VOL'/>
<target dev='hda' bus='ide'/>
<boot order='2'/>
</disk>
<graphics type='vnc' listen='127.0.0.1' autoport='yes'/>
<video><model type='vga'/></video>
</devices>
</domain>
XML
virsh define "$TMP/client3.xml" >/dev/null
log "defined $CLIENT3_VM"
fi
# Never attach a pxetest VM anywhere but default NAT / pxetest-imaging.
for vm in "$SERVER_VM" "$CLIENT_VM" "$CLIENT2_VM"; do
for vm in "$SERVER_VM" "${ALL_CLIENTS[@]}"; do
while read -r _ type src _ _; do
case "$type:$src" in
network:"$GE_NET") [ "$vm" = "$SERVER_VM" ] || die "$vm is on $GE_NET" ;;