From: Rusty Russell <rusty@rustcorp.com.au>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
Jesse Gross <jesse@nicira.com>,
LKML <linux-kernel@vger.kernel.org>,
"Jon Masters" <jcm@redhat.com>,
"Lucas De Marchi" <lucas.demarchi@profusion.mobi>
Subject: Re: No sysfs directory for openvswitch module when built-in
Date: Thu, 07 Feb 2013 10:08:09 +1030 [thread overview]
Message-ID: <87lib1j9ni.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1360087184.2857.2.camel@bwh-desktop.uk.solarflarecom.com>
Ben Hutchings <bhutchings@solarflare.com> writes:
> On Mon, 2013-02-04 at 16:29 +1030, Rusty Russell wrote:
>> Cong Wang <xiyou.wangcong@gmail.com> writes:
>> > Hello, Rusty, Jesse,
>> >
>> > I met an interesting problem when I compile openvswitch module as a
>> > built-in (actually I compile ALL kernel modules as built-in), there is
>> > no /sys/module/openvswitch/ directory created by the kernel in this
>> > case.
>> ...
>> > What's worse, the user-space init script thinks openvswitch module is
>> > not loaded by checking the exist of this directory, therefore refuses
>> > to start.
>>
>> We only know built-in "modules" exist if we see a parameter or version
>> which mention them. Looking for /sys/module/openvswitch/ is almost as
>> flawed as looking in /proc/modules.
>>
>> I hacked up something which lists KBUILD_MODNAME for every element in my
>> kernel which did EXPORT_KERNEL or module_init, and most of them can
>> never be modules, though any could have parameters. Even if we changed
>> the build system so we could tell things which "could have been a
>> module", it's silly.
> [...]
>
> Isn't this information already provided by modules.builtin?
(CC's trimmed)
Thanks Ben, I learned something! I hadn't spotted that tristate vars
get set to Y instead of y. Subtle...
So we already have the infrastructure, and copy it into the module dir
(though logically it's a kernel property and belongs in /proc).
eg. lsmod doesn't list them, which is a bit weird, though modprobe
"succeeds".
A quick grep through my /etc shows 5 scripts using lsmod and 1 using
/sys/module to check for presence of modules. Should the kernel pad
/proc/modules with entries for builtins?
Thoughts welcome...
Rusty.
next prev parent reply other threads:[~2013-02-07 1:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 14:15 No sysfs directory for openvswitch module when built-in Cong Wang
2013-02-04 5:59 ` Rusty Russell
2013-02-05 14:28 ` Cong Wang
2013-02-05 17:59 ` Ben Hutchings
2013-02-06 23:38 ` Rusty Russell [this message]
2013-02-04 16:19 ` Stephen Hemminger
2013-02-05 6:08 ` Ben Pfaff
2013-02-05 10:49 ` Cong Wang
2013-02-05 19:15 ` Ben Pfaff
2013-02-05 22:11 ` Stephen Hemminger
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=87lib1j9ni.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=bhutchings@solarflare.com \
--cc=jcm@redhat.com \
--cc=jesse@nicira.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=xiyou.wangcong@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).