Gentoo Archives: gentoo-commits

From: Richard Yao <ryao@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:ryao commit in: /
Date: Thu, 06 Jun 2013 05:57:20
Message-Id: 1370498024.26dd05c7c47e06cd0d883714f41cc053209eb2cc.ryao@gentoo
1 commit: 26dd05c7c47e06cd0d883714f41cc053209eb2cc
2 Author: Richard Yao <ryao <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 6 05:53:44 2013 +0000
4 Commit: Richard Yao <ryao <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 6 05:53:44 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=26dd05c7
7
8 Replace existing modules.* files with modules.dep.bb, bug #472312
9
10 Busybox has code that enables us to avoid using a modules.dep file at
11 the expense of some speed. It was found that it fails to get
12 dependencies correct, which prevents some modules from loading properly.
13 We switch to explicit generation of modules.dep.bb to resolve this. At
14 the same time, we remove various modules.* files that are not used by
15 busybox to save space. The inclusion of modules.dep.bb should make
16 module loading slightly faster. The removal of the modules.* should
17 make the initramfs slightly smaller.
18
19 Signed-off-by: Richard Yao <ryao <AT> gentoo.org>
20
21 ---
22 gen_initramfs.sh | 19 ++++++++++++++++++-
23 1 file changed, 18 insertions(+), 1 deletion(-)
24
25 diff --git a/gen_initramfs.sh b/gen_initramfs.sh
26 index 6ad51c1..7ff6ea0 100755
27 --- a/gen_initramfs.sh
28 +++ b/gen_initramfs.sh
29 @@ -796,7 +796,7 @@ create_initramfs() {
30 append_data 'overlay'
31 fi
32
33 - # Finalize cpio by removing duplicate files
34 + # Finalize cpio by removing duplicate files and generating modules.dep.bb
35 print_info 1 " >> Finalizing cpio"
36 local TDIR="${TEMP}/initramfs-final"
37 mkdir -p "${TDIR}"
38 @@ -804,6 +804,23 @@ create_initramfs() {
39
40 cpio --quiet -i -F "${CPIO}" 2> /dev/null \
41 || gen_die "extracting cpio for finalization"
42 +
43 + # Remove unused modules.* files
44 + rm "${TDIR}/lib/modules/${KV}/modules."*
45 +
46 + # Hack to workaround broken `busybox depmod -b`
47 + touch "${TDIR}/proc/modules"
48 + if [ ${UID} -eq 0 ]
49 + then
50 + chroot "${TDIR}" /bin/busybox depmod "${KV}" \
51 + || gen_die "generating busybox modules.dep"
52 +
53 + else
54 + fakechroot fakeroot chroot "${TDIR}" /bin/busybox depmod "${KV}" \
55 + || gen_die "generating busybox modules.dep"
56 + fi
57 + rm "${TDIR}/proc/modules"
58 +
59 find . -print | cpio ${CPIO_ARGS} -F "${CPIO}" 2>/dev/null \
60 || gen_die "recompressing cpio"