Files
Ventoy/build-scripts/experiments/check-iso-memtest.sh
T

27 lines
991 B
Bash

#!/bin/bash
echo "=== how grubfm boots a generic ISO (UEFI):"
find /tmp/gfm/boot/grubfm/rules/iso -name '*.sh' -o -name '*.lua' 2>/dev/null | head
for f in /tmp/gfm/boot/grubfm/rules/iso/*.sh; do
echo "--- $f"; sed -n '1,40p' "$f"; echo
done 2>/dev/null | head -80
echo
echo "=== memtest binaries:"
python3 - <<'EOF'
import struct
for p in ('/mnt/f/EFI/Boot/memtest.efi','/mnt/f/EFI/Boot/mtest32.efi',
'/mnt/f/efi/Paravis/Boot/mem/memtest64.efi','/mnt/f/efi/Paravis/Boot/mem/memtest32.efi'):
try:
d=open(p,'rb').read()
except Exception as e:
print(p, 'ERR', e); continue
pe=struct.unpack_from('<I',d,0x3c)[0]
mach=struct.unpack_from('<H',d,pe+4)[0]
magic=struct.unpack_from('<H',d,pe+24)[0]
import re
name = b''
m = re.search(rb'MEMTEST[ -~]{0,40}', d[:2000000], re.I)
if m: name = m.group(0)[:40]
print(' %-46s mach=0x%04x magic=0x%03x size=%-8d %s' % (p.split('/')[-1], mach, magic, len(d), name.decode('latin1')))
EOF