Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 462032 - net-wireless/wpa_supplicant should optionally depend on net-wireless/crda
Summary: net-wireless/wpa_supplicant should optionally depend on net-wireless/crda
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Rick Farina (Zero_Chaos)
URL:
Whiteboard:
Keywords: PATCH
: 525030 693120 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-17 13:19 UTC by warmcharm
Modified: 2021-11-21 13:38 UTC (History)
18 users (show)

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


Attachments
lastest wpa_supplicant pulls udev as crda dependency (mist,1.84 KB, text/plain)
2013-10-23 20:28 UTC, needle
Details
wpa_supplicant-2.0-r2 patch to support crda optionally (ebuild.patch,1.98 KB, patch)
2013-10-26 10:54 UTC, needle
Details | Diff
Make crda depencency optional with kconfig checking taken from iwd (wpa_supplicant-9999-optional-crda.patch,1.92 KB, patch)
2020-01-01 18:53 UTC, Michael Weiser
Details | Diff
optional crda with kconfig checking for 2.9 (wpa_supplicant-2.9-r1-optional-crda.patch,2.08 KB, patch)
2020-01-01 18:54 UTC, Michael Weiser
Details | Diff
Make crda depencency optional with kconfig checking taken from iwd (wpa_supplicant-9999-optional-crda.patch,2.08 KB, patch)
2020-01-01 19:35 UTC, Michael Weiser
Details | Diff
optional crda with kconfig checking for 2.9 (wpa_supplicant-2.9-r1-optional-crda.patch,2.24 KB, patch)
2020-01-01 19:36 UTC, Michael Weiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description warmcharm 2013-03-17 13:19:15 UTC
If regulatory database compiled into kernel (CONFIG_CFG80211_INTERNAL_REGDB=y) packages net-wireless/crda and net-wireless/wireless-regdb isn't required anymore but not for net-wireless/wpa_supplicant. It maybe wrong since wpa_supplicant can work without crda. Although I not test well - just recompile, run and scan.
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-20 13:02:56 UTC
Static regulatory domains in the kernel are out of date and AT BEST suggested for use with embedded systems only.

crda should be on all systems that expect wifi to work legally.
Comment 2 warmcharm 2013-03-21 02:04:13 UTC
(In reply to comment #1)
I disagree.
> Static regulatory domains in the kernel are out of date and AT BEST
> suggested for use with embedded systems only.
What means static is this -- net-wireless/wireless-regdb: 20090115 20110428-r1 (~)20130111 (~)20130213 ;) Unstable rules? Ha! Another bugreport needed. 
> crda should be on all systems that expect wifi to work legally.
As long as kernel provides alternative way it may be not. Legality is just an off-topic, because inkernel mechanism with proper regdb works just like crda was.
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-21 02:12:29 UTC
As one of the maintainers of wpa_supplicant I strongly disapprove of this.  The kernel developers and the wireless developers do not want the kernel static regdb used, I am not going against that.

I'm not fighting to keep this bug closed, but I highly doubt anyone is willing to commit around me on this.

You will need to provide an incredibly compelling reason for this, you haven't.
Comment 4 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2013-03-21 08:44:51 UTC
I'm with Rick on this one - as long as upstream says this is the way to go, it is the way to go.

If people really needs a system without CRDA, there is nothing preventing them from adding net-wireless/crda to their packages.provided file...
Comment 5 warmcharm 2013-03-22 03:38:40 UTC
Okay guys, clear. So why wpa_supplicant can't have crda as optional dependency? Like others who can talk to the regdom. Like hostapd has. Or even dont depend on it completely! Like net-wireless/iw, which also can interact with the regdom just like as wpa_supplicant can. Or why then not to apply hard dependency on crda to all of them? Also, what about net-wireless/wireless-tools which can do wifi without crda...

My simple reason for this, is a bit more out of the box flexibility to our beloved distro. Solution is very simple to: IUSE="+crda"... So whats wrong?
Comment 6 needle 2013-10-23 20:28:21 UTC
Created attachment 361742 [details]
lastest wpa_supplicant pulls udev as crda dependency

I have system running with mdev, the latest wpa_supplicant update forces me to install udev, because it pulls crda which depends on udev. It would eventually not force me to install udev if crda was made optional on wpa_supplicant-2
Comment 7 needle 2013-10-24 05:00:21 UTC
This is from the crda website.

http://wireless.kernel.org/en/developers/Regulatory/CRDA
-----
Host requirements:

-libc/ublibc
-regulatory.bin file
-libnl >= libnl1
-udevd [but read below for alternative]

You can skip out on the CRDA and udev requirement by using CONFIG_CFG80211_INTERNAL_REGDB but read below on its own requirements.

[...]

therefore using CONFIG_CFG80211_INTERNAL_REGDB is not recommended.

-----

So the kernel developers do not want to have static regdb? or is it not recommended? If REGDB internal is not wanted then why mention an alternative way. I don't understand this chain of argumentation. 
And why to pull udev as dependency on such "vital" package as wpa_supplicant is where there is no substitute for wpa_supplicant.
Comment 8 needle 2013-10-26 10:54:32 UTC
Created attachment 361960 [details, diff]
wpa_supplicant-2.0-r2 patch to support crda optionally

Created a patch for optional crda IUSE support
Comment 9 Ben Kohler gentoo-dev 2013-11-24 03:40:37 UTC
This seems like a no-brainer.  CRDA is recommended and used by default, but there's another option out there.  Upstream provides a specific config option for it, even.  Stick it behind a USE flag with a proper warning, so embedded and other specialty setups can use it.
Comment 10 Ben Kohler gentoo-dev 2015-03-03 16:04:42 UTC
*** Bug 525030 has been marked as a duplicate of this bug. ***
Comment 11 Enne Eziarc 2019-02-16 20:02:36 UTC
Now that CRDA upstream has been telling people to stop using it for several months [1], could this bug maybe be fixed?

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/tree/README#n8
Comment 12 Bodo Graumann 2019-06-29 08:44:05 UTC
Also crda is pulling in m2crypto, which only supports python 2.7. That means in turn there are other packages with PYTHON_TARGETS="python2_7" pulled in...
Comment 13 Klaus Kusche 2019-10-02 09:33:40 UTC
Another vote for removing CRDA from wpa_supp's DEPEND's,
there is no need and no reason for CRDA.

You don't loose any functionality without it, 
you are no longer restricted to static domains in the kernel without CRDA.
The kernel itself now does exactly what CRDA did before:
Loading the regdb from files in /lib/firmware
Comment 14 Andrei F. 2019-12-02 01:48:32 UTC
#693120 is a dupe and should be marked accordingly.

Any progress on this? I'm currently using wpa_supplicant v2.9 without CRDA from a custom overlay. Can confirm it works fine.
Comment 15 charles17 2019-12-02 07:38:10 UTC
(In reply to Andrei F. from comment #14)
> #693120 is a dupe and should be marked accordingly.
> 
> Any progress on this? I'm currently using wpa_supplicant v2.9 without CRDA
> from a custom overlay. Can confirm it works fine.

No need for custom ebuild. 
Just drop crda into /etc/portage/profile/package.provided
Comment 16 Klaus Kusche 2019-12-02 08:02:07 UTC
(In reply to charles17 from comment #15)
> (In reply to Andrei F. from comment #14)
> > #693120 is a dupe and should be marked accordingly.
> > 
> > Any progress on this? I'm currently using wpa_supplicant v2.9 without CRDA
> > from a custom overlay. Can confirm it works fine.
> 
> No need for custom ebuild. 
> Just drop crda into /etc/portage/profile/package.provided

This works, but it should just be a temporary workaround,
not the permanent solution.

Upstream's recommendation since kernel 4.something is not to use crda.
So wpa-supp should not depend on it forever.

What about depending on either crda or (||) a recent kernel version?
Comment 17 Ben Kohler gentoo-dev 2019-12-02 14:15:32 UTC
You need some specific kernel setup for the kernel's regulatory db mechanism to work.  The net-wireless/iwd ebuilds are doing this check, wpa_supplicant would probably need to do the same (improvement suggestions welcome).
Comment 18 Arfrever Frehtes Taifersar Arahesis 2019-12-07 04:17:37 UTC
*** Bug 693120 has been marked as a duplicate of this bug. ***
Comment 19 Michael Weiser 2020-01-01 18:53:57 UTC
Created attachment 602214 [details, diff]
Make crda depencency optional with kconfig checking taken from iwd

How about this then?
Comment 20 Michael Weiser 2020-01-01 18:54:31 UTC
Created attachment 602216 [details, diff]
optional crda with kconfig checking for 2.9
Comment 21 Michael Weiser 2020-01-01 19:35:42 UTC
Created attachment 602218 [details, diff]
Make crda depencency optional with kconfig checking taken from iwd

Nothing in wpa_supplicant actually requires crda to compile or work. All the dependency does is make sure that crda is installed when the user will eventually be using wpa_supplicant so the whole setup is regulatory compliant. So it's certainly not a build dependency and arguably not even strictly a runtime dependency.

Also, since only crda depends on net-wireless/wireless-regdb, emerge --depclean immediately took that together with crda.

Here's a respin of the patch based on how iwd handles the situation.

Could this be handled more generically, e.g. through a meta- or virtual package which captures the fact that either crda or the necessary firmware autoload kernel config together with the regdb have to be present when either iwd or wpa_supplicant are installed?
Comment 22 Michael Weiser 2020-01-01 19:36:33 UTC
Created attachment 602220 [details, diff]
optional crda with kconfig checking for 2.9
Comment 23 Larry the Git Cow gentoo-dev 2021-11-21 12:31:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86f2873941b8049bfd376569e7871c74782257f4

commit 86f2873941b8049bfd376569e7871c74782257f4
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-11-21 12:25:43 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-11-21 12:30:25 +0000

    net-wireless/wpa_supplicant: make crda optional
    
    Since the bug was originally filed, the situation
    has changed and upstream now _discourage_ CRDA usage.
    
    Let's make it optional to avoid pulling in m2crypto
    on smaller devices.
    
    Keeping it on by default (for now?) to avoid
    breaking existing setups.
    
    Closes: https://bugs.gentoo.org/462032
    Thanks-to: Michael Weiser <michael@weiser.dinsnail.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../wpa_supplicant/wpa_supplicant-2.9-r6.ebuild    | 501 +++++++++++++++++++++
 .../wpa_supplicant/wpa_supplicant-9999.ebuild      |  32 +-
 2 files changed, 530 insertions(+), 3 deletions(-)
Comment 24 Andrey Volkov 2021-11-21 13:37:11 UTC
Please fix DEPEND also.
This it still non-optional DEPEND="kernel_linux? (net-wireless/crda)"
Comment 25 Larry the Git Cow gentoo-dev 2021-11-21 13:38:29 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7011f0660e18847f3b09d610372e6212fc3f7feb

commit 7011f0660e18847f3b09d610372e6212fc3f7feb
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-11-21 13:38:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-11-21 13:38:13 +0000

    net-wireless/wpa_supplicant: fix DEPEND for new optional CRDA
    
    Bug: https://bugs.gentoo.org/462032
    Signed-off-by: Sam James <sam@gentoo.org>

 net-wireless/wpa_supplicant/wpa_supplicant-2.9-r6.ebuild | 1 -
 net-wireless/wpa_supplicant/wpa_supplicant-9999.ebuild   | 1 -
 2 files changed, 2 deletions(-)