I want to embed an initramfs into my kernel at build time, but to create the rootfs image I need access to a number of modules for the kernel I'm about to build.
What is the proper way to resolve this apparent chicken/egg problem of building the modules, then the initramfs, and then finally the kernel proper?
I can't seem to find much documentation on this particular workflow. One option I am considering (since this is an embedded device with a known hardware config) is to just forego modules for any boot-time required code.
I guess a better question is in order. Here's some additional info:
This is running on the Raspberry Pi which has it's own closed-source bootloader which can be configured via a couple text files in the boot partition.
The main impetus of this question is to ease updates in the nearterm (being able to just ship the kernel/initramfs in a single package without fiddling with bootloader configs that don't support logic for calculating addr offsets), to ease future migration to a secure boot chain (most likely through an interposed uboot loader; more files, more signatures, more pain), and to keep our OS build process simple (doesn't currently use a discrete bootloader).
The more I look at it, the more I'm leaning towards just spending a day and getting uboot integrated into our build pipeline and not looking back. It just seems the whole Linux boot process is overly complex--especially for a fixed hardware spec system--and I'm trying to find ways to simplify through degeneralization.