From: ed@altlinux.ru (Ed V. Bartosh)
To: ALT Linux kernel packages development <devel-kernel@altlinux.ru>
Cc: ALT Devel discussion list <devel@altlinux.ru>
Subject: [devel] modules.conf
Date: Tue, 29 Jul 2003 21:13:32 +0400
Message-ID: <m3k7a1xnlv.fsf@altlinux.ru> (raw)
[-- 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
next reply other threads:[~2003-07-29 17:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-29 17:13 Ed V. Bartosh [this message]
2003-07-29 19:49 ` Dmitry V. Levin
2003-07-30 7:01 ` Ed V. Bartosh
2003-08-11 13:58 ` Dmitry V. Levin
2003-08-11 16:15 ` Ed V. Bartosh
2003-08-11 17:34 ` Dmitry V. Levin
2003-08-11 16:44 ` Ed V. Bartosh
2003-08-11 17:35 ` Dmitry V. Levin
2003-08-12 15:32 ` [devel] modules.conf Michael Shigorin
2003-08-12 15:37 ` Dmitry V. Levin
2003-08-12 15:50 ` Michael Shigorin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3k7a1xnlv.fsf@altlinux.ru \
--to=ed@altlinux.ru \
--cc=devel-kernel@altlinux.ru \
--cc=devel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git