Files
LithosAnanake/scripts/bleach_zuse_img.sh
T
Robert Allan JamesandClaude Sonnet 5 8717416d36
Build / build-amd64-iso (push) Waiting to run
Build / build-aarch64-iso (push) Waiting to run
Build / build-riscv64-img (push) Waiting to run
FABRIC-3.md: version correction -- LITHOS_VERSION back to 2.0.0, plus a rename-gap fix
LITHOS_VERSION 2.0.1 was premature: per this project's own versioning
policy, 2.0.1 claims SER5 hardware-track progress (RDRAND backend +
thumbdrive image) that was never actually verified on real hardware --
that verification is FABRIC-3.md's own open topic. Reset to 2.0.0
(still a QEMU-only release, correctly). Verified 3-arch boot shows
"LithosAnanke v2.0.0" in each serial log directly, not assumed from the
Makefile edit alone.

Also closes a real gap found in today's earlier FABRIC-series rename:
Makefile.starkernel, Kconfig.kernel, scripts/bleach_zuse_img.sh, four
proof/*.thy files, and isr.S were never swept -- the original file list
only matched *.md/*.c/*.h/*.4th, silently skipping every other
extension. Fixed with the same safe placeholder substitution.
.claude/settings.local.json's historical permission-grant log and
ClaudeEXPORT/'s frozen export were deliberately left untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YcT3H2PQeyujrzjqS3Var
2026-09-04 11:53:44 -04:00

56 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# bleach_zuse_img.sh - Reset disk/zuse.img (or any home-blocks test image)
# back to pristine/unminted state.
#
# disk/zuse.img simulates the physical Zuse superuser thumbdrive for QEMU
# testing (FABRIC-2.md, Phase 8 kickoff). "Bleaching" it means restoring the
# all-zero blank state homeblocks_sig_check() reads as HOMEBLOCKS_SIG_BLANK
# -- i.e. simulating a genuine first boot, so the one-time mint-Zuse flow can
# be exercised repeatedly during development without hand-regenerating the
# whole image each time.
#
# 64MB is only this script's default -- an arbitrary QEMU-test convenience
# size (matching the existing usb-thumbdrive-test.img precedent for BOT
# driver testing scale), not a constraint on real home-blocks thumbdrives.
# The design is not bound to any particular drive size: homeblocks_sig_t's
# own metadata_devblocks field records whatever size is actually observed,
# nothing in the format or this repo hardcodes one. Override with --size-mb
# for a different test size.
#
# Deliberately a flat/raw image, not GPT-partitioned, matching the same
# simplifying assumption homeblocks_sig_check()'s current call site in
# repl.c uses (sig_start_fblock=0) -- both will need to move to a real
# GPT-partition-relative offset together, once a GPT parser exists. Not
# invented ahead of that work here.
#
# Usage: scripts/bleach_zuse_img.sh [path] [--size-mb N]
# path Optional override; defaults to disk/zuse.img relative to repo root.
# --size-mb N Optional override; defaults to 64 (arbitrary test convenience, see above).
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
IMG="$REPO_ROOT/disk/zuse.img"
SIZE_MB=64
while [ $# -gt 0 ]; do
case "$1" in
--size-mb)
SIZE_MB="$2"
shift 2
;;
*)
IMG="$1"
shift
;;
esac
done
if [ -e "$IMG" ] && [ ! -f "$IMG" ]; then
echo "bleach_zuse_img: refusing to overwrite non-regular-file '$IMG'" >&2
exit 1
fi
dd if=/dev/zero of="$IMG" bs=1M count="$SIZE_MB" status=none
echo "bleach_zuse_img: $IMG reset to ${SIZE_MB}MB blank (pristine/unminted)"