Re: [RFC] Provide in-kernel headers for making it easy to extend the kernel

From: Norbert Lange
Date: Sat Jan 26 2019 - 07:06:04 EST

I have a similar problem, which is caused by an attempt to separate
the kernel installation
from the rootfs. updates of the kernel should not affect the
(read-only) rootfs or initramfs.
For technical reasons I am unable to built all modules static.

- have multiple kernels #K and rootfs installations #R without needing
#R times #N module subdirectories. (think of fallback kernels/installations)
- be able to use readonly rootfs, and need to regenerate it for new kernels.
- ideally be as space efficient as possible

I ended up embedding an initramfs in the kernel, but this has the
annoying drawback of disabling the builtin init of the kernel so I
needed to further add busybox and shellscripts just to get it to parse
the cmdline and boot.
I used a compressed squashfs for the kernel modules, further requiring
a loop device.

So the point I am trying to make, that there could be a better
approach for my problem,
like having the kernel expose a blockdevice in /proc/bundle.img (no
need for a loopdevice).
Maybe some more generic approach would cover both this issue as well
as the problem with kernel headers on android. The /proc/kheaders.tgz
file is very specific.

(Well, I would be happy if there is a way to keep the kernels builtin
init enabled, even if a custon initramfs is builtin)