From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BE2641381F3 for ; Thu, 6 Jun 2013 05:57:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5B567E0957; Thu, 6 Jun 2013 05:57:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DE436E0957 for ; Thu, 6 Jun 2013 05:57:12 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EAC4F33E30B for ; Thu, 6 Jun 2013 05:57:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 844A5E468F for ; Thu, 6 Jun 2013 05:57:10 +0000 (UTC) From: "Richard Yao" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Richard Yao" Message-ID: <1370498024.26dd05c7c47e06cd0d883714f41cc053209eb2cc.ryao@gentoo> Subject: [gentoo-commits] proj/genkernel:ryao commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: ryao X-VCS-Committer-Name: Richard Yao X-VCS-Revision: 26dd05c7c47e06cd0d883714f41cc053209eb2cc X-VCS-Branch: ryao Date: Thu, 6 Jun 2013 05:57:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 40a7c765-0d07-4aa4-a3d0-5eafe991ac5e X-Archives-Hash: 71a391dee3158d3d38a613e1113236bc commit: 26dd05c7c47e06cd0d883714f41cc053209eb2cc Author: Richard Yao gentoo org> AuthorDate: Thu Jun 6 05:53:44 2013 +0000 Commit: Richard Yao gentoo org> CommitDate: Thu Jun 6 05:53:44 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=26dd05c7 Replace existing modules.* files with modules.dep.bb, bug #472312 Busybox has code that enables us to avoid using a modules.dep file at the expense of some speed. It was found that it fails to get dependencies correct, which prevents some modules from loading properly. We switch to explicit generation of modules.dep.bb to resolve this. At the same time, we remove various modules.* files that are not used by busybox to save space. The inclusion of modules.dep.bb should make module loading slightly faster. The removal of the modules.* should make the initramfs slightly smaller. Signed-off-by: Richard Yao gentoo.org> --- gen_initramfs.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 6ad51c1..7ff6ea0 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -796,7 +796,7 @@ create_initramfs() { append_data 'overlay' fi - # Finalize cpio by removing duplicate files + # Finalize cpio by removing duplicate files and generating modules.dep.bb print_info 1 " >> Finalizing cpio" local TDIR="${TEMP}/initramfs-final" mkdir -p "${TDIR}" @@ -804,6 +804,23 @@ create_initramfs() { cpio --quiet -i -F "${CPIO}" 2> /dev/null \ || gen_die "extracting cpio for finalization" + + # Remove unused modules.* files + rm "${TDIR}/lib/modules/${KV}/modules."* + + # Hack to workaround broken `busybox depmod -b` + touch "${TDIR}/proc/modules" + if [ ${UID} -eq 0 ] + then + chroot "${TDIR}" /bin/busybox depmod "${KV}" \ + || gen_die "generating busybox modules.dep" + + else + fakechroot fakeroot chroot "${TDIR}" /bin/busybox depmod "${KV}" \ + || gen_die "generating busybox modules.dep" + fi + rm "${TDIR}/proc/modules" + find . -print | cpio ${CPIO_ARGS} -F "${CPIO}" 2>/dev/null \ || gen_die "recompressing cpio"