Build customization

rsdk uses devenv to manage its development envrionronment, but itself is not nix based. nix has good support generating NixOS images, but here we are dealing with a Debian system, and some parts are currently missing.

We currently uses bdebstrap, which is a YAML frontend for mmdebstrap. mmdebstrap is the recommended tool for building RISC-V systems compared to traditional debootstrap.

YAML itself is not a templating language, so it cannot dynamically generate different configurations for different builds. We use jsonnet for this purpose.

Lastly, mmdebstrap does not handle disk image generation. We again use jsonnet to dynamically generate a guestfish script to handle this task.

All of those tools are glued by bash to provide a frontend, known as rsdk-build.

Depending on your goal, you would need the knowledge of some of the above tools.

Rootfs customization

rootfs.jsonnet is the entry point for rootfs template. It collects the various inputs and passes them to different modules.

Module loading order matters, as that will determine *-hooks's execution order. The safest way is to only edit the customize-hooks field in rootfs.jsonnet and only adding new entries after the existing ones.

You can also edit the packages field in rootfs.jsonnet to add additional packages to the system. customize-hooks will be run after packages are installed in the rootfs.

Disk image customization

image.jsonnet is the template for the deployment script. It is generally not necessary to change this part.