Add build, deploy and test sources
This commit is contained in:
1 parent
b962581812
commit
3d1a08f230
259 files changed
+15273
No files matched your search
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
# Тест: KRD без баз, но с патчем krt.sh + интернет. Скачает ли KRT базы сам?
|
||||
set -e
|
||||
SRC=/path/to/pf/KRD/files
|
||||
NB=/root/krd24/nb3
|
||||
IMG=/root/krd24/nb3.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/20-krt.srm" "$NB/live/KRD/"
|
||||
cp /root/krd24/10-krd-emptybases.srm "$NB/live/KRD/10-krd.srm"
|
||||
cp /root/krd24/15-bases-empty.srm "$NB/live/KRD/"
|
||||
cp "$SRC/krd_version.txt" "$SRC/krd_bases_timestamp.txt" "$NB/"
|
||||
|
||||
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
|
||||
echo "=== раскладка (без баз):"; ls -R "$NB" | head -20
|
||||
|
||||
rm -f /tmp/qmonC.sock /tmp/nb3-*.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/qmonC.sock,server,nowait -daemonize
|
||||
|
||||
python3 - <<'EOF'
|
||||
import socket, time
|
||||
def shot(name):
|
||||
s = socket.socket(socket.AF_UNIX); s.connect('/tmp/qmonC.sock'); time.sleep(0.3)
|
||||
s.recv(65536); s.sendall((f'screendump {name}\n').encode()); time.sleep(1.5)
|
||||
try: s.recv(65536)
|
||||
except Exception: pass
|
||||
s.close()
|
||||
|
||||
time.sleep(120); shot('/tmp/nb3-0.ppm')
|
||||
time.sleep(60); shot('/tmp/nb3-1.ppm')
|
||||
time.sleep(120); shot('/tmp/nb3-2.ppm')
|
||||
s = socket.socket(socket.AF_UNIX); s.connect('/tmp/qmonC.sock'); time.sleep(0.3)
|
||||
s.recv(65536); s.sendall(b'quit\n')
|
||||
EOF
|
||||
sleep 3
|
||||
pkill -f 'qemu-system-x86_64.*nb3.img' 2>/dev/null || true
|
||||
sleep 2
|
||||
|
||||
echo "=== что появилось на носителе:"
|
||||
mount -o loop "$IMG" /mnt/krdtest
|
||||
find /mnt/krdtest/efi/Paravis/KRD/KRD2024_Data -maxdepth 2 2>/dev/null | sed 's|/mnt/krdtest||' | head -25
|
||||
echo "--- размеры:"; du -sh /mnt/krdtest/efi/Paravis/KRD/KRD2024_Data 2>/dev/null
|
||||
echo "--- логи про базы/обновление:"
|
||||
grep -rhiE 'bases|update|обнов' /mnt/krdtest/efi/Paravis/KRD/KRD2024_Data/Traces/*.log 2>/dev/null | tail -25
|
||||
umount /mnt/krdtest
|
||||
python3 - <<'PYEOF'
|
||||
import zlib, struct, glob
|
||||
def ppm2png(src, dst):
|
||||
d=open(src,'rb').read()
|
||||
parts=[]; i=0
|
||||
while len(parts)<4:
|
||||
while d[i:i+1].isspace(): i+=1
|
||||
j=i
|
||||
while not d[j:j+1].isspace(): j+=1
|
||||
parts.append(d[i:j]); i=j
|
||||
i+=1
|
||||
w=int(parts[1]); h=int(parts[2]); px=d[i:i+w*h*3]
|
||||
raw=b''.join(b'\x00'+px[y*w*3:(y+1)*w*3] for y in range(h))
|
||||
def chunk(t,data):
|
||||
c=t+data
|
||||
return struct.pack('>I',len(data))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
|
||||
png=b'\x89PNG\r\n\x1a\n'
|
||||
png+=chunk(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))
|
||||
png+=chunk(b'IDAT',zlib.compress(raw,9))
|
||||
png+=chunk(b'IEND',b'')
|
||||
open(dst,'wb').write(png)
|
||||
print(dst)
|
||||
for i,f in enumerate(sorted(glob.glob('/tmp/nb3-*.ppm'))):
|
||||
ppm2png(f, f'/path/to/pf/KRD/nb3-{i}.png')
|
||||
PYEOF
|
||||
Reference in new issue
Block a user