velxio/docs
davidmonterocrespo24 93fd4617af feat(sim): boot_images module + Pi 3 emulation restored
Pi 3 simulation had been broken since at least April 2026 (51
fail-events / 24h per docs/PI3_EMULATION_BROKEN.md). Two distinct
defects compounded:

1. qemu_manager.py hard-coded paths for kernel8.img, a device-tree
   blob (under a DOS 8.3 short name!), and a 5.4 GiB Raspberry Pi OS
   SD image — none of which shipped in the repo or were pulled at
   image build.

2. qemu-system-arm + qemu-utils were missing from the Docker image
   entirely, so even with the boot files in place QEMU couldn't
   launch. Add both to Dockerfile.standalone (~200 MB).

The architecture fix is a new `app.services.boot_images` module:

  * Manifest-driven (boot_images/manifest.json, versioned in repo,
    declares SHA256 + size for each file, supports an optional
    `compressed.{encoding,sha256,size_bytes}` block for assets shipped
    as .zst).

  * `BootImageProvider` materialises files lazily, atomically (temp +
    rename), verifies SHA256 pre- AND post-decompression, caches under
    /var/cache/velxio/boot-images, serialises concurrent get() calls
    per image set via asyncio.Lock.

  * `AssetDownloader` Protocol with two impls:
    - `LicenseGatedDownloader` — same flow ESP32 / RISC-V QEMU libs
      use (VELXIO_BINARY_BASE_URL + VELXIO_LICENSE_KEY).
    - `LocalDirectoryDownloader` — for tests + in-prod use where the
      licence-module storage is already on the same filesystem (saves
      the loopback HTTP roundtrip on a 1.4 GiB blob).

  * `build_downloader_from_env()` picks one — local-dir wins if both
    sets of env vars are present, so the prod box short-circuits to
    direct disk reads automatically.

  * Lifespan hook in qemu_manager.py pre-warms the cache on container
    boot so first-time user requests don't pay the 30-60 s download
    + decompress latency.

Adding a future board kind (Pi 4 / Pi 5) is now: upload assets via
upload-binary.sh, append an entry to manifest.json, register a
lifespan pre-warm in the new board's service module. Zero edits to
provider.py / downloader.py.

Manifest entries for raspberry-pi-3:
  kernel8.img             9 695 883 bytes  (uncompressed)
  bcm2710-rpi-3-b.dtb        34 687 bytes  (uncompressed)
  raspios-trixie-armhf.img  5 729 419 264 bytes raw
                          / 1 488 002 803 bytes .zst on wire (zstd -19)
  source: 2026-04-21 build from raspberrypi.com

Tests: 21 new unit tests covering manifest parsing, integrity
helpers, both downloaders, and the provider's idempotent /
concurrent / integrity / decompression / warmup paths. In-process
FakeDownloader keeps the suite under 1 s and httpx-free.

Docs: new docs/BOOT_IMAGES.md describes the architecture, on-disk
layout, named-volume operation, and the procedure for adding a new
image set.
2026-05-16 05:41:46 +02:00
..
examples
img/boards Refactor code structure for improved readability and maintainability 2026-03-16 14:28:16 -03:00
wiki refactor: rename deploy/ → docker/ (container build, not host deploy) 2026-05-04 00:05:55 -03:00
ARCHITECTURE.md refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
BOOT_IMAGES.md feat(sim): boot_images module + Pi 3 emulation restored 2026-05-16 05:41:46 +02:00
BUILD-QEMU.md docs: BUILD-QEMU.md + 'Build QEMU from source' docs section 2026-05-14 05:44:10 +02:00
CUSTOM_CHIPS.md Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
ESP32C3_WIFI_BLUETOOTH.md refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
ESP32_EMULATION.md chore(oss): drop dead auth/DB dependencies from OSS image 2026-05-14 17:06:27 -03:00
ESP32_WIFI_BLUETOOTH.md refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
MCP.md
MICROPYTHON_IMPLEMENTATION.md feat: add comprehensive MicroPython implementation documentation for RP2040, ESP32, ESP32-S3, and ESP32-C3 boards 2026-03-29 23:50:55 -03:00
PICO_W_WIFI_EMULATION.md refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
RASPBERRYPI3_EMULATION.md Refactor code structure for improved readability and maintainability 2026-03-16 14:28:16 -03:00
RISCV_EMULATION.md refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
RP2040_EMULATION.md refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
SETUP_COMPLETE.md refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
THIRD_PARTY.md feat(components): swap BMP280 + ATtiny85 to fritzing art 2026-05-08 23:06:44 -03:00
analytics.md
components.md
emulator.md
getting-started.md Refactor code structure for improved readability and maintainability 2026-03-16 14:22:23 -03:00
img1.png
img2.png
img3.png
img4.png
img5.png Refactor code structure for improved readability and maintainability 2026-03-16 18:31:46 -03:00
img6.png Refactor code structure for improved readability and maintainability 2026-03-23 23:24:14 -03:00
intro.md Add ESP32 chip demos and comprehensive tests for I2C, SPI, and UART interactions 2026-04-28 19:24:39 -03:00
roadmap.md