Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
speeding up "calculation module dependencies" ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
c0balt
Guru
Guru


Joined: 04 Jul 2004
Posts: 441
Location: Germany

PostPosted: Fri Jul 30, 2004 9:47 pm    Post subject: speeding up "calculation module dependencies" ? Reply with quote

Hi,
everytime i boot i notice the "calculating module dependencies" line, which takes really long (compared to all the other stuff).
from the titel i suspect gentoo checks everytime which other modules the modules in autoload.d need.
as i dont change the modules in autoload.d is there a way to speed this up?

thx in advance
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Fri Jul 30, 2004 10:27 pm    Post subject: Reply with quote

maybe that will help:[TIP] Using psyco to speed up emerge

cheers

SteveB
Back to top
View user's profile Send private message
oberyno
Guru
Guru


Joined: 15 Feb 2004
Posts: 467
Location: /bin/zsh

PostPosted: Fri Jul 30, 2004 10:37 pm    Post subject: Reply with quote

You want this thread. If you are prepared to run modules-update everytime you make a new kernel, you can just comment out the module checking lines. There are some more complex solutions on the second page.
Back to top
View user's profile Send private message
c0balt
Guru
Guru


Joined: 04 Jul 2004
Posts: 441
Location: Germany

PostPosted: Fri Jul 30, 2004 10:42 pm    Post subject: Reply with quote

thx very much, ill read through it

edit:
omg, let alone the first two suggestions in the thread gave me a increase in boot time of about ~7sec which are about 28% !!!
gentoo just rocks ;)
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Sat Jul 31, 2004 7:57 pm    Post subject: Reply with quote

here´s my /etc/init.d/modules :
Code:
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/modules,v 1.30 2004/04/21 17:09:18 vapier Exp $

depend() {
   need checkroot hostname
   use isapnp
}

load_modules() {
   local x=
   local i=0
   local retval=0
   local modules=
   local modargs=
   local modcount=0
   local config="$1"

   [ -z "${config}" ] && return 0
   [ ! -r "${config}" ] && return 0

   # Loop over every line in $config
   eval $(awk '
      BEGIN {
         COUNT = 0 # Make sure COUNT is set
      }

      $0 !~ /(^[[:space:]]*(#|$))/ {
         if (MODULES == "")
            MODULES = $1
         else
            MODULES = MODULES " " $1
         
         # Not the greatest method to remove $1 from $0, but it works
         sub(/^[[:space:]]*[^[:space:]]*[[:space:]]*/, "")
         ARGS[COUNT] = $0
         COUNT++
      }
      
      END {
         # 'eval' will make sure these are set to proper bash variables
         print "modcount=" COUNT
         print "modules=\"" MODULES "\""
         for (x = 0;x < COUNT;x++)
            print "modargs[" x "]=\"" ARGS[x] "\""
      }
   ' "${config}")

   if [ "${modcount}" -gt 0 ]
   then
      einfo "Using ${config} as config:"
      
      for x in ${modules}
      do
         ebegin "  Loading module ${x}"
         modprobe -q ${x} ${modargs[${i}]} &>/dev/null
         retval=$?
         eend ${retval} "  Failed to load ${x}"
         
         i=$((i+1))
         [ "${retval}" -eq 0 ] || modcount=$((modcount-1))
      done

      einfo "Autoloaded ${modcount} module(s)"
   fi

   return 0
}

start() {
   # Should not fail if kernel do not have module
   # support compiled in ...
   [ -f /proc/modules ] || return 0
   
   # Here we should fail, as a modular kernel do need
   # depmod command ...
   if [ ! -x /sbin/depmod ]
   then
      eerror "ERROR:  system is missing /sbin/depmod !"
      return 1
   fi
   
   if [ -z "${CDBOOT}" ]
   then
                # do we have find?
                if [ -x /usr/bin/find ]
                then
                        if [ -n "`/usr/bin/find /etc/modules.d -type f -newer /etc/modules.conf`" ]
                        then
                                ebegin "Calculating module dependencies"
                                /sbin/modules-update &>/dev/null
                                eend $? "Failed to calculate dependencies"
                        else
                                einfo "Module dependencies are up-to-date - do not recalculating."
                        fi
                else # no we don't
                        ebegin "Calculating module dependencies"
                        /sbin/modules-update &>/dev/null
                        eend $? "Failed to calculate dependencies"
                fi
        fi

   if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]
   then
      # Loop over every line in /etc/modules.autoload.
      load_modules /etc/modules.autoload
   else
      local KV="$(uname -r)"
      local KV_MAJOR="`KV_major "${KV}"`"
      local KV_MINOR="`KV_minor "${KV}"`"

      # New support for /etc/modules.autoload/kernel-$KV
      if [ "$(get_KV)" -ge "$(KV_to_int '2.5.48')" ] && \
         [ -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]
      then
         load_modules /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}"
         
      elif [ ! -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]
      then
         ewarn "Missing /etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
         load_modules /etc/modules.autoload.d/kernel-2.4
      else
         load_modules /etc/modules.autoload.d/kernel-2.4
      fi
   fi

   #
   # Just in case a sysadmin prefers generic symbolic links in
   # /lib/modules/boot for boot time modules we will load these modules
   #
   if [ -n "$(modprobe -l -t boot)" ]
   then
      modprobe -a -t boot \*  &>/dev/null
   fi
}


# vim:ts=4

and it does what you want :)
_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum