Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 100342 - baselayout-1.11.13 modules-update speedup patch
Summary: baselayout-1.11.13 modules-update speedup patch
Status: RESOLVED DUPLICATE of bug 55329
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-26 02:58 UTC by Magnus Damm
Modified: 2005-07-26 03:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
the patch (baselayout-1.11.13-modules-update.patch,731 bytes, patch)
2005-07-26 03:00 UTC, Magnus Damm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Damm 2005-07-26 02:58:48 UTC
Hello,

This patch saves 13 seconds of init time for me using baselayout-1.11.13. The
patch will not apply cleanly to baselayout-1.12.0_pre2, the modules-update
script seems to be rewritten there. Thanks.

--- /sbin/modules-update        2005-07-22 17:02:01.000000000 +0900
+++ ./modules-update    2005-07-26 18:46:03.000000000 +0900
@@ -64,6 +64,22 @@
        echo "${dep}"
 }

+# Magnus Damm <magnus@valinux.co.jp> 20050724:
+#
+# the most common case is probably that no regeneration of files is required.
+# so let's use the dates of the files to determine if early exit is possible.
+#
+# this saves 13 seconds of init time on my 667 MHz Sony Vaio C1MR/BP.
+#
+
+# exit if $CFGFILE2 exists and no files in $MODDIR are newer than $CFGFILE2
+
+if [ ${KERNEL_2_5} -a -e ${CFGFILE2} -a -z "${CONF}" ]; then
+       if [ `find ${MODDIR} -type f -newer ${CFGFILE2} | wc -l` -eq 0 ]; then
+               exit 0;
+       fi
+fi
+
 CFGFILES="${CFGFILE}"

 if ${KERNEL_2_5}; then


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Magnus Damm 2005-07-26 03:00:29 UTC
Created attachment 64337 [details, diff]
the patch

Yep, here it is if the inlined patch was mangeled.
Comment 2 Sven Wegener gentoo-dev 2005-07-26 03:07:56 UTC

*** This bug has been marked as a duplicate of 55329 ***