Thread (52 messages) 52 messages, 9 authors, 2019-03-08

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

From: hpa@zytor.com
Date: 2019-01-21 08:02:55
Also in: lkml

On January 20, 2019 8:10:03 AM PST, Joel Fernandes [off-list ref] wrote:
On Sat, Jan 19, 2019 at 11:01:13PM -0800, hpa@zytor.com wrote:
quoted
On January 19, 2019 2:36:06 AM PST, Greg KH
[off-list ref] wrote:
quoted
quoted
On Sat, Jan 19, 2019 at 02:28:00AM -0800, Christoph Hellwig wrote:
quoted
This seems like a pretty horrible idea and waste of kernel memory.
It's only a waste if you want it to be a waste, i.e. if you load the
kernel module.

This really isn't any different from how /proc/config.gz works.
quoted
Just add support to kbuild to store a compressed archive in
initramfs
quoted
quoted
quoted
and unpack it in the right place.
I think the issue is that some devices do not use initramfs, or
switch
quoted
quoted
away from it after init happens or something like that.  Joel has
all
quoted
quoted
of
the looney details that he can provide.

thanks,

greg k-h
Yeah, well... but it is kind of a losing game... the more in-kernel
stuff there is the less smiley are things to actually be supported.

It is better than nothing, and if this makes things a bit easier and
solves
real-world issues people have been having, and is optional, then I
don't see
why not.
quoted
Modularizing is it in some ways even crazier in the sense that at
that point you are relying on the filesystem containing the module,
which has to be loaded into the kernel by a root user. One could even
wonder if a better way to do this would be to have "make
modules_install" park an archive file – or even a directory as opposed
to a symlink – with this stuff in /lib/modules. We could even provide a
tmpfs shim which autoloads such an archive via the firmware loader;
this might even be generically useful, who knows.

All this seems to assume where the modules are located. In Android, we
don't
have /lib/modules. This patch generically fits into the grand scheme
things
and I think is just better made a part of the kernel since it is not
that
huge once compressed, as Dan also pointed. The more complex, and the
more
assumptions we make, the less likely people writing tools will get it
right
and be able to easily use it.
quoted
Note also that initramfs contents can be built into the kernel.
Extracting such content into a single-instance tmpfs would again be a
possibility

Such an approach would bloat the kernel image size though, which may
not work
for everyone. The module based approach, on the other hand, gives an
option
to the user to enable the feature, but not have it loaded into memory
or used
until it is really needed.

thanks,

- Joel
Well, where are the modules? They must exist in the filesystem.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help