$ uname -a A_BLOG_ABOUT_UNIX_TOOLS_AND_THE_BEAUTY_OF_SIMPLE_SYSTEMS
SYS.YEAR  2026
← Back to articles
2026-09-09ARTICLE

Webfs

Design and implement a lightweight immutable WebFS system for Apache NuttX targeting the ESP32-C3. The goal is to efficiently host a large static blog containing hundreds or thousands of HTML, CSS, JavaScript, image, font, and other assets while minimizing RAM usage, CPU overhead, filesystem complexity, and network copies. Create a host-side mkwebfs tool that takes a static-site directory and produces a compact WebFS image. The image should contain a versioned header, file index, path metadata, MIME types, compression metadata, integrity information, and packed file data. Support offline gzip compression for compressible assets while preserving already-compressed formats. Optimize the index for fast path lookup with minimal RAM requirements.

Create a NuttX WebFS runtime capable of mounting an image directly from flash and efficiently resolving HTTP paths to immutable assets. Design the API so an HTTP server such as NuttX thttpd can use WebFS as a specialized static-content backend without filesystem mutation or unnecessary allocation. Aim for zero heap allocations on the normal request path.

Design the format for atomic OTA updates using A/B blog partitions. Include image validation, versioning, SHA-256 integrity checks, safe activation, rollback after interrupted updates, and future extensibility.

Provide architecture, on-flash format, APIs, build integration, implementation plan, tests, benchmarks, and an initial working prototype.