From: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: neilb-l3A5Bk7waGM@public.gmane.org,
jacek.danecki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: [RFC PATCH 1/3] gen-mod-lists: create lists of modules that may talk to a root device
Date: Thu, 05 Feb 2009 15:49:15 -0700 [thread overview]
Message-ID: <20090205224915.18610.86035.stgit@dwillia2-linux.ch.intel.com> (raw)
In-Reply-To: <20090205224808.18610.14957.stgit-p8uTFz9XbKjBPTuBivz2/GFmcEqAMTzPQQ4Iyu8u01E@public.gmane.org>
notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org:
The idea is that we don't want to include every single module,
but we want to include every module that might define a block
device to boot from, or a network device to network boot from.
Having it in the upstream kernel would be helpful, although how
it's generated now is obviously a hack.
Doing it at runtime in dracut would work, but would be obviously
slow.
This is a temporary hack to duplicate this functionality from the
Fedora kernel srpm in dracut.
Also added "raid" modules.
Signed-off-by: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
gen-mod-lists | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
create mode 100755 gen-mod-lists
diff --git a/gen-mod-lists b/gen-mod-lists
new file mode 100755
index 0000000..13999d7
--- /dev/null
+++ b/gen-mod-lists
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Copied from from kernel.spec (kernel-2.6.27.12-78.2.8.fc9.src.rpm)
+# Creates /lib/modules/$KernelVer/modules.{block,networking,raid}
+
+KernelVer=$1
+[ -n $KernelVer ] && KernelVer=$(uname -r)
+
+if [ ! -d /lib/modules/$KernelVer ]; then
+ echo "error: could not find /lib/modules/$KernelVer"
+ exit 1
+fi
+
+find /lib/modules/$KernelVer -name "*.ko" -type f >modnames
+
+# Generate a list of modules for block and networking.
+
+fgrep /drivers/ modnames | xargs --no-run-if-empty nm -upA |
+sed -n 's,^.*/\([^/]*\.ko\): *U \(.*\)$,\1 \2,p' > drivers.undef
+
+collect_modules_list()
+{
+ sed -r -n -e "s/^([^ ]+) \\.?($2)\$/\\1/p" drivers.undef |
+ LC_ALL=C sort -u > /lib/modules/$KernelVer/modules.$1
+}
+
+collect_modules_list networking \
+ 'register_netdev|ieee80211_register_hw|usbnet_probe'
+collect_modules_list block \
+ 'ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register'
+
+# mdraid modules, could be made part of 'block'
+collect_modules_list raid \
+ 'register_md_personality'
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-02-05 22:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 22:49 [RFC PATCH 0/3] mdraid rootfs support Dan Williams
[not found] ` <20090205224808.18610.14957.stgit-p8uTFz9XbKjBPTuBivz2/GFmcEqAMTzPQQ4Iyu8u01E@public.gmane.org>
2009-02-05 22:49 ` Dan Williams [this message]
2009-02-05 22:49 ` [RFC PATCH 2/3] raid: external and internal metadata support Dan Williams
[not found] ` <20090205224920.18610.63979.stgit-p8uTFz9XbKjBPTuBivz2/GFmcEqAMTzPQQ4Iyu8u01E@public.gmane.org>
2009-02-06 16:40 ` Jeremy Katz
[not found] ` <20090206164019.GD552-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-02-06 16:50 ` Danecki, Jacek
[not found] ` <A9DE54D0CD747C4CB06DCE5B6FA2246F4B496AFA-IGOiFh9zz4yvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-02-06 16:55 ` Dan Williams
2009-02-06 16:56 ` Bill Nottingham
[not found] ` <20090206165601.GF11144-Zdt1ptygihhQcNjhGXsBABcY2uh10dtjAL8bYrjMMd8@public.gmane.org>
2009-02-06 17:27 ` Dan Williams
[not found] ` <e9c3a7c20902060927j2b900940kd851573469110135-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-06 17:38 ` Bill Nottingham
[not found] ` <20090206173814.GA3541-Zdt1ptygihhQcNjhGXsBABcY2uh10dtjAL8bYrjMMd8@public.gmane.org>
2009-02-06 18:00 ` Jacek Danecki
[not found] ` <498C7AD8.6080105-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2009-02-06 19:34 ` NeilBrown
[not found] ` <2c0cae741a7229789cd777d93180072a.squirrel-eq65iwfR9nKIECXXMXunQA@public.gmane.org>
2009-02-06 20:03 ` Bill Nottingham
2009-02-08 19:08 ` Szabolcs Szakacsits
2009-02-06 18:12 ` Dan Williams
[not found] ` <e9c3a7c20902061012w15a31e7br6ce2074b7b9db555-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-06 18:21 ` Bill Nottingham
[not found] ` <20090206182118.GA4413-Zdt1ptygihhQcNjhGXsBABcY2uh10dtjAL8bYrjMMd8@public.gmane.org>
2009-02-06 19:19 ` Dan Williams
[not found] ` <e9c3a7c20902061119i2120cc5fpda0a5cdc3aedc17b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-06 20:08 ` Bill Nottingham
[not found] ` <20090206200818.GC6150-Zdt1ptygihhQcNjhGXsBABcY2uh10dtjAL8bYrjMMd8@public.gmane.org>
2009-02-06 20:21 ` NeilBrown
[not found] ` <8c48d75b834c74adc39b6e904a44237e.squirrel-eq65iwfR9nKIECXXMXunQA@public.gmane.org>
2009-02-06 20:27 ` Bill Nottingham
2009-02-06 20:26 ` Dan Williams
[not found] ` <e9c3a7c20902061226m3f1e9e55pc2986a8527ade77-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-09 20:19 ` Warren Togami
2009-02-08 19:16 ` Szabolcs Szakacsits
2009-02-06 18:02 ` Dan Williams
2009-02-05 22:49 ` [RFC PATCH 3/3] add more disk id helpers to udevexe Dan Williams
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=20090205224915.18610.86035.stgit@dwillia2-linux.ch.intel.com \
--to=dan.j.williams-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jacek.danecki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=neilb-l3A5Bk7waGM@public.gmane.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