public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel param and KBUILD_MODNAME name-munging mess
@ 2003-01-20 13:41 Mikael Pettersson
  2003-01-21  6:26 ` Vamsi Krishna S.
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mikael Pettersson @ 2003-01-20 13:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: rusty

Booting kernel 2.5.59 with the "-s" kernel boot parameter
doesn't get you into single-user mode like it should.

One part of the problem is Rusty's new module option and
kernel boot parameter parsing code, which changes '-' to
'_' in every string. This change is not reverted when the
string is found NOT to be a kernel option, with the result
that "_s" is passed to init instead of "-s".

Why is this s/-/_/ stuff done at all?
I suppose it's because the string is compared with
MODULE_PARAM_PREFIX, which is __stringify(KBUILD_MODNAME) ".",
and KBUILD_MODNAME is the module name after s/-/_/.

And why does KBUILD_MODNAME change the name like this?
A grep for KBUILD_MODNAME shows that it's only used in #ifdef
and __stringify(). __stringify() macro-expands its argument
before turning it to a string literal. If this is intensional,
then its a bug, since it breaks module parameters to any module
whose (munged) name also is a #define. (I was bitten by that
myself recently when adding a module param to ide-scsi.c.)

Would anything break if we made scripts/Makefile.lib set
KBUILD_MODNAME to the original module name in "", drop the
__stringify() around uses of KBUILD_MODNAME, and remove the
s/-/_/ from kernel/param.c ?

/Mikael

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-01-28  9:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-20 13:41 kernel param and KBUILD_MODNAME name-munging mess Mikael Pettersson
2003-01-21  6:26 ` Vamsi Krishna S.
2003-01-21  7:23 ` Rusty Russell
2003-01-22  9:51 ` Ingo Oeser
2003-01-22 10:20   ` Mikael Pettersson
2003-01-22 11:19     ` Alex Riesen
2003-01-22 17:25     ` Kai Germaschewski
2003-01-22 19:41       ` Roman Zippel
2003-01-28  9:15     ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox