From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 25 Jun 2009 16:28:13 +0000 Subject: Re: Who mounts sysfs? Message-Id: <20090625162813.GE22123@kroah.com> List-Id: References: <87a5b0800906250336k2e922b05pc9555f78a39d7386@mail.gmail.com> In-Reply-To: <87a5b0800906250336k2e922b05pc9555f78a39d7386@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Thu, Jun 25, 2009 at 04:53:07PM +0100, Will Newton wrote: > On Thu, Jun 25, 2009 at 4:18 PM, Greg KH wrote: > > On Thu, Jun 25, 2009 at 11:36:29AM +0100, Will Newton wrote: > >> Hi all, > >> > >> I'm trying to get the libertas driver working on an embedded > >> development board and I've run into what looks like a sysfs problem. > >> Although I'm actually using the BusyBox mdev hotplug helper rather > >> than udev, I hope this is the right list to be asking this question. > > > > For busybox questions, not really, but we reserve the right to poke fun > > at you for using mdev :) > > > >> What appears to be happening is I get my initramfs extracted, so I > >> have access to the various necessary files including the hotplug > >> helper and my firmware files. This step is taken care of by the rootfs > >> initcall level. Then the driver initcalls are run, including the > >> libertas setup routines, which call request_firmware. request_firmware > >> fires off a uevent and calls the hotplug helper. The hotplug helper > >> looks for the /sys/class/firmware entry for the libertas device, but > >> it doesn't find one because I don't appear to have a mounted sysfs on > >> the /sys mountpoint. > >> > >> So my question is: who should be mounting sysfs here? init will mount > >> sysfs, but is run much later than the device initcalls. > > > > You need to mount sysfs as one of the first things to have happen. =A0L= ook > > at your distro's startup scripts as an example of this. >=20 > Yes, I want my sysfs mounted as early as possible, but userspace (via > /sbin/init) does not get a chance to do this until after the device > initcalls have been run. I'm interested to know if there's a standard > way to get sysfs mounted before /sbin/init is run. There isn't. > I could modify mdev to mount sysfs if it detects that it isn't > already, but that seems like something of a hack. Yeah, that sounds wrong. Look at how your desktop distro does this, this shouldn't be an issue. thanks, greg k-h