From c7d92071e1dd11c45999457b16554b4abaa73b28 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 2 Aug 2026 15:21:34 +0200 Subject: v0.5.5: crash reports go to a dedicated CRASHLOG USB stick The fault handler now writes crash.log to the volume labeled CRASHLOG (label-selected via fat::crash_vol), falling back to slot 0. On real hardware the boot USB may be unwritable, so a second stick labeled CRASHLOG survives the write; the shell auto-prints the previous crash report from it at next boot (read_crash_log resolves /disk//crash.log through the FAT path, since Disk nodes hold no cached children). - fat.rs: volume_label() + crash_vol() (no allocation) - fs.rs: write_crash_log targets crash_vol(); read_crash_log prefers the CRASHLOG disk node; drop now-unused first_disk() - mkdisk.sh: --label option - test-fault.sh: boots with a dedicated CRASHLOG stick (mkfs -F 32 -n CRASHLOG), verifies crash.log lands there and NOT on the ESP --- scripts/mkdisk.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts/mkdisk.sh') diff --git a/scripts/mkdisk.sh b/scripts/mkdisk.sh index 6bdd50c..2c62f76 100755 --- a/scripts/mkdisk.sh +++ b/scripts/mkdisk.sh @@ -9,6 +9,7 @@ # ./scripts/mkdisk.sh --size 128M # different size (default 64M) # ./scripts/mkdisk.sh /path/img # custom image path # ./scripts/mkdisk.sh --no-seed # skip the seed/ directory +# ./scripts/mkdisk.sh --label CRASHLOG # volume label (default RSDOS) # # The image is created with `mkfs.fat -C`, which is the option that # actually creates the file — plain `mkfs.fat` only writes into an @@ -23,6 +24,7 @@ IMG="/tmp/disk.img" SIZE="64M" FRESH=0 SEED_DIR="$PROJECT_DIR/seed" +LABEL="RSDOS" while [ $# -gt 0 ]; do case "$1" in @@ -32,6 +34,10 @@ while [ $# -gt 0 ]; do SIZE="$1" ;; --no-seed) SEED_DIR="" ;; + --label) + shift + LABEL="$1" + ;; --help | -h) head -20 "$0" | grep "^#" | sed 's/^# \?//' exit 0 @@ -65,9 +71,9 @@ if [ -z "$SIZE_BLOCKS" ] || [ "$SIZE_BLOCKS" -le 0 ] 2>/dev/null; then exit 1 fi -echo "mkdisk: creating $IMG ($SIZE FAT32, label RSDOS)" +echo "mkdisk: creating $IMG ($SIZE FAT32, label $LABEL)" rm -f "$IMG" -mkfs.fat -C -F 32 -n RSDOS "$IMG" "$SIZE_BLOCKS" +mkfs.fat -C -F 32 -n "$LABEL" "$IMG" "$SIZE_BLOCKS" if [ -n "$SEED_DIR" ] && [ -d "$SEED_DIR" ]; then if ! command -v mcopy >/dev/null 2>&1; then -- cgit v1.2.3