Pagina 1 di 1

/etc/rc.d/rc.modules

Inviato: lun 29 ago 2011, 7:05
da darkstaring
Ciao =)..
Oggi mi son svegliato presto :-)..
Sbirciando quà e là, cercando di velocizzare l'avvio mi sono accorto che in rc.S
viene caricato

Codice: Seleziona tutto

  . /etc/rc.d/rc.modules-$(uname -r)
.
Dopo aver ricompilato il kernel in /etc/rc.d/ non ho creato il file /etc/rc.d/rc.modules-$(Kernel-vers) :

Codice: Seleziona tutto

bash-4.1$ ls -al /etc/rc.d/rc.modules*
lrwxrwxrwx 1 root root    23 apr 28 00:48 /etc/rc.d/rc.modules -> rc.modules-2.6.37.6-smp
-rwxr-xr-x 1 root root 35406 apr 10 07:55 /etc/rc.d/rc.modules-2.6.37.6
-rwxr-xr-x 1 root root 35406 apr 10 06:29 /etc/rc.d/rc.modules-2.6.37.6-smp
-rwxr-xr-x 1 root root 35406 mag 23 05:20 /etc/rc.d/rc.modules-2.6.38.7
-rwxr-xr-x 1 root root 35406 mag 22 06:01 /etc/rc.d/rc.modules-2.6.38.7-smp
Come posso crearlo?

Re: /etc/rc.d/rc.modules

Inviato: lun 29 ago 2011, 8:04
da DarthSteve
Hi, darkstaring....

Allora viene caricato il "rc.modules-*" appropriato/corrispondente al kernel
che hai scelto al boot.

Puoi, anche, crearlo con un link simbolico (ie. con 'ln -s) ad uno dei 4 "rc.modules-*"
effettivi che sono presenti, eg.:

ln -s rc.modules-2.6.38.7-smp rc.modules-<Nome_del_tuo_kernel>

Re: /etc/rc.d/rc.modules

Inviato: lun 29 ago 2011, 8:17
da darkstaring
Grazie DarthSteve '=)
Ho visto che caricava "rc.modules-*" ma credevo ci fosse bisogno di qualche comando per creare un nuovo rc.modules..
Ti ringrazio..

Ma editarlo?.. Ho trovato varie cose che non uso decommentate
e ciò che ho commentato!...

Posso decommentare più moduli dello stesso "tipo"
così:

Codice: Seleziona tutto

  ### CPU frequency scaling policies:
  #
  # Use the CPUFreq governor 'powersave' as default.  This sets the
  # frequency statically to the lowest frequency supported by the CPU.
  /sbin/modprobe cpufreq_powersave
  #
  # Use the CPUFreq governor 'performance' as default. This sets the
  # frequency statically to the highest frequency supported by the CPU.
  /sbin/modprobe cpufreq_performance
  #
  # Use the CPUFreq governor 'conservative' as default.  This allows you
  # to get a full dynamic frequency capable system by simply loading your
  # cpufreq low-level hardware driver.  Be aware that not all cpufreq
  # drivers support the 'conservative' governor -- the fallback governor
  # will be the 'performance' governor.
  /sbin/modprobe cpufreq_conservative
  #
  # Use the CPUFreq governor 'ondemand' as default.  This allows you to
  # get a full dynamic frequency capable system by simply loading your
  # cpufreq low-level hardware driver.  Be aware that not all cpufreq
  # drivers support the 'ondemand' governor -- the fallback governor will
  # be the performance governor.  This seems to be the most-recommended
  # scaling policy, so rc.modules will try to load this by default.
  /sbin/modprobe cpufreq_ondemand 2>/dev/null
???

Re: /etc/rc.d/rc.modules

Inviato: lun 29 ago 2011, 9:14
da 414N
darkstaring ha scritto:Ciao =)..
Oggi mi son svegliato presto :-)..
Sbirciando quà e là, cercando di velocizzare l'avvio mi sono accorto che in rc.S
viene caricato

Codice: Seleziona tutto

  . /etc/rc.d/rc.modules-$(uname -r)
Veramente, in rc.S la sequenza è questa:

Codice: Seleziona tutto

# This loads any kernel modules that are needed.  These might be required to
# use your ethernet card, sound card, or other optional hardware.
# Priority is given first to a script named "rc.modules.local", then
# to "rc.modules-$FULL_KERNEL_VERSION", and finally to the plain "rc.modules".
# Note that if /etc/rc.d/rc.modules.local is found, then that will be the ONLY
# rc.modules script the machine will run, so make sure it has everything in
# it that you need.
if [ -x /etc/rc.d/rc.modules.local -a -r /proc/modules ]; then
  echo "Running /etc/rc.d/rc.modules.local:"
  /bin/sh /etc/rc.d/rc.modules.local
elif [ -x /etc/rc.d/rc.modules-$(uname -r) -a -r /proc/modules ]; then
  echo "Running /etc/rc.d/rc.modules-$(uname -r):"
  . /etc/rc.d/rc.modules-$(uname -r)
elif [ -x /etc/rc.d/rc.modules -a -r /proc/modules -a -L /etc/rc.d/rc.modules ]; then
  echo "Running /etc/rc.d/rc.modules -> $(readlink /etc/rc.d/rc.modules):"
  . /etc/rc.d/rc.modules
elif [ -x /etc/rc.d/rc.modules -a -r /proc/modules ]; then
  echo "Running /etc/rc.d/rc.modules:"
  . /etc/rc.d/rc.modules
fi
Come vedi, se esistono e sono eseguibili, viene prima eseguito rc.modules.local (di default, non esiste), altrimenti rc.modules-<kernel-version> (di default esiste), oppure rc.modules (di default è un link a rc.modules-<kernel-version>).
Se usi un kernel personalizzato e hai bisogno di caricare/non caricare moduli che magari hanno cambiato nome nel passaggio di versione, ti conviene creare un rc.modules-<versione nuovo kernel> appropriato, magari copiando quello già presente in /etc/rc.d e facendo le opportune modifiche. Se così non fosse, non fare nulla, tanto verrà caricato rc.modules che è un link simbolico al rc.modules-<kernel di default Slackware>, come puoi vedere nel terzo if in rc.S.
Alla fine, gli /etc/rc.d/rc.modules* non sono altro che una sequela di modprobe, percui non devi preoccuparti di rispettare una certa sintassi che andrà poi interpretata.