Files

46 lines
1.8 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Проверка: что будет без 30-bases.srm.
set -e
SRC=/path/to/pf/KRD/files
NB=/root/krd24/nobases
IMG=/root/krd24/nobases.img
rm -rf "$NB"; mkdir -p "$NB/live/KRD"
cp "$SRC/live/vmlinuz" "$SRC/live/initrd.img" "$SRC/live/filesystem.squashfs" "$SRC/live/filesystem.packages" "$NB/live/"
cp "$SRC/live/KRD/10-krd.srm" "$SRC/live/KRD/20-krt.srm" "$NB/live/KRD/"
cp "$SRC/krd_version.txt" "$SRC/krd_bases_timestamp.txt" "$NB/"
ls -R "$NB" | head -20
rm -f "$IMG"; truncate -s 8G "$IMG"
mkfs.vfat -F 32 -n PARAVIS "$IMG" >/dev/null 2>&1
mkdir -p /mnt/krdtest; mount -o loop "$IMG" /mnt/krdtest
mkdir -p /mnt/krdtest/efi/Paravis/KRD
cp -r "$NB/." /mnt/krdtest/efi/Paravis/KRD/
sync; umount /mnt/krdtest
rm -f /tmp/qmonA.sock /tmp/nobases.ppm
qemu-system-x86_64 -m 4096 -smp 4 -machine q35 \
-kernel "$NB/live/vmlinuz" -initrd "$NB/live/initrd.img" \
-append "boot=live components live-media-path=/efi/Paravis/KRD/live locales=ru_RU.UTF-8 trace" \
-drive file="$IMG",format=raw,if=ide -netdev user,id=n0 -device e1000,netdev=n0 \
-display none -vga std -monitor unix:/tmp/qmonA.sock,server,nowait -daemonize
sleep 130
python3 - <<'EOF'
import socket, time
s = socket.socket(socket.AF_UNIX); s.connect('/tmp/qmonA.sock'); time.sleep(0.3)
s.recv(65536)
s.sendall(b'screendump /tmp/nobases.ppm\n'); time.sleep(1.5); s.recv(65536)
s.sendall(b'quit\n')
EOF
sleep 3
pkill -f 'qemu-system-x86_64.*nobases.img' 2>/dev/null || true
sleep 2
echo "=== логи (trace) о запуске KRT:"
mount -o loop "$IMG" /mnt/krdtest
find /mnt/krdtest/efi/Paravis/KRD/KRD2024_Data/Traces -type f 2>/dev/null | head
grep -rhiE 'can.t mount|overlay|SRM|bases|exit with code' /mnt/krdtest/efi/Paravis/KRD/KRD2024_Data/Traces/*.log 2>/dev/null | tail -20
umount /mnt/krdtest
ls -l /tmp/nobases.ppm