* module-init-tools and chained aliases
@ 2003-06-15 9:52 Andrey Borzenkov
2003-06-16 0:04 ` Rusty Russell
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Borzenkov @ 2003-06-15 9:52 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel
Apparently modprobe from module-init-tools 0.9.11a does not support chained
aliases like modutils did, i.e.
alias foo bar
alias bar baz
will result in error doing "modprobe foo" instead of loading "baz".
This is a real problem when converting modules.devfs, because customary
alias /dev/tts* /dev/tts
alias /dev/tts serial
simply does not work for accessing /dev/tts/*. modprobe.devfs as shipped with
modue-init-tools has exactly the problem in parts.
It is possible to partially work around it by using
install foo /sbin/modprobe bar
consistently instead of alias but it means extra forks every time, besided it
breaks parsing for many tools (initscripts or mkinitrd make heavy use of
parsing sometimes, at least on Mandrake).
Is the behaviour intentional? Fixing it is just a one line patch and I fail to
see why current state would be preferred.
regards
-andrey
--- modprobe.c.orig 2003-06-15 01:32:21.000000000 +0400
+++ modprobe.c 2003-06-15 13:46:25.000000000 +0400
@@ -1021,8 +1021,11 @@ static char *read_config(const char *fil
if (!wildcard || !realname)
grammar(cmd, filename, linenum);
- else if (fnmatch(wildcard,name,0) == 0)
- result = NOFAIL(strdup(realname));
+ else if (fnmatch(wildcard,name,0) == 0) {
+ if (result)
+ free(result);
+ name = result = NOFAIL(strdup(realname));
+ }
} else if (strcmp(cmd, "include") == 0) {
char *newresult, *newfilename;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: module-init-tools and chained aliases
2003-06-15 9:52 module-init-tools and chained aliases Andrey Borzenkov
@ 2003-06-16 0:04 ` Rusty Russell
0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2003-06-16 0:04 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: linux-kernel
In message <200306151352.36226.arvidjaar@mail.ru> you write:
> Apparently modprobe from module-init-tools 0.9.11a does not support chained
> aliases like modutils did, i.e.
>
> alias foo bar
> alias bar baz
>
> will result in error doing "modprobe foo" instead of loading "baz".
Yes, as per the documentation.
> This is a real problem when converting modules.devfs, because customary
>
> alias /dev/tts* /dev/tts
> alias /dev/tts serial
generate-modutils.conf will do the right thing here, and unroll the
aliases. And the README in module-init-tools says:
4) If you are using devfs, copy modprobe.devfs to /etc
And modprobe.devfs gets it right.
> Is the behaviour intentional? Fixing it is just a one line patch and
> I fail to see why current state would be preferred.
Your patch only works for forwards references, not backwards
references.
There may be convincing arguments to adding support for recursive
aliases, but this isn't it.
Sorry,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-16 0:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-15 9:52 module-init-tools and chained aliases Andrey Borzenkov
2003-06-16 0:04 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).