foundry
Foundry OS: the operating system built on the Rustbelt kernel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #!/usr/bin/env bash
# M1 check: compare our image with the kernel's own disk.img, file by file.
# Both are GPT + FAT32; mtools reads the partition at byte offset 1 MiB
# (`-i image@@1M`), so nothing is mounted.
#
# Prints: the /bin program lists side by side (must be equal), the other
# files (must be equal, byte for byte), and for each program whether the
# bytes are identical. Rust programs built by Cargo are expected to differ
# in bytes from the kernel's single-file rustc builds (Cargo adds crate
# metadata), so only list equality and non-program files fail the check.
#
# Usage: scripts/compare-image.sh OURS KERNELS OUT_DIR
OURS= THEIRS= OUT=/compare
&&
( && | LC_ALL=C )
( && | LC_ALL=C )
fail=0
if ; then
else
; fail=1
fi
( && | LC_ALL=C )
( && | LC_ALL=C )
if ! ; then fail=1; fi
while ; do
if [ && ; then
else ; fail=1; fi
done
same=0 diff=0
while ; do
[ || continue
a= b=
if ; then
; same=
else
; diff=
fi
done
[ && || { ; ; }
|