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,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"
|
||||
Reference in new issue
Block a user