lkml.org 
[lkml]   [2009]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel.
Date
Hi guys,

as you know, systems with custom kernels boot faster, since they don't
need an initramfs or have to install modules. But, building a custom
kernel it is not really practical if you are releasing a distro, for
example.

This patchset aims to eventually solve that problem. It lets you link
external modules statically to the kernel and achive much the same
effect as changing the configuration and recompiling. You only need a
small part of a precompiled kernel tree (20-30MB, debug syms stripped)
and it's fast (15 seconds or less on an ordinary desktop PC).

Status: "Works for me", but has a bunch of TODOs (see below).
However, I hope you can comment on the bits that are done so far.

Thanks,
Andreas

Patches
-------

The patches are against 2.6.29-rc5.

The implementation is quite straightforward. I hope you think the commit
messages in the patches are clear enough.

TODOs
-----

- A makefile target that copies and prunes the tree to minimal
size. Work in progress.

- Arch-specific changes to kbuild. X86 is done though still ugly so
it is not included yet. I need to work some more on it first.

- Documentation.

- Proper testing.

How to use this thing in its current state
------------------------------------------

- Enable the new configuration option and build the kernel.
- Install and reboot.
- Collect the pathnames of the loaded modules in a text file
in the order you want the kernel to initialize them.

I use the this script. It is a bit slow, but works well
enough. (When I remember to run updatedb first.)

-------------8<----------------------------------
#!/bin/sh
k_ver="2.6.29-rc4"
for module in `tac /proc/modules`
do
modname=`echo $module | cut -f 1 -d ' ' | sed -e s/[-_]/[-_]?/g`
locate --regex /lib/modules/$k_ver/.*/$modname.ko
done
-------------8<----------------------------------

- Preprocess the modules named in the text file
(called modules.lst here). Run from the kernel tree root:

scripts/ld_extmodules.sh modules.lst output.o

- Relink the kernel:

e.g make vmlinux L=1 EXTOBJ=output.o
or
make bzImage L=1 EXTOBJ=output.o

- Install it.

- Move the linked modules from /lib/modules/*
to some other location and run depmod.
This has to be done so that udev won't try to
insert them a second time.

- Enjoy.



\
 
 \ /
  Last update: 2009-02-15 19:23    [W:0.848 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site