* [d-kernel] modules.conf
@ 2003-07-29 17:13 Ed V. Bartosh
0 siblings, 0 replies; only message in thread
From: Ed V. Bartosh @ 2003-07-29 17:13 UTC (permalink / raw)
To: ALT Linux kernel packages development; +Cc: ALT Devel discussion list
[-- Attachment #1: Type: text/plain, Size: 982 bytes --]
Hello, All
Предлагаю несколько изменить схему формирования
modules.conf, включив в него только include-ы, а эти самые инклюды
генерить каждой подсистеме (kudzu, lm_sensors, etc) отдельно.
Это по-моему логичнее, красивее и надежнее, каждая подсистема пишет
только свой файл, а не переписывает общий.
В связи с этим у меня есть несколько простеньких патчей (патчи
приатачены), которые могут быть небесполезны в данной схеме:
1. Для автоматической генерации modules.conf.sensors, он позволяет
сделать что-нить типа этого:
start()
{
SYSCONF_LMSENSORS='/etc/sysconfig/lm_sensors'
[ -f "$SYSCONF_LMSENSORS" ] || /usr/sbin/sensors-detect > /dev/null 2>&1 </dev/null
return 0
}
...
ну, или что-нибудь более умное :) и автоматом получать дефолтную
конфигурацию lm_sensors.
При условии, что в modules.conf будет соответствующий include :)
2. Для обучения mkinitrd понимать эти самые include в modules.conf
Что скажет общественность ?
--
Best regards,
Ed V. Bartosh
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: lm_sensors-2.8.0-modules_conf_sensor-generation.patch --]
[-- Type: text/x-patch, Size: 808 bytes --]
--- lm_sensors-2.8.0/prog/detect/sensors-detect 2003-07-08 17:07:59 +0400
+++ lm_sensors-2.8.0/prog/detect/sensors-detect.new 2003-07-25 17:48:45 +0400
@@ -3723,6 +3723,16 @@
print "#----cut here----\n";
print $configfile;
print "#----cut here----\n";
+ print "\nDo you want to generate /etc/modules.conf.sensor ? (YES/no): ";
+ unless (<STDIN> =~ /^\s*[Nn]/) {
+ open(MODULES_CONF, ">/etc/modules.conf.sensor")
+ or die "Sorry, can't open /etc/modules.conf.sensor ($!)?!?";
+ print MODULES_CONF $configfile;
+ close(MODULES_CONF);
+ print "You should add 'include /etc/modules.conf.sensor' to\n",
+ "your /etc/modules.conf to activate these changes.";
+ }
+
print "\nTo load everything that is needed, add this to some /etc/rc* ",
"file:\n\n";
print "#----cut here----\n";
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: mkinitrd-modules_conf_includes-alt.patch --]
[-- Type: text/x-patch, Size: 1417 bytes --]
--- mkinitrd-2.8.7/mkinitrd~ 2003-03-24 19:07:31 +0300
+++ mkinitrd-2.8.7/mkinitrd 2003-07-29 17:48:12 +0400
@@ -83,7 +83,7 @@
pause=
MODULES=
-MODULES_CONF=/etc/modules.conf
+MODULES_CONF='/etc/modules.conf '`egrep -e '^include[ ]+' /etc/modules.conf | sed -e 's/^include[ ]\+\(.\+\)/\1/' | tr '\\n' ' '`
FSTAB_FILE=/etc/fstab
MODULES_DIR=
@@ -192,7 +192,7 @@
{
[ -z "$noscsi" ] || return
- local scsimodules=`/bin/egrep -s '(alias|probeall)[ ]+scsi_hostadapter' "$MODULES_CONF" |
+ local scsimodules=`/bin/egrep -s '(alias|probeall)[ ]+scsi_hostadapter' $MODULES_CONF |
/bin/grep -v '^[ ]*#' |LC_COLLATE=C /bin/sort -u |/bin/awk '{$1=$2="";print}'`
local n
@@ -241,7 +241,7 @@
fi
if /bin/grep -s '^/dev/ataraid' "$FSTAB_FILE" |/bin/fgrep -v noauto >/dev/null 2>&1; then
- local ataraidmodules=`/bin/egrep -s '(alias|probeall)[ ]+ataraid_hostadapter' "$MODULES_CONF" |
+ local ataraidmodules=`/bin/egrep -s '(alias|probeall)[ ]+ataraid_hostadapter' $MODULES_CONF |
/bin/grep -v '^[ ]*#' |LC_COLLATE=C /bin/sort -u |/bin/awk '{$1=$2="";print}'`
local n
for n in $ataraidmodules; do
@@ -386,7 +386,7 @@
local n="${m##*/}"
n="${n%.o}"
- options=`/bin/sed -ne "s/^options[ ]\\+$n[ ]\\+//p" "$MODULES_CONF"`
+ options=`/bin/sed -ne "s/^options[ ]\\+$n[ ]\\+//p" $MODULES_CONF`
Debug "Loading module $m with options '$options'"
/bin/cat >>"$RCFILE" <<EOF
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-07-29 17:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-29 17:13 [d-kernel] modules.conf Ed V. Bartosh
ALT Linux kernel packages development
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
public-inbox-index devel-kernel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git