Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 309465 - sys-apps/openrc: "coldplugged" wireless device requiring wpa_supplicant isn't initialized correctly during boot if /usr is on separate partition
Summary: sys-apps/openrc: "coldplugged" wireless device requiring wpa_supplicant isn't...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-15 09:00 UTC by Slava Gorbunov
Modified: 2010-07-13 03:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Slava Gorbunov 2010-03-15 09:00:22 UTC
Consider the following configuration:

* gentoo linux with openrc, /usr is placed on separate partition
* removable wireless card (connected by usb in my case), configured to use wpa_supplicant (by corresponding entry in /etc/conf.d/net). It may be present during system boot, or may be plugged in later, so net.wlan0 is allowed to be hotplugged.

When wireless card is plugged in before system boot, it is "hotplugged" by init system very early (before local filesystems are mounted); the corresponding init.d script is started at the same time. Because /usr is not mounted, network init script is unable to find wpa_supplicant binaries, so it refuses to load wpa_supplicant network module. As a result, when net.wlan0 is actually started, it is configured without wpa_supplicant (even if /usr is already mounted at that moment).

Possible workaround is to create on root filesystem symlinks /usr/bin/wpa_cli and /usr/sbin/wpa_supplicant pointing to some binary on root filesystem (for example, /bin/true), and add rc_need_wlan0="localmount" to /etc/conf.d/net. But correct solution (I suppose) is to load network rc modules after localmount.

Reproducible: Always
Comment 1 Doktor Notor 2010-03-15 10:57:03 UTC
(In reply to comment #0)
> correct solution (I suppose) is to load network rc modules after localmount.

If your /usr isn't available and you have needed stuff there, you shouldn't have enabled hotplugging it in the first place. :) rc_hotplug="!net.wlan0" in /etc/rc.conf (or rc_need_wlan0="localmount" as you've already noted.) 

Why would you load networking stuff after localmount when all normal network stuff resides in /
Comment 2 Slava Gorbunov 2010-03-15 12:16:39 UTC
(In reply to comment #1)
> If your /usr isn't available and you have needed stuff there, you shouldn't
have enabled hotplugging it in the first place. :) rc_hotplug="!net.wlan0" in
/etc/rc.conf

I want my wifi card to:
a) be automatically initialized when it is hotplugged after boot
b) be automatically initialized during reboot or initial boot if it is plugged in (without manual remove-and-insert or restarting service)
rc_hotplug="!net.wlan0" solves b, but breaks a.


> (or rc_need_wlan0="localmount" as you've already noted.)
This doesn't solve problem with initialization during system boot: network modules (those in /lib/rc/net) are scanned when net.wlan0 init script is started; but it is started early, BEFORE localmount - even if we specify rc_need_* - in this case, it just waits until localmount is started, then executes start() function; but network modules are scanned immediately after script is executed.

> Why would you load networking stuff after localmount when all normal network
> stuff resides in /
I suppose, wpa_supplicant is considered "abnormal network stuff" :) It can't be easily relocated to / because it depends on libraries normally installed into /usr.

Perhaps more correct solution is to add to /etc/conf.d/net ability to force usage of network module (even if required binary is not found). Together with rc_need_* it would solve my problem...
Comment 3 Doktor Notor 2010-03-15 12:25:02 UTC
(In reply to comment #2)
> This doesn't solve problem with initialization during system boot: network
> modules (those in /lib/rc/net) are scanned when net.wlan0 init script is
> started; but it is started early, BEFORE localmount - even if we specify
> rc_need_* - in this case, it just waits until localmount is started, then
> executes start() function; but network modules are scanned immediately after
> script is executed.

Yeah, so it waits until the needed stuff is available and starts then... and the problem with this is where? Sound like it works exactly like it should. Maybe you should describe your problem with this in more detail?
Comment 4 Roy Marples 2010-03-24 20:44:47 UTC
net.foo already has a need dependency.
I don't see a problem here.
Comment 5 Roy Marples 2010-03-24 20:45:12 UTC
(In reply to comment #4)
> net.foo already has a need dependency.
> I don't see a problem here.
> 

need dependency on localmount that is.
Comment 6 Jory A. Pratt gentoo-dev 2010-07-13 03:41:05 UTC
If you can still produce this with 0.6.1-r1 please reopen. As Roy has already stated the localmount depend is already there which makes this invalid as far as I see.