30 lines
1.1 KiB
Bash
Executable File
30 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Phase 4: Boot des extrahierten OSDx-RootFS mit generischem Debian-Kernel in QEMU virt.
|
|
# Laufwerk: /dev/vda = rootfs.ext4 (virtio), Initramfs laedt Module, Serial auf ttyAMA0.
|
|
set -uo pipefail
|
|
WORK="${WORK:-/build/work}"
|
|
LOGS="${LOGS:-/build/logs}"
|
|
TIMEOUT="${BOOT_TIMEOUT:-420}"
|
|
mkdir -p "$LOGS"
|
|
|
|
KVER=$(ls "$WORK/deb-kernel/lib/modules" 2>/dev/null | head -1)
|
|
KIMG="$WORK/deb-kernel/boot/vmlinuz-$KVER"
|
|
INITRD=""
|
|
[ -f "$WORK/initramfs.img" ] && INITRD="-initrd $WORK/initramfs.img"
|
|
|
|
echo "Boot: Kernel=$KIMG initramfs=$INITRD root=/dev/vda (Timeout ${TIMEOUT}s)"
|
|
timeout "$TIMEOUT" qemu-system-aarch64 \
|
|
-M virt -cpu cortex-a53 -m 1024 -smp 1 \
|
|
-kernel "$KIMG" \
|
|
$INITRD \
|
|
-drive if=virtio,format=raw,file="$WORK/rootfs.ext4" \
|
|
-netdev user,id=n0,hostfwd=tcp::2222-:22,hostfwd=tcp::8080-:80,hostfwd=tcp::8443-:443 -device virtio-net-pci,netdev=n0 \
|
|
-no-reboot \
|
|
-nographic \
|
|
-append "root=/dev/vda rw console=ttyAMA0,115200" \
|
|
2>&1 | tee "$LOGS/boot-generic.log"
|
|
RC=${PIPESTATUS[0]}
|
|
echo "Exit-Code: $RC (124 = Timeout -> ggf. Shell war aktiv)"
|
|
echo "--- letzte 60 Zeilen ---"
|
|
tail -60 "$LOGS/boot-generic.log"
|