serpent-os / boulder-d-legacy

Replaced by Rust tooling
https://serpentos.com
21 stars 7 forks source link

boulder: Implement helper to chroot into a recipe's build environment #51

Closed joebonrichie closed 1 year ago

joebonrichie commented 1 year ago

boulder chroot allows the user to easily chroot into the build environment of a recipe using moss-container. If the build environment doesn't already exist, it'll be created from scratch.

The chroot command will also install some useful packages for chroot usage, such as git.

ermo commented 1 year ago

so, just for the record, the CLI interface I'd love to have looks something like this:

boulder build --chroot-stage=pre-build <somestone.yml> -p <some_profile>

pre-build is "first thing in the build stage", whereas post-setup is "last thing in the setup stage" (as there may be different things exposed in each stage).

This works around the "the dirs we want don't exist" issue, because the dirs have to exist for boulder to be able to do its thing.

EDIT:

The rationale for this is that we can arrive at a stage in pristine condition before anything is run. This means that we can be dumped into a chroot of, say, a kernel build and have everything ready for a make menuconfig run inside the chroot and then complete it, save the new config, smuggle it out, add new config, build, done.

No need to have a separate kernel tree and we're not having to change the recipe from its production form to achieve this, which minimises human error re. leaving in statements by accident.

joebonrichie commented 1 year ago

Found a case where if you ctrl+c a build then try to chroot into it, chroot'ing will fail. Needs fixing.

joebonrichie commented 1 year ago

ping