public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: linux-kernel@vger.kernel.org
Cc: rusty@rustcorp.com.au
Subject: kernel param and KBUILD_MODNAME name-munging mess
Date: Mon, 20 Jan 2003 14:41:03 +0100 (MET)	[thread overview]
Message-ID: <200301201341.OAA23795@harpo.it.uu.se> (raw)

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

             reply	other threads:[~2003-01-20 13:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-20 13:41 Mikael Pettersson [this message]
2003-01-21  6:26 ` kernel param and KBUILD_MODNAME name-munging mess 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

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=200301201341.OAA23795@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox