Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mehrere kernel auf einem system?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Husky
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2003
Posts: 77

PostPosted: Mon Feb 16, 2004 10:45 pm    Post subject: mehrere kernel auf einem system? Reply with quote

Ich versuche gerade mein System so zu konfigurieren das ich mehrere Kernel booten kann und für jeden auch seine eigenen Module habe. Bisher habe ich nach dieser Anleitung gearbeitet. Das einzige Problem ist ,dass man ja die Module bei Gentoo nicht in die modules.conf sondern in eine Datei in modules.autoload.d einträgt. Leider kann man in dieser datei auch kein bash scripting benutzen. Kann man irgendwo festlegen für welche Kernelversion welches file benutzt wird?
Back to top
View user's profile Send private message
Lenz
Veteran
Veteran


Joined: 17 Jul 2003
Posts: 1439
Location: Marburg [HE, D, EU]

PostPosted: Mon Feb 16, 2004 10:58 pm    Post subject: Reply with quote

Ne, da hast du was missverstanden. Die Dateien findest du im Verzeichnis /etc/modules.autoload/

Dort gibt es für jede Kernelversion eines (falls nicht, musst du die Dateien erstellen)

Code:
lenz@sulfur ~ $ cd /etc/modules.autoload.d/
lenz@sulfur /etc/modules.autoload.d $ la
insgesamt 18K
drwxr-xr-x    2 root     root          168 12. Feb 16:00 .
drwxr-xr-x   72 root     root         4,9K 16. Feb 23:45 ..
-rw-r--r--    1 root     root            0  8. Feb 23:45 .keep
-rw-r--r--    1 root     root          769 11. Feb 23:36 kernel-2.4
-rw-r--r--    1 root     root          470 11. Sep 05:52 kernel-2.5
-rw-r--r--    1 root     root          747 12. Feb 16:00 kernel-2.6
lenz@sulfur /etc/modules.autoload.d $
Back to top
View user's profile Send private message
Beforegod
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 1495
Location: Würzburg

PostPosted: Tue Feb 17, 2004 7:51 am    Post subject: Reply with quote

Wenn Du von einer Kernelversionen (z.B. 2.6) mehrere Revisionen benutzen willst, solltest Du schauen das Du wenigstens die Module gleich sind. In der modules.autoload kannst Du nur für eine Kernel Version die Module einstellen.
Back to top
View user's profile Send private message
Husky
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2003
Posts: 77

PostPosted: Tue Feb 17, 2004 11:13 am    Post subject: Reply with quote

der eine kernel is ja für vmware, da brauch ich ganz andere treiber(und z.b. das nvnet modul nicht). geht das bei gentoo überhaubtnicht wenn ich 2 2.6er kernel nehmen will?

EDIT: werden die module von einem init script gestartet? eigentlich könnte man dann ja eins vorher ausführen das guckt welche kernel version geladen wurde und dann die kernel2.6 datei in modules.autoload austauscht.
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Tue Feb 17, 2004 11:52 am    Post subject: Reply with quote

Beim Kernel kompilieren kannst du im make file einene Eigenen Kernel Namens Zusatz eintragen sprich:

2.6.2-vmware

oder so, dann kannst du gemütlich über diese Namen verschiedene Kernel, gleiche Version, benutzen.

Wie der Punkt im makefile genau heisst kann ich dir gerade nicht sagen
Back to top
View user's profile Send private message
Husky
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2003
Posts: 77

PostPosted: Tue Feb 17, 2004 2:34 pm    Post subject: Reply with quote

das hab ich ja schon gemacht(steht ja auch in der anleitung die cih gepostet habe). das problem is das sich 2 2.6er kernel immernoch ein file teilen müssen wo festgelegt ist welche module beim start geladen werden(in modules.autoload.d). allerdings kann man da sicher nxi weiter configurieren, das scheint alles fest in einem rc-script eingetragen zu sein.
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Tue Feb 17, 2004 2:59 pm    Post subject: Reply with quote

Bekenne mich schuldig.... Aschee auf mein Haupt.... (bzw siehe Signatur)

Schreib ein neues rc skript und reich es als Bugreport ein :lol:

Aber ansonsten ich glaub ich probier mein Glück mal, wenn ich zuhause bin...
Back to top
View user's profile Send private message
Husky
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2003
Posts: 77

PostPosted: Tue Feb 17, 2004 4:38 pm    Post subject: Reply with quote

so, mein erstes bash script:

Code:
#!/sbin/runscript
# Copyright 1999-2003 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.29 2004/02/06 19:33:59 azarah 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
      ebegin "Calculating module dependencies"
      /sbin/modules-update &>/dev/null
      eend $? "Failed to calculate dependencies"
   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}"`"
      local KV_EXTRA=`echo "${KV}" | gawk -F - '{print $2}'`



      #ewarn "  Extraversion des kernels: ${KV_EXTRA}"
      

      
      # 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}"-${KV_EXTRA} ]
      then
         load_modules /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}"-${KV_EXTRA}
         
      elif [ ! -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}"-${KV_EXTRA} ]
      then

         if [ ! -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-"${KV_MAJOR}.${KV_MINOR}"
         fi
      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


das script sucht erstmal ob es eine datei 2.6-extraversion gibt(dabei muss die extra version aber mit - anfangen, aba ich glaube das macht ja fast jeder so...). das ganze sollte auch mit 2.5 funktionieren, allerdings verstehe ich das erste if nicht so ganz([ "$(get_KV)" -ge "$(KV_to_int '2.5.48')" ]), da filtern die wohl alles über 2.5.48 raus. wenn das so ist dann sucht er bei kerneln mit ner kleineren versionsnummer noch nicht nach ner datei mit der extraversion im namen.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) 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