From 298528581d1a29032a1224600297316384d4e4f7 Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 21 Aug 2026 19:13:52 +0200 Subject: image: single dd-able system.img replaces vvfat+data-disk pair MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mksystem.sh stages one FAT32 image: \bzImage + \initramfs.cpio.gz (rsbl paths), \EFI\BOOT\BOOTX64.EFI (kernel direct by default, --chain for rsboot), \etc\motd.txt, empty \bin\cli + \bin\gui, seed files at the root. --gpt wraps it in a partition table for real USB dd targets. Makefile: run/run-gui/debug attach only system.img on ide.0 (vvfat lines deleted); stamp-based 'system' target rebuilds only when the kernel is newer, so runtime writes survive reboots; system-fresh wipes; inspect lists via mtools. build-image.sh/mkdisk.sh removed. test-disk.sh boots system.img with a throwaway OVMF varstore — a stale NvVars makes the firmware skip the \EFI\BOOT fallback. sendkeys.py pacing 50ms->250ms/1.5s: keystroke loss under host load corrupted typed lines (guest-side PS/2 ring overflow). Gate: test-disk PASS (fsck clean, file survives poweroff). --- scripts/mkdisk.sh | 91 ------------------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100755 scripts/mkdisk.sh (limited to 'scripts/mkdisk.sh') diff --git a/scripts/mkdisk.sh b/scripts/mkdisk.sh deleted file mode 100755 index 2c62f76..0000000 --- a/scripts/mkdisk.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash -# -# scripts/mkdisk.sh — create (or re-create) the FAT32 data disk that the -# kernel mounts at /disk. -# -# Usage: -# ./scripts/mkdisk.sh # create /tmp/disk.img (64M) if missing -# ./scripts/mkdisk.sh --fresh # re-format (wipes the image!) -# ./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 -# existing one. Files from seed/ (if present) are copied in with mtools. -# -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -PROJECT_DIR="$(dirname "$SCRIPT_DIR")" - -IMG="/tmp/disk.img" -SIZE="64M" -FRESH=0 -SEED_DIR="$PROJECT_DIR/seed" -LABEL="RSDOS" - -while [ $# -gt 0 ]; do - case "$1" in - --fresh) FRESH=1 ;; - --size) - shift - SIZE="$1" - ;; - --no-seed) SEED_DIR="" ;; - --label) - shift - LABEL="$1" - ;; - --help | -h) - head -20 "$0" | grep "^#" | sed 's/^# \?//' - exit 0 - ;; - *) - IMG="$1" - ;; - esac - shift -done - -if [ -f "$IMG" ] && [ "$FRESH" -eq 0 ]; then - echo "mkdisk: $IMG already exists (use --fresh to re-format)" - exit 0 -fi - -if ! command -v mkfs.fat >/dev/null 2>&1; then - echo "mkdisk: mkfs.fat not found — install dosfstools (sudo apt install dosfstools)" >&2 - exit 1 -fi - -# mkfs.fat sizes are 1024-byte blocks; accept M/G/K suffixes too. -case "$SIZE" in -*G) SIZE_BLOCKS=$((${SIZE%G} * 1024 * 1024)) ;; -*M) SIZE_BLOCKS=$((${SIZE%M} * 1024)) ;; -*K) SIZE_BLOCKS=$((${SIZE%K})) ;; -*) SIZE_BLOCKS="$SIZE" ;; -esac -if [ -z "$SIZE_BLOCKS" ] || [ "$SIZE_BLOCKS" -le 0 ] 2>/dev/null; then - echo "mkdisk: bad size '$SIZE' (use e.g. 64M or 65536)" >&2 - exit 1 -fi - -echo "mkdisk: creating $IMG ($SIZE FAT32, label $LABEL)" -rm -f "$IMG" -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 - echo "mkdisk: warning: mcopy not found — skipping seed files (install mtools)" >&2 - else - echo "mkdisk: seeding from $SEED_DIR/" - for f in "$SEED_DIR"/*; do - [ -f "$f" ] || continue - mcopy -i "$IMG" "$f" "::/$(basename "$f")" - echo " -> $(basename "$f")" - done - fi -fi - -echo "mkdisk: done — boot with: make run (or: ./scripts/boot.sh)" -- cgit v1.2.3