public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Robinson <andr345@gmail.com>
To: sam@ravnborg.org, rusty@rustcorp.com.au
Cc: linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel.
Date: Sun, 15 Feb 2009 19:20:22 +0100	[thread overview]
Message-ID: <1234722028-8110-1-git-send-email-andr345@gmail.com> (raw)

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.


             reply	other threads:[~2009-02-15 18:20 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-15 18:20 Andreas Robinson [this message]
2009-02-15 18:20 ` [RFC PATCH 1/6] New option: Static linking of external modules Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 2/6] module: add module ELF section with module_init() pointer Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 3/6] module: always prefix module parameters with the module name Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 4/6] kbuild: allow linking of an external object into vmlinux Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 5/6] scripts: new module preprocessor for static linking Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 6/6] kbuild: enable relinking of vmlinux without full kernel tree Andreas Robinson
2009-02-16 22:51 ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Rusty Russell
2009-02-17 10:42   ` Andreas Robinson
2009-02-17 11:53     ` Kay Sievers
2009-02-18  4:58       ` Rusty Russell
2009-02-18  9:15         ` Kay Sievers
2009-02-18 10:25           ` Andreas Robinson
2009-02-20  0:37             ` Andreas Robinson
2009-02-20  1:55               ` Kay Sievers
2009-02-21 11:43                 ` Andreas Robinson
2009-03-02 14:32                   ` Andreas Robinson
2009-03-02 15:59                     ` Kay Sievers
2009-03-02 16:20                     ` Arjan van de Ven
2009-03-02 16:29                       ` Kay Sievers
2009-03-02 18:27                         ` Arjan van de Ven
2009-03-02 21:41                           ` Andreas Robinson
2009-03-04 18:47                           ` Andreas Robinson
2009-03-06  0:18                             ` Arjan van de Ven
2009-03-06 15:15                               ` Andreas Robinson
2009-03-06 15:45                                 ` Arjan van de Ven
2009-03-08 10:47                                   ` Andreas Robinson
2009-03-08 16:01                                     ` Arjan van de Ven
2009-03-08 20:13                                       ` [PATCH] sata_nv: add a module parameter to enable async scanning Andreas Robinson
2009-03-09 17:12                                       ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Will Newton
2009-03-06  7:05                       ` fastboot kernel parameter Sitsofe Wheeler
2009-03-06 11:23                         ` Arjan van de Ven
2009-02-24  1:27               ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Rusty Russell
2009-02-18 11:57           ` Rusty Russell
2009-02-18 13:57             ` Kay Sievers
2009-02-19 11:15               ` Rusty Russell
2009-02-19 11:41                 ` Kay Sievers
2009-02-19 20:48                   ` Kay Sievers
2009-02-19 21:59                     ` Kay Sievers
2009-02-20  0:58                       ` Rusty Russell
2009-02-20  1:33                         ` Kay Sievers
2009-02-24  1:39                           ` Rusty Russell
2009-02-20 11:32                         ` Rusty Russell
2009-02-23 16:42                           ` Kay Sievers
2009-02-25  7:03                             ` Rusty Russell
2009-02-25 18:12                               ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1234722028-8110-1-git-send-email-andr345@gmail.com \
    --to=andr345@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox