Add build, deploy and test sources

This commit is contained in:
Paravis committed 2026-11-13 07:52:37 +03:00
1 parent b962581812
commit 3d1a08f230
259 files changed
+15273

No files matched your search

@@ -0,0 +1,50 @@
#!/bin/bash
set -e
echo "=== install cross compiler"
apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu >/tmp/apt_aarch64.log 2>&1
which aarch64-linux-gnu-gcc
ROOT=/root/vtbuild-arm64
SRC=$ROOT/GRUB2/SRC/grub-2.04
rm -rf $ROOT
mkdir -p $ROOT/GRUB2/SRC
cp -a /root/vtbuild-efi/GRUB2/SRC/grub-2.04 $SRC
cd $SRC
make distclean >/tmp/arm_distclean.log 2>&1 || true
echo "=== configure aarch64-efi"
./configure --prefix=$ROOT/GRUB2/INSTALL/ \
--target=aarch64 --with-platform=efi \
--host=x86_64-linux-gnu \
HOST_CC=x86_64-linux-gnu-gcc BUILD_CC=gcc \
TARGET_CC=aarch64-linux-gnu-gcc \
TARGET_OBJCOPY=aarch64-linux-gnu-objcopy \
TARGET_STRIP=aarch64-linux-gnu-strip \
TARGET_NM=aarch64-linux-gnu-nm \
TARGET_RANLIB=aarch64-linux-gnu-ranlib \
--disable-werror CFLAGS="-Os" >/tmp/arm_configure.log 2>&1
echo "=== make"
make -j16 >/tmp/arm_make.log 2>&1
echo "=== install"
make install >/tmp/arm_install.log 2>&1
LIB=$ROOT/GRUB2/INSTALL/lib/grub/arm64-efi
echo "=== lib: $(ls $LIB | wc -l) files"
echo "=== extract official aarch64 modules"
mkdir -p /tmp/efimods_arm
python3 /path/to/pf/Ventoy/extract-efi-mods.py /path/to/pf/Ventoy/tmp_arm/BOOTAA64.EFI /tmp/efimods_arm \
crypto gcry_crc gcry_sha1 gcry_sha256 gcry_md5 gcry_sha512 gzio 2>&1 | tail -10
for m in crypto gcry_crc gcry_sha1 gcry_md5 gcry_sha512 gzio; do
[ -f /tmp/efimods_arm/$m.mod ] && cp -f /tmp/efimods_arm/$m.mod "$LIB/$m.mod"
done
[ -f /tmp/efimods_arm/gcry_sha256.mod ] && cp -f /tmp/efimods_arm/gcry_sha256.mod "$LIB/gcry_sha256.mod"
echo "=== classes:"
for m in crypto gcry_crc gcry_sha1 gcry_sha256 gcry_md5 gcry_sha512 gzio ventoy; do
f="$LIB/$m.mod"
if [ -f "$f" ]; then printf " %-12s %s\n" "$m" "$(readelf -h "$f" | awk '/Class:/{print $2}')"; else echo " $m MISSING"; fi
done
@@ -0,0 +1,28 @@
#!/bin/bash
set -e
ROOT=/root/vtbuild-arm64
SRC=$ROOT/GRUB2/SRC/grub-2.04
LIB=$ROOT/GRUB2/INSTALL/lib/grub/arm64-efi
cd "$SRC"
rm -f "$LIB/gcry_sha256.mod"
net_modules_uefi="efinet net tftp http"
arm64_modules=$(sed -n 's/^all_modules_arm64_uefi="\(.*\)"$/\1/p' install.sh)
mods="crypto gcry_crc gcry_sha1 gcry_md5 gcry_sha512"
for m in $net_modules_uefi $arm64_modules; do
[ "$m" = "gcry_sha256" ] && continue
case " $mods " in *" $m "*) ;; *) mods="$mods $m" ;; esac
done
echo "modules: $(echo $mods | wc -w)"
echo "--- machines of crypto modules:"
for m in crypto gcry_crc gcry_sha1 gcry_md5 gcry_sha512 gzio ventoy; do
printf " %-12s %s\n" "$m" "$(readelf -h "$LIB/$m.mod" | awk -F: '/Machine:/{print $2}')"
done
./grub-mkimage -O arm64-efi -o /tmp/BOOTAA64_new.EFI -p '(,2)/grub' -d "$LIB" --compression auto $mods
echo "image: $(stat -c %s /tmp/BOOTAA64_new.EFI)"
file /tmp/BOOTAA64_new.EFI
for s in '(,2)/grub' 'VTOY_DATA_PART_IDX' 'ISO/Ventoy/ventoy.json'; do
echo " $s : $(grep -c -a -F "$s" /tmp/BOOTAA64_new.EFI)"
done
@@ -0,0 +1,73 @@
#!/bin/bash
# Super GRUB2: Russian + "Detect and show boot methods" as default (by menuentry id).
# Builds x64.efi / x86.efi (signed) and super.iso -> D:/PF2026/super
set -e
K=/path/to/pf/Ventoy/keys
OUT=/path/to/pf/super
W=/root/sg2dwork
rm -rf "$W"; mkdir -p "$W" "$OUT"
cp -a /root/sg2d/. "$W/sg2d/"
cd "$W/sg2d"
echo "=== patch menus"
python3 - <<'EOF'
import io
# 1) Russian language in the top-level config
p = 'menus/grub.cfg'
s = io.open(p, encoding='utf-8').read()
if 'set lang=ru' not in s:
s = s.replace('insmod datehook\n', 'insmod datehook\n\nset lang=ru\nexport lang\n', 1)
io.open(p, 'w', encoding='utf-8').write(s)
print(' grub.cfg: lang=ru')
# 2) default entry = "Detect and show boot methods" (id-based, immune to index shifts)
p = 'menus/sgd/main.cfg'
s = io.open(p, encoding='utf-8').read()
old_block = '''if [ "$sb_vendor" = "" ] ; then
set default=2
else
set default=3
fi'''
if old_block in s:
s = s.replace(old_block, 'set default=detect', 1)
print(' main.cfg: default=detect')
else:
print(' main.cfg: default block not found (already patched?)')
old_entry = 'menuentry $"Detect and show boot methods" {'
if old_entry in s:
s = s.replace(old_entry, 'menuentry $"Detect and show boot methods" --id=detect {', 1)
print(' main.cfg: --id=detect')
else:
print(' main.cfg: detect entry not found (already patched?)')
io.open(p, 'w', encoding='utf-8').write(s)
EOF
grep -n 'set default' menus/sgd/main.cfg | head -3
grep -n 'id=detect' menus/sgd/main.cfg | head -3
apt-get install -y grub-common grub-pc-bin grub-efi-amd64-bin grub-efi-ia32-bin mtools xorriso gettext unifont >/tmp/apt8.log 2>&1 || true
echo "=== build x86_64 EFI"
./supergrub-mkstandalone -O=x86_64-efi -o="$W/super-x64.efi" \
--grub-mkstandalone-binary=/usr/bin/grub-mkstandalone \
--grub-mkfont-binary=/usr/bin/grub-mkfont >/tmp/sg_x64.log 2>&1 || { tail -8 /tmp/sg_x64.log; exit 1; }
ls -l "$W/super-x64.efi"
echo "=== build i386 EFI"
./supergrub-mkstandalone -O=i386-efi -o="$W/super-x86.efi" \
--grub-mkstandalone-binary=/usr/bin/grub-mkstandalone \
--grub-mkfont-binary=/usr/bin/grub-mkfont >/tmp/sg_x86.log 2>&1 || { tail -8 /tmp/sg_x86.log; exit 1; }
ls -l "$W/super-x86.efi"
echo "=== sign"
sbsign --key "$K/ventoy.key" --cert "$K/ventoy.crt" --output "$OUT/x64.efi" "$W/super-x64.efi"
sbsign --key "$K/ventoy.key" --cert "$K/ventoy.crt" --output "$OUT/x86.efi" "$W/super-x86.efi"
sbverify --cert "$K/ventoy.crt" "$OUT/x64.efi"
sbverify --cert "$K/ventoy.crt" "$OUT/x86.efi"
echo "=== build ISO"
./supergrub-mkrescue -o="$W/super.iso" \
--grub-mkrescue-binary=/usr/bin/grub-mkrescue \
--grub-mkfont-binary=/usr/bin/grub-mkfont >/tmp/sg_iso.log 2>&1 || { tail -12 /tmp/sg_iso.log; exit 1; }
cp -f "$W/super.iso" "$OUT/super.iso"
ls -l "$OUT"
@@ -0,0 +1,35 @@
#!/bin/bash
set -e
echo "=== deps"
apt-get install -y grub-common grub-efi-amd64-bin gettext unifont >/tmp/apt_sg2d.log 2>&1 || true
which grub-mkstandalone grub-mkfont msgfmt
ls /usr/lib/grub/x86_64-efi/*.mod >/dev/null && echo " modules ok"
cd /tmp/sg2d
echo "=== patch default language -> ru"
python3 - <<'EOF'
import io
p='menus/grub.cfg'
s=io.open(p, encoding='utf-8').read()
if 'set lang=ru' not in s:
marker='insmod datehook\n'
s=s.replace(marker, marker+'\n# Paravis: default language\nset lang=ru\nexport lang\n',1)
io.open(p,'w',encoding='utf-8').write(s)
print(' patched menus/grub.cfg')
else:
print(' already patched')
EOF
grep -n -A3 'Paravis' menus/grub.cfg
echo "=== build standalone EFI"
rm -f /tmp/sg2d_ru.efi
./supergrub-mkstandalone -O=x86_64-efi -o=/tmp/sg2d_ru.efi \
--grub-mkstandalone-binary=/usr/bin/grub-mkstandalone \
--grub-mkfont-binary=/usr/bin/grub-mkfont 2>&1 | tail -15 || true
if [ -f /tmp/sg2d_ru.efi ]; then
ls -l /tmp/sg2d_ru.efi
file /tmp/sg2d_ru.efi
else
echo " !! build failed"
fi
@@ -0,0 +1,26 @@
#!/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
@@ -0,0 +1,25 @@
#!/bin/bash
set -e
SRC=/path/to/pf/acronis/Acronis_Boot_Disk_2024.iso
W=/tmp/kchk
rm -rf $W; mkdir -p $W
7z e -y -o$W "$SRC" 'ACR/ATI2025/dat10.dat' 'ACR/ADDH12/dat14.dat' >/dev/null
python3 - <<'EOF'
import struct, glob
for p in sorted(glob.glob('/tmp/kchk/*.dat')):
d = open(p, 'rb').read()
if d[0x1FE:0x1FF] == b'\x00':
pass
setup_sects = d[0x1FE]
xload = struct.unpack_from('<H', d, 0x236)[0]
kern_ver = d[0x206:0x206+4]
flags = []
if xload & (1 << 0): flags.append('XLF_KERNEL_64 (64-битное ядро)')
if xload & (1 << 1): flags.append('XLF_CAN_BE_LOADED_ABOVE_4G')
if xload & (1 << 2): flags.append('XLF_EFI_HANDOVER_32 (может грузиться на 32-битной UEFI)')
if xload & (1 << 3): flags.append('XLF_EFI_HANDOVER_64')
if xload & (1 << 5): flags.append('XLF_EFI_KEXEC')
print('%-42s size=%-9d xloadflags=0x%04x kernel=%d.%d' %
(p.split('/')[-1], len(d), xload, kern_ver[0], kern_ver[1]))
for f in flags: print(' -', f)
EOF
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""Check how the padded labels measure up (and why the tag column drifts)."""
import re
from PIL import ImageFont
CFG = '/path/to/pf/ParavisGrub/grub.cfg'
font = ImageFont.truetype('/tmp/Paravis.ttf', 18)
for line in open(CFG, encoding='utf-8'):
m = re.match(r'\s*menuentry "(.+?)" --hotkey=(\S+)', line)
if not m:
continue
label, hk = m.group(1), m.group(2)
w_all = font.getlength(label)
stripped = label.rstrip()
w_txt = font.getlength(stripped)
tag = re.search(r'\((\w+)\)$', stripped)
body = stripped[:tag.start()] if tag else stripped
w_body = font.getlength(body)
print('hk=%-2s total=%6.1f body=%6.1f tagstarts=%6.1f spaces=%2d %r' % (
hk, w_all, w_body, w_body, len(label) - len(stripped), stripped[:40]))
@@ -0,0 +1,28 @@
#!/bin/bash
BK="/path/to/pf/Ventoy/backup/xorboot-uefi/sign"
C=/path/to/pf/Ventoy/keys/ventoy.crt
cd "$BK"
printf '%-56s %10s %10s %-6s %s\n' file orig now sig sbat
bad=0
for rel in $(find . -type f -name '*.efi' | sort); do
src="$BK/$rel"; dst="/mnt/f/$rel"
[ -f "$dst" ] || { printf '%-56s MISSING\n' "$rel"; bad=1; continue; }
sig=NO; sbverify --cert "$C" "$dst" >/dev/null 2>&1 && sig=OK
sbat=$(python3 - "$dst" <<'EOF'
import struct,sys
d=open(sys.argv[1],'rb').read()
try:
pe=struct.unpack_from('<I',d,0x3c)[0]
n=struct.unpack_from('<H',d,pe+6)[0]
o=struct.unpack_from('<H',d,pe+20)[0]
t=pe+24+o
names=[d[t+i*40:t+i*40+8].rstrip(b'\0') for i in range(n)]
print('yes' if b'.sbat' in names else 'no')
except Exception:
print('err')
EOF
)
printf '%-56s %10s %10s %-6s %s\n' "$rel" "$(stat -c %s "$src")" "$(stat -c %s "$dst")" "$sig" "$sbat"
[ "$sig" = "OK" ] || bad=1
done
echo "bad=$bad"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
cd /tmp && rm -rf icmp && mkdir icmp && cd icmp
cp "/mnt/f/Change_bootLoader.exe" new.exe
cp "/path/to/pf/Change_bootloader/Change_bootLoader.old-3.0.1.exe" old.exe 2>/dev/null || true
for f in old.exe new.exe; do
echo "== $f"
icotool -l "$f" 2>/dev/null | sed 's/^/ /' | head -10
done
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
cd /tmp/icmp || exit 1
for f in old.exe new.exe; do
echo "== $f"
if [ -f "$f" ]; then
wrestool -l "$f" 2>/dev/null | grep -E 'type=14|type=3' | sed 's/^/ /' | head -12
printf ' icon images: '
wrestool -l "$f" 2>/dev/null | grep -c 'type=3'
else
echo " (missing)"
fi
done
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
W=/root/icmp
rm -rf "$W"; mkdir -p "$W"; cd "$W"
cp -f "/mnt/f/Change_bootLoader.exe" new.exe
cp -f "/path/to/pf/Change_bootloader/Change_bootLoader.old-3.0.1.exe" old.exe
for f in old.exe new.exe; do
echo "== $f"
if [ ! -f "$f" ]; then echo " missing"; continue; fi
printf ' icon groups (type=14): '
wrestool -l "$f" 2>/dev/null | grep -c 'type=14' || true
printf ' icon images (type=3): '
wrestool -l "$f" 2>/dev/null | grep -c 'type=3' || true
wrestool -l "$f" 2>/dev/null | grep 'type=3' | head -6 | sed 's/^/ /'
done
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
set -e
K=/path/to/pf/Ventoy/keys
D=/path/to/pf/ParavisGrub
G=/mnt/f/efi/Paravis/Boot/grub2
echo "=== 1. memtest86+ 9.10 (built from git) -> signed"
if [ -f /tmp/mt86p/build/x86_64/mt86plus ]; then
cp -f /tmp/mt86p/build/x86_64/mt86plus /tmp/mt86p/mt86plus.efi
sbsign --key "$K/ventoy.key" --cert "$K/ventoy.crt" --output "$G/apps/memtest86p.efi" /tmp/mt86p/mt86plus.efi >/dev/null
sbverify --cert "$K/ventoy.crt" "$G/apps/memtest86p.efi"
ls -l "$G/apps/memtest86p.efi"
else
echo " !! build missing"
fi
rm -f "$G/apps/memtest86.efi"
echo "=== 2. generate menu files"
python3 "$D/gen_menu.py" "$D"
cp -f "$D/grub.cfg" "$G/grub.cfg"
mkdir -p "$G/menu"
cp -f "$D"/menu/*.cfg "$G/menu/"
ls -l "$G" "$G/menu" "$G/apps"
@@ -0,0 +1,31 @@
#!/bin/bash
set -e
K=/path/to/pf/Ventoy/keys
G=/path/to/pf/ParavisGrub
D=/mnt/f/efi/Paravis/Boot/grub2
APPS="$D/apps"
mkdir -p "$APPS"
echo "=== grub core"
cp -f "$G/grubx64.efi" "$D/grubx64.efi"
echo "=== sign helper EFI apps for chainloading under Secure Boot"
sign_app() {
local src="$1" dst="$2"
rm -f /tmp/a.efi /tmp/a2.efi
python3 /path/to/pf/Ventoy/add-sbat.py "$src" /tmp/a.efi >/dev/null
if sbattach --detach /tmp/old.p7 /tmp/a.efi >/dev/null 2>&1; then sbattach --remove /tmp/a.efi; fi
sbsign --key "$K/ventoy.key" --cert "$K/ventoy.crt" --output /tmp/a2.efi /tmp/a.efi >/dev/null
sbverify --cert "$K/ventoy.crt" /tmp/a2.efi >/dev/null
cp -f /tmp/a2.efi "$dst"
printf " %-16s %s\n" "$(basename "$dst")" "$(stat -c %s "$dst")"
}
sign_app /mnt/f/efi/Paravis/Boot/super/x64.efi "$APPS/super.efi"
sign_app /mnt/f/efi/Paravis/Boot/gfm/x64.efi "$APPS/gfm.efi"
sign_app /mnt/f/EFI/Boot/memtest.efi "$APPS/memtest.efi"
echo "=== font (for later theme)"
cp -f /path/to/pf/Ventoy/vtoyefi/grub/fonts/unicode.pf2 "$D/unicode.pf2"
echo "=== done, tree:"
ls -l "$D" "$APPS"
@@ -0,0 +1,7 @@
#!/bin/bash
for f in ADD ABA; do
echo "== $f /boot/grub/grub.cfg"
7z e -y -o/tmp/cfgchk "/mnt/f/efi/Paravis/Utilities/$f" 'boot/grub/grub.cfg' >/dev/null 2>&1
sed 's/^/ /' /tmp/cfgchk/grub.cfg 2>/dev/null
rm -f /tmp/cfgchk/grub.cfg
done
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
OUT=/path/to/pf/Change_bootloader
rm -rf /tmp/cb /tmp/cb.tgz
mkdir -p /tmp/cb "$OUT"
curl -sSL --max-time 180 "https://git.paravis.ru/Paravis_Flash/Change_bootloader/archive/master.tar.gz" -o /tmp/cb.tgz
tar -xzf /tmp/cb.tgz -C /tmp/cb
echo "--- repo files:"
find /tmp/cb -type f -printf '%P %s\n' | sort
echo "--- copying to $OUT"
cp -r /tmp/cb/change_bootloader/. "$OUT"/
ls -la "$OUT"
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
echo "=== PSD 2023:"
find "/mnt/d/NEED/my_project/PSD 2023" -maxdepth 3 | head -40
echo
echo "=== кандидаты-шрифты в vcpkg:"
ls /mnt/d/GIT/aspia_no2fa-3.0/vcpkg4aspia/buildtrees/harfbuzz/src/*/test/subset/data/fonts/ 2>/dev/null | grep -iE 'roboto|notosans|sourcesans|ubuntu|opensans|inter' | head -20
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
set -e
K=/path/to/pf/Ventoy/keys
G=/mnt/f/efi/Paravis/Boot/grub2
echo "=== PassMark MemTest86 (memtest.org) -> signed copy, NO .sbat"
cp -f /mnt/f/EFI/Boot/memtest.efi /tmp/mt.efi
sbsign --key "$K/ventoy.key" --cert "$K/ventoy.crt" --output "$G/apps/memtest86.efi" /tmp/mt.efi >/dev/null
sbverify --cert "$K/ventoy.crt" "$G/apps/memtest86.efi"
ls -l "$G/apps/memtest86.efi"
rm -f "$G/apps/memtest86p.efi" "$G/apps/memtest.efi"
echo "=== regenerate menu"
sed -i 's|apps/memtest86p.efi|apps/memtest86.efi|' /path/to/pf/ParavisGrub/gen_menu.py
python3 /path/to/pf/ParavisGrub/gen_menu.py > /path/to/pf/ParavisGrub/grub.cfg
cp -f /path/to/pf/ParavisGrub/grub.cfg "$G/grub.cfg"
echo "--- key lines:"
grep -nE 'subdir=|live-media-path=|Возврат|memtest|map --type' /path/to/pf/ParavisGrub/grub.cfg
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# persist the a1ive grub tree on D: and inspect wimboot/ntboot usage
set -e
SRC=/tmp/g2/grub
OUT=/path/to/pf/grub2-a1ive
if [ -d "$SRC" ]; then
echo "--- copying release tree to $OUT"
rm -rf "$OUT"; mkdir -p "$OUT"
cp -a "$SRC" "$OUT/grub"
fi
G="$OUT/grub"
ls "$G" | head
for m in wimboot ntboot chain linux; do
echo "=== $m.mod"
if [ -f "$G/x86_64-efi/$m.mod" ]; then
strings -a -n 4 "$G/x86_64-efi/$m.mod" | head -40
else
echo " (no such module)"
fi
done
@@ -0,0 +1,10 @@
#!/bin/bash
G=/path/to/pf/grub2-a1ive/grub
echo "=== wimboot.mod readable strings:"
strings -a -n 6 "$G/x86_64-efi/wimboot.mod" | grep -avE '^[A-Za-z0-9_]{0,5}$' | head -60
echo
echo "=== full moddep entries for wimboot/ntboot:"
grep -aE '^wimboot|^ntboot' "$G/x86_64-efi/moddep.lst" 2>/dev/null
echo
echo "=== command.lst:"
grep -aE 'wimboot|ntboot' "$G/x86_64-efi/command.lst" 2>/dev/null
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
import sys, re
def around(path, needle, before=300, after=700):
d = open(path, 'rb').read()
i = d.find(needle)
if i < 0:
print(' (not found)')
return
chunk = d[max(0, i-before): i+after]
txt = re.sub(rb'[^\x09\x0a\x0d\x20-\x7e]+', b'\n', chunk).decode('latin1')
for line in txt.splitlines():
line = line.strip()
if line:
print(' ', line)
for path, needle in (
('/mnt/f/efi/Paravis/Boot/g4d/antiv', b'/efi/Paravis/KRD'),
('/mnt/f/efi/Paravis/Boot/g4d/acroDD', b'/efi/Paravis/Utilities/ADD'),
('/mnt/f/efi/Paravis/Boot/g4d/acroBA', b'/efi/Paravis/Utilities/ABA'),
('/mnt/f/efi/Paravis/Boot/g4d/phdm', b'/efi/Paravis/Utilities/phdm.krn'),
('/mnt/f/efi/Paravis/Boot/g4d/mint64r', b'/efi/Paravis/Linux/x64/vmlinuz'),
):
print('=====================', path.split('/')[-1])
around(path, needle)
print()
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
D=/mnt/f/efi/Paravis/Boot/g4d
for f in mint64r mint64i phdm acroDD acroBA antiv Ventoy super mt dart linux; do
p="$D/$f"
[ -f "$p" ] || continue
echo "===================== $f"
echo "--- ascii hits:"
strings -a -n 5 "$p" | grep -aiE 'vmlinuz|initrd|squash|casper|k-x86|\.srm|kaspersky|acronis|paragon|phdm|memtest|ventoy|\.wim|\.iso|/efi|efi/|chainloader|ntboot|wimboot|bootmgr' | head -20
echo "--- utf16 hits:"
strings -a -e l -n 5 "$p" | grep -aiE 'vmlinuz|initrd|squash|casper|k-x86|\.srm|kaspersky|acronis|paragon|phdm|memtest|ventoy|\.wim|\.iso|/efi|efi/|chainloader|ntboot|bootmgr' | head -20
done
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
D=/mnt/f/efi/Paravis/Boot/g4d
echo "=== antiv (KRD) full menu lines:"
strings -a -n 4 "$D/antiv" | grep -aiE 'krd|kernel|initrd|srm|ksl|base|root|lang|:' | grep -aivE 'initrd_start|Create INITRD|Linux kernel must|initrd \[@name|initrdfs' | head -25
echo
echo "=== acroDD map/menu lines:"
strings -a -n 4 "$D/acroDD" | grep -aiE 'map|iso=|chainloader|root|find' | grep -aivE 'table not recognized|map %s|initrd' | head -20
echo
echo "=== ISO magic check (offset 0x8001):"
for f in ADD ABA; do
printf " %-6s " "$f"
dd if="$D/../Utilities/$f" bs=1 skip=32769 count=5 2>/dev/null | od -c | head -1
done
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
D=/mnt/f/efi/Paravis/Boot/g4d
for f in acroDD acroBA antiv util str nix off gfm UBCD mt super Ventoy dart; do
p="$D/$f"; [ -f "$p" ] || continue
echo "===================== $f"
strings -a -n 4 "$p" | grep -aE '^(set |map |kernel |initrd |chainloader|find |root |checkrange|default |title |if |echo |ls |cat )' | head -30
done
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
import sys, re
def dump_menu(path, needle=b'set ', span=1200):
d = open(path, 'rb').read()
i = d.find(needle)
if i < 0:
print(' (no marker)')
return
chunk = d[max(0, i-200): i+span]
txt = re.sub(rb'[^\x09\x0a\x0d\x20-\x7e]+', b'\n', chunk).decode('latin1')
for line in txt.splitlines():
line = line.strip()
if line:
print(' ', line)
for path in sys.argv[1:]:
print('=====================', path.split('/')[-1])
dump_menu(path)
print()
print('=== ISO magic at 0x8001:')
for p in ('/mnt/f/efi/Paravis/Utilities/ADD', '/mnt/f/efi/Paravis/Utilities/ABA'):
with open(p, 'rb') as f:
f.seek(32769); b = f.read(8)
print(' %-4s %r' % (p.split('/')[-1], b))
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
OUT=/path/to/pf/grub2-a1ive
rm -rf "$OUT" /tmp/g2; mkdir -p "$OUT" /tmp/g2
curl -sSL --max-time 600 "https://github.com/a1ive/grub/releases/download/latest/grub2-latest.tar.gz" -o /tmp/g2.tgz
echo "size: $(stat -c %s /tmp/g2.tgz)"
file /tmp/g2.tgz
tar -xzf /tmp/g2.tgz -C /tmp/g2
echo "=== top level:"
find /tmp/g2 -maxdepth 2 -type d | head -20
echo "=== efi builds:"
find /tmp/g2 -maxdepth 2 -iname '*x86_64*' -o -maxdepth 2 -iname '*efi*' | head -20
echo "=== grub-mkimage / .mod presence:"
find /tmp/g2 -name 'grub-mkimage*' | head -5
find /tmp/g2 -name 'wimboot.mod' -o -name 'ntboot.mod' | head -5
@@ -0,0 +1,13 @@
#!/bin/bash
set -e
cd /tmp
rm -rf ag ag.tgz
curl -sSL --max-time 600 "https://github.com/a1ive/grub/archive/refs/heads/master.tar.gz" -o ag.tgz
echo "size: $(stat -c %s ag.tgz)"
tar -xzf ag.tgz
D=$(find /tmp -maxdepth 1 -type d -name 'grub-*' | head -1)
echo "src dir: $D"
echo "=== wimboot command definition:"
grep -rn 'grub_register_extcmd.*wimboot\|"wimboot"' "$D/grub-core" | head -10
echo "=== files:"
find "$D/grub-core" -name '*wimboot*' -o -name '*wim*' | head -20
@@ -0,0 +1,8 @@
#!/bin/bash
cd /tmp
rm -f font.c
curl -sSL --max-time 120 "https://raw.githubusercontent.com/rhboot/grub2/master/grub-core/font/font.c" -o font.c || true
[ -s font.c ] || curl -sSL --max-time 120 "https://git.savannah.gnu.org/cgit/grub.git/plain/grub-core/font/font.c" -o font.c
echo "size: $(stat -c %s font.c)"
echo "=== CHIX / DATA parsing:"
grep -n -A25 'CHIX' font.c | head -60
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
cd /tmp
rm -rf gfm gfm.tgz
curl -sSL --max-time 300 "https://github.com/a1ive/grub2-filemanager/archive/refs/heads/master.tar.gz" -o gfm.tgz
mkdir -p gfm && tar -xzf gfm.tgz -C gfm --strip-components=1
echo "=== ntboot usages:"
grep -rn 'ntboot' gfm --include='*.cfg' --include='*.lua' --include='*.sh' | head -15
echo "=== wimboot usages:"
grep -rn 'wimboot' gfm --include='*.cfg' --include='*.lua' | head -15
echo "=== efi chain examples:"
grep -rn 'chainloader' gfm --include='*.cfg' --include='*.lua' | head -10
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
for repo in a1ive/grub2-filemanager a1ive/grub; do
echo "=== $repo"
curl -sL --max-time 60 "https://api.github.com/repos/$repo/releases/latest" \
| python3 -c "import sys,json;
d=json.load(sys.stdin)
print('tag:', d.get('tag_name'), '|', d.get('name'))
for a in d.get('assets',[]): print(' ', a['name'], a['size'], a['browser_download_url'])" 2>&1 | head -20
done
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
curl -sL --max-time 60 "https://api.github.com/repos/memtest86plus/memtest86plus/releases/latest" \
| python3 -c "
import sys,json
d=json.load(sys.stdin)
print('tag:', d.get('tag_name'))
for a in d.get('assets',[]):
print(' %-40s %10d %s' % (a['name'], a['size'], a['browser_download_url']))
"
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
echo "=== releases (with assets):"
curl -sL --max-time 60 "https://api.github.com/repos/memtest86plus/memtest86plus/releases?per_page=10" \
| python3 -c "
import sys,json
for r in json.load(sys.stdin):
print('tag:', r.get('tag_name'), '| assets:', len(r.get('assets',[])))
for a in r.get('assets',[]):
print(' %-44s %10d' % (a['name'], a['size']))
print()
"
echo "=== repo tree (top):"
curl -sL --max-time 60 "https://api.github.com/repos/memtest86plus/memtest86plus/contents/" \
| python3 -c "
import sys,json
for e in json.load(sys.stdin):
print(' %-30s %s' % (e['name'], e['type']))
"
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
echo "=== supergrub releases:"
curl -sL --max-time 60 "https://api.github.com/repos/supergrub/supergrub/releases?per_page=5" \
| python3 -c "
import sys,json
for r in json.load(sys.stdin):
print('tag:', r.get('tag_name'), '|', r.get('name'))
for a in r.get('assets',[]):
print(' %-52s %10d' % (a['name'], a['size']))
print()
"
echo "=== ventoy language handling in grub.cfg:"
grep -n 'lang' /path/to/pf/Ventoy/vtoyefi/grub/grub.cfg | head -25
@@ -0,0 +1,12 @@
#!/bin/bash
cd /tmp
for f in grub-core/gfxmenu/gui_progress_bar.c grub-core/gfxmenu/gui_label.c grub-core/gfxmenu/gui_circular_progress.c grub-core/gfxmenu/view.c grub-core/font/font.c; do
out=$(echo "$f" | tr '/' '_')
[ -s "$out" ] || curl -sSL --max-time 120 "https://raw.githubusercontent.com/rhboot/grub2/master/$f" -o "$out" || true
done
echo "=== __timeout__ usage:"
grep -n '__timeout__\|timeout' grub-core_gfxmenu_gui_progress_bar.c grub-core_gfxmenu_view.c 2>/dev/null | head -20
echo "=== label text handling:"
grep -n 'text\|@' grub-core_gfxmenu_gui_label.c | head -30
echo "=== antialias in font.c:"
grep -in 'antialias\|alpha\|8-bit' grub-core_font_font.c | head -10
@@ -0,0 +1,26 @@
#!/bin/bash
W=/tmp/insp
rm -rf "$W"; mkdir -p "$W"
echo "=== memtest.efi:"
python3 - <<'EOF'
import struct
d=open('/mnt/f/EFI/Boot/memtest.efi','rb').read()
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]
print(' machine 0x%x magic 0x%x size %d' % (mach, magic, len(d)))
import re
s=re.findall(rb'[ -~]{6,}', d[:400000])
for t in s[:15]: print(' ', t.decode('latin1'))
EOF
echo
echo "=== KRD initrd:"
cd "$W"
xz -dc /mnt/f/efi/Paravis/KRD/initrd.xz > krd.cpio 2>/dev/null || cp /mnt/f/efi/Paravis/KRD/initrd.xz krd.cpio
file krd.cpio
mkdir -p krd && ( cd krd && cpio -idm --quiet < ../krd.cpio 2>/dev/null || true )
ls krd | head -20
echo "--- init (first 80 lines):"
sed -n '1,80p' krd/init 2>/dev/null
@@ -0,0 +1,23 @@
#!/bin/bash
set -e
echo "=== deps"
apt-get install -y python3-pip python3-venv >/tmp/apt_pip.log 2>&1 || true
python3 -m pip install --quiet --break-system-packages psd-tools 2>/dev/null || true
echo "=== PSD layers (UEFI x64 main)"
python3 - <<'EOF'
from psd_tools import PSDImage
p = PSDImage.open('/path/to/pf/PSD/UEFI/x64/main/main.psd')
print('canvas: %dx%d mode=%s' % (p.width, p.height, p.color_mode))
for i, l in enumerate(p):
print(' %2d %-28s type=%-10s vis=%-5s bbox=%-24s op=%s' % (
i, (l.name or '')[:28], l.kind, l.visible, str(l.bbox), l.opacity))
EOF
echo
echo "=== Acronis 2024 ISO"
ISO=/path/to/pf/acronis/Acronis_Boot_Disk_2024.iso
ls -l "$ISO"
xorriso -indev "$ISO" -report_el_torito plain 2>&1 | grep -E 'El Torito|Boot record|Volume id' | head -12
echo "--- EFI boot files:"
7z l -ba "$ISO" 2>/dev/null | grep -iE 'efi/boot/|bootx64|bootia32|shim|grub' | head -20
@@ -0,0 +1,7 @@
#!/bin/bash
for iso in /mnt/f/efi/Paravis/Utilities/ADD /mnt/f/efi/Paravis/Utilities/ABA; do
echo "===================== $(basename "$iso")"
xorriso -indev "$iso" -report_el_torito as_mkisofs 2>&1 | sed -n '1,40p'
echo "--- boot images:"
xorriso -indev "$iso" -report_el_torito plain 2>&1 | grep -iE 'El Torito|Boot record|boot image|platform|efi' | head -20
done
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
# Identify kernels by decompressing the bzImage payload and grepping "Linux version"
python3 - <<'EOF'
import glob, gzip, io, lzma, os, re, struct, zlib
def payload(d):
ss = d[0x1FE] or 4
return d[(ss + 1) * 512:]
def try_decompress(b):
for name, fn in (('gzip', lambda x: gzip.decompress(x)),
('xz', lambda x: lzma.decompress(x)),
('zlib', lambda x: zlib.decompress(x))):
try:
return fn(b), name
except Exception:
pass
return None, None
paths = []
for pat in ('ATI2025/dat10.dat', 'ATI2025/dat2.dat', 'ADDH12/dat14.dat', 'ADDH12/dat10.dat'):
paths.append('/path/to/pf/acronis/acr/ACR/' + pat)
for p in paths:
if not os.path.exists(p):
print(p, 'missing'); continue
d = open(p, 'rb').read()
body = payload(d)
out, kind = try_decompress(body)
ver = '?'
if out:
m = re.search(rb'Linux version ([0-9][^ \x00]{0,40})', out[:6_000_000])
if m:
ver = m.group(1).decode('latin1')
print('%-42s %-6s %s' % (p.split('ACR/')[-1], kind or 'raw', ver))
EOF
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
ISO=/mnt/f/efi/Paravis/Utilities/ADD
echo "=== all entries:"
7z l -ba "$ISO" 2>/dev/null | awk '{print $NF}' | head -30
echo "=== xorriso listing:"
xorriso -indev "$ISO" -find / 2>/dev/null | head -30
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/k18a.ppm'; dst='/path/to/pf/KRD/krd18-test.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/k32.ppm'; dst='/path/to/pf/KRD/xor32-krd-direct.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/k32b.ppm'; dst='/path/to/pf/KRD/xor32-krd-direct2.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/k32b.ppm'; dst='/path/to/pf/KRD/xor32-krd-text.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/k32b.ppm'; dst='/path/to/pf/KRD/xor32-krd-video.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/k64a.ppm'; dst='/path/to/pf/KRD/krd64-test.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
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, dd):
c = t + dd
return struct.pack('>I', len(dd)) + c + struct.pack('>I', zlib.crc32(c) & 0xffffffff)
png = b'\x89PNG\r\n\x1a\n' + chunk(b'IHDR', struct.pack('>IIBBBBB', w, h, 8, 2, 0, 0, 0)) + chunk(b'IDAT', zlib.compress(raw, 9)) + chunk(b'IEND', b'')
open(dst, 'wb').write(png)
print(dst, w, h)
ppm2png('/tmp/x32-krd.ppm', '/path/to/pf/KRD/xor32-krd.png')
EOF
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/xnk.ppm'; dst='/path/to/pf/KRD/x86nokrd.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
src='/tmp/xnk2.ppm'; dst='/path/to/pf/KRD/x86nokrd-nav.png'
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 ch(t,dd):
c=t+dd
return struct.pack('>I',len(dd))+c+struct.pack('>I',zlib.crc32(c)&0xffffffff)
png=b'\x89PNG\r\n\x1a\n'+ch(b'IHDR',struct.pack('>IIBBBBB',w,h,8,2,0,0,0))+ch(b'IDAT',zlib.compress(raw,9))+ch(b'IEND',b'')
open(dst,'wb').write(png); print(dst,w,h)
EOF
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
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, dd):
c = t + dd
return struct.pack('>I', len(dd)) + c + struct.pack('>I', zlib.crc32(c) & 0xffffffff)
png = b'\x89PNG\r\n\x1a\n' + chunk(b'IHDR', struct.pack('>IIBBBBB', w, h, 8, 2, 0, 0, 0)) + chunk(b'IDAT', zlib.compress(raw, 9)) + chunk(b'IEND', b'')
open(dst, 'wb').write(png)
print(dst, w, h)
ppm2png('/tmp/qx2.ppm', '/path/to/pf/KRD/xor-uefi-1.png')
EOF
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
python3 - <<'EOF'
import zlib, struct
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, dd):
c = t + dd
return struct.pack('>I', len(dd)) + c + struct.pack('>I', zlib.crc32(c) & 0xffffffff)
png = b'\x89PNG\r\n\x1a\n' + chunk(b'IHDR', struct.pack('>IIBBBBB', w, h, 8, 2, 0, 0, 0)) + chunk(b'IDAT', zlib.compress(raw, 9)) + chunk(b'IEND', b'')
open(dst, 'wb').write(png)
print(dst, w, h)
ppm2png('/tmp/qx3.ppm', '/path/to/pf/KRD/xor-uefi-3.png')
EOF
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
set -e
W=/tmp/armtest
rm -rf $W && mkdir -p $W && cd $W
dd if=/dev/zero of=p1.img bs=1M count=48 status=none
dd if=/dev/zero of=p2.img bs=1M count=128 status=none
mkfs.vfat -F 32 -n ESP p1.img >/dev/null
mkfs.vfat -F 32 -n GRUB p2.img >/dev/null
mkdir -p t1/EFI/BOOT
cp /path/to/pf/Ventoy/grubia32.efi.signed /dev/null 2>/dev/null || true
cp "$(ls -1 /path/to/pf/Ventoy/BOOTAA64* 2>/dev/null | head -1)" t1/EFI/BOOT/BOOTAA64.EFI 2>/dev/null || true
if [ ! -f t1/EFI/BOOT/BOOTAA64.EFI ]; then
echo "no BOOTAA64 source; abort"
exit 1
fi
mcopy -i p1.img -s t1/EFI ::/
mkdir -p t2
cp -a /path/to/pf/Ventoy/vtoyefi/grub t2/grub
printf 'echo HELLO-ARM64-OK\nsleep 5\n' > t2/grub/grub.cfg
mcopy -i p2.img -s t2/grub ::/
dd if=/dev/zero of=disk.img bs=1M count=192 status=none
parted -s disk.img mklabel msdos
parted -s disk.img mkpart primary fat32 1MiB 49MiB
parted -s disk.img mkpart primary fat32 49MiB 177MiB
parted -s disk.img set 1 boot on
dd if=p1.img of=disk.img bs=1M seek=1 conv=notrunc status=none
dd if=p2.img of=disk.img bs=1M seek=49 conv=notrunc status=none
echo "=== boot aarch64:"
timeout 60 qemu-system-aarch64 -M virt -cpu cortex-a57 -m 1024 -nographic -no-reboot \
-bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd \
-drive file=disk.img,format=raw,if=none,id=hd0 \
-device virtio-blk-device,drive=hd0 2>&1 | tail -30
@@ -0,0 +1,13 @@
#!/bin/bash
C=/path/to/pf/Ventoy/keys/ventoy.crt
echo "=== deployed files on p1:"
for f in /mnt/f/EFI/Boot/fbx64.efi /mnt/f/EFI/Boot/bootx64.efi /mnt/f/efi/Paravis/Boot/xor/UEFI/bootx64.efi; do
printf '%-46s ' "${f#/mnt/f/}"
if sbverify --cert "$C" "$f" >/dev/null 2>&1; then echo "our signature OK"; else echo "FAIL"; fi
done
echo
echo "=== sha256 (deployed vs staging):"
sha256sum /mnt/f/EFI/Boot/fbx64.efi /path/to/pf/Ventoy/xorboot/fbx64-xor.efi
echo
echo "=== cert: subject / key usage / basic constraints / validity"
openssl x509 -in "$C" -noout -subject -dates -ext keyUsage,extendedKeyUsage,basicConstraints
@@ -0,0 +1,8 @@
#!/bin/bash
for f in ADD ABA; do
rm -f /tmp/e.img
xorriso -osirrox on -indev "/mnt/f/efi/Paravis/Utilities/$f" -extract /efi.img /tmp/e.img >/dev/null 2>&1
printf ' %-4s %-28s ' "$f" "$(file -b /tmp/e.img)"
mdir -i /tmp/e.img ::/EFI/BOOT 2>/dev/null | grep -oE 'BOOT(IA32|X64) +EFI' | tr '\n' ' '
echo
done
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
for f in ADD ABA; do
printf ' %-4s tree: ' "$f"
7z l -ba "/mnt/f/efi/Paravis/Utilities/$f" 2>/dev/null | grep -oE 'EFI/BOOT/BOOT(IA32|X64)\.EFI' | tr '\n' ' '
echo
done
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
C=/path/to/pf/Ventoy/keys/ventoy.crt
for f in /mnt/f/efi/Paravis/Boot/gfm/x86.efi /mnt/f/efi/Paravis/Boot/super/x86.efi /mnt/f/efi/Paravis/Boot/gfm/x64.efi /mnt/f/efi/Paravis/Boot/super/x64.efi; do
printf '%-46s ' "${f#/mnt/f/}"
if sbverify --cert "$C" "$f" >/dev/null 2>&1; then echo OK; else echo FAIL; fi
done