Stoatworks Labs

System Graft

Graft modules into an initrd

Releasedv0.1.1ApplicationPython
System Graft — Graft modules into an initrd
A completed patch: the detected SquashFS image, the module being injected, and the verification pass in the log below.

What it does

Injects out-of-tree kernel modules into a SquashFS initrd, adds a load hook to the image's init scripts, and writes the result to bootable removable media. You supply the image and you supply the modules — it ships neither, contains no third-party firmware or binaries, and never modifies its input.

The typical case: an appliance Linux image ships a monolithic kernel with a narrow built-in driver set, and you need a driver for hardware you own that the vendor's build didn't include. Doing it by hand with unsquashfs and mksquashfs silently produces a broken image — ownership is lost and setuid bits are dropped on a non-root round trip.

  • Faithful repack: ownership, setuid and setgid bits and the full permission table preserved
  • Wires the module into the image's init sequence
  • A verification pass reporting the preserved bits, the injected module's presence and a sha256 of the result
  • Bootable UEFI USB writer
  • GUI and CLI, and it always writes a new file rather than touching the input

Where it stands

Released at v0.1.1. The patch path is covered by 16 tests on Ubuntu and macOS in CI and has been exercised against a real appliance firmware image. The USB writer has only ever been run against an attached disk image, never a physical stick; no image it produced has been booted on real hardware; and the Linux write path is implemented but untested. It repartitions and erases block devices — confirm the target twice.