Separate prepare-root static path
authorColin Walters <walters@verbum.org>
Sat, 17 Jun 2023 14:05:22 +0000 (10:05 -0400)
committerColin Walters <walters@verbum.org>
Fri, 30 Jun 2023 09:18:23 +0000 (05:18 -0400)
commitd6799ecc243befcf714bcf54dbbd41da13a6e290
treeea3d46319d14f3cb489894ad88d6b016dad8cf6e
parentc2ad2d23aeb23c474f01ee64adee8953559773ab
Separate prepare-root static path

We should have done this a long time ago.  We don't have any test
coverage for the no-initramfs path, and I think it's not long
term supportable as we want to add more features like composefs.

Particularly now that there's good support for embedding an
initramfs in a kernel image, I see little value in a path for
having custom static linking for this prepare root flow.

That said, we will continue to make a best-effort "it compiles"
attempt to support it.

Fork the "pid 1" prepare root code into a new
`ostree-prepare-root-static.c` file, and drop the runtime conditionals.

We can drop the composefs logic from `-static.c` which ends up
keeping that file much smaller.

A further next step here will be to actually fold the
`prepare-root.c` logic into the main `ostree` binary which we
can then just include in the initramfs.
Makefile-switchroot.am
src/switchroot/ostree-prepare-root-static.c [new file with mode: 0644]
src/switchroot/ostree-prepare-root.c