GNU bug report logs - #49611
Despite wireless-regdb being installed in my operating-system, dmesg indicates it can't find `regulatory.db`

Previous Next

Package: guix;

Reported by: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>

Date: Sat, 17 Jul 2021 21:45:02 UTC

Severity: normal

To reply to this bug, email your comments to 49611 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Sat, 17 Jul 2021 21:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Katherine Cox-Buday <cox.katherine.e <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 17 Jul 2021 21:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: Despite wireless-regdb being installed in my operating-system, dmesg
 indicates it can't find `regulatory.db`
Date: Sat, 17 Jul 2021 16:43:43 -0500
#+BEGIN_EXAMPLE
[    8.280462] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[    8.282686] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    8.284394] platform regulatory.0: Direct firmware load for
regulatory.db failed with error -2
[    8.284415] cfg80211: failed to load regulatory.db
#+END_EXAMPLE

and

#+BEGIN_EXAMPLE
$ find -L /run/current-system -name regulatory.db
/run/current-system/profile/lib/firmware/regulatory.db
#+END_EXAMPLE




Information forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Sat, 17 Jul 2021 21:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 49611 <at> debbugs.gnu.org (full text, mbox):

From: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
To: 49611 <at> debbugs.gnu.org
Subject: Re: bug#49611: Acknowledgement (Despite wireless-regdb being
 installed in my operating-system,
 dmesg indicates it can't find `regulatory.db`)
Date: Sat, 17 Jul 2021 16:49:57 -0500
Attempting to do this manually with crda fails as well:

#+BEGIN_EXAMPLE
$ guix environment --ad-hoc crda
[env] $ sudo COUNTRY=US crda
Failed to set regulatory domain: -7
#+END_EXAMPLE

On Sat, Jul 17, 2021 at 4:45 PM GNU bug Tracking System
<help-debbugs <at> gnu.org> wrote:
>
> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  bug-guix <at> gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 49611 <at> debbugs.gnu.org.
>
> Please do not send mail to help-debbugs <at> gnu.org unless you wish
> to report a problem with the Bug-tracking system.
>
> --
> 49611: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49611
> GNU Bug Tracking System
> Contact help-debbugs <at> gnu.org with problems




Information forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Sun, 18 Jul 2021 18:13:01 GMT) Full text and rfc822 format available.

Message #11 received at 49611 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
Cc: 49611 <at> debbugs.gnu.org
Subject: Re: bug#49611: Despite wireless-regdb being installed in my
 operating-system, dmesg indicates it can't find `regulatory.db`
Date: Sun, 18 Jul 2021 19:47:54 +0200
Hello Katherine,

TL;DR: “iw reg set US” correctly set the regulatory region from userland
but Guix can't set it just from the kernel.

Katherine Cox-Buday <cox.katherine.e <at> gmail.com> writes:

> #+BEGIN_EXAMPLE
> [    8.280462] cfg80211: Loading compiled-in X.509 certificates for
> regulatory database
> [    8.282686] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
> [    8.284394] platform regulatory.0: Direct firmware load for
> regulatory.db failed with error -2
> [    8.284415] cfg80211: failed to load regulatory.db
> #+END_EXAMPLE

There is three way to make the module cfg80211 load a regulatory
database:
1. Baking the DB into the kernel at build time by replacing the kernel's
  limited DB with the one from 'wireless-regdb' via the option
  CONFIG_CFG80211_INTERNAL_REGDB¹.
2. Loading the DB at boot time as a signed firmware file
  (lib/firmware/regulatory.db from 'wirerless-regdb') via the module
  'cfg80211'.
3. Doing it in userland with the helper 'crda' trough the utility
  'iwd' or its predecesor 'wpa_supplicant'.²

From what I understand and what I tested, only the third method works in
Guix System ATM.  It could be usefull to also support the first or
second method to not depend on the userland setting the wireless
regulatory settings.

The error you are experiencing come from the second method failing to
load the signed firmware file. The issue is that Guix's 'wireless-regdb'
is build from source and not just copied as other distribution do, where
the provided binary also has a signature which the kernel accept through
a built in public key. Our build version isn't signed at all, the
commentaries in the definition for the package say Guix don't want to
maintain its own key for signing this package, which is understable and
state that Guix architecture already provide a similar level of
authenticity (I'm not so sure of that part).

So this error message should be harmless expected in some less common
context, such as having the rootfs on an NFS and using a wireless
connection to connect to the NFS server.  We could fix that without
maintaining keys by baking the DB into the kernel (first method).

> #+BEGIN_EXAMPLE
> $ find -L /run/current-system -name regulatory.db
> /run/current-system/profile/lib/firmware/regulatory.db
> #+END_EXAMPLE

We don't need the regulatory.db from 'wirelress-regdb' to be in the
system profile, instead it should be added to the operating-system's
firmware field. And the kernel will find it the directory contained in
“/sys/module/firmware_class/parameters/path”.

¹ https://cateee.net/lkddb/web-lkddb/CFG80211_INTERNAL_REGDB.html
² https://wireless.wiki.kernel.org/en/developers/regulatory/crda#changing_regulatory_domains

Cheers,
- Brice




Information forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Sun, 18 Jul 2021 19:18:01 GMT) Full text and rfc822 format available.

Message #14 received at 49611 <at> debbugs.gnu.org (full text, mbox):

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
Cc: 49611 <at> debbugs.gnu.org, Brice Waegeneire <brice <at> waegenei.re>
Subject: Re: bug#49611: Despite wireless-regdb being installed in my
 operating-system, dmesg indicates it can't find `regulatory.db`
Date: Sun, 18 Jul 2021 19:17:21 +0000
[Message part 1 (text/plain, inline)]
Brice Waegeneire <brice <at> waegenei.re> skribis:

> Hello Katherine,
>
> TL;DR: “iw reg set US” correctly set the regulatory region from userland
> but Guix can't set it just from the kernel.
>
> Katherine Cox-Buday <cox.katherine.e <at> gmail.com> writes:
>
>> #+BEGIN_EXAMPLE
>> [    8.280462] cfg80211: Loading compiled-in X.509 certificates for
>> regulatory database
>> [    8.282686] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
>> [    8.284394] platform regulatory.0: Direct firmware load for
>> regulatory.db failed with error -2
>> [    8.284415] cfg80211: failed to load regulatory.db
>> #+END_EXAMPLE
>
> There is three way to make the module cfg80211 load a regulatory
> database:
> 1. Baking the DB into the kernel at build time by replacing the kernel's
>   limited DB with the one from 'wireless-regdb' via the option
>   CONFIG_CFG80211_INTERNAL_REGDB¹.
> 2. Loading the DB at boot time as a signed firmware file
>   (lib/firmware/regulatory.db from 'wirerless-regdb') via the module
>   'cfg80211'.
> 3. Doing it in userland with the helper 'crda' trough the utility
>   'iwd' or its predecesor 'wpa_supplicant'.²
>
> From what I understand and what I tested, only the third method works in
> Guix System ATM.  It could be usefull to also support the first or
> second method to not depend on the userland setting the wireless
> regulatory settings.

Hi,

You could also try adding "cfg80211.ieee80211_regdom=US" to the
'kernel-arguments' field of your 'operating-system' definition.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Mon, 19 Jul 2021 18:22:01 GMT) Full text and rfc822 format available.

Message #17 received at 49611 <at> debbugs.gnu.org (full text, mbox):

From: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
To: Guillaume Le Vaillant <glv <at> posteo.net>
Cc: 49611 <at> debbugs.gnu.org, Brice Waegeneire <brice <at> waegenei.re>
Subject: Re: bug#49611: Despite wireless-regdb being installed in my
 operating-system, dmesg indicates it can't find `regulatory.db`
Date: Mon, 19 Jul 2021 13:21:14 -0500
Thank you both! I was not aware that this belonged in the firmware
field and not the packages field. This has solved the error message
during boot. Further, adding the kernel argument successfully sets my
region as US on boot.

tags 49611 notabug
close 49611

This is not part of the bug per-say, but a question around this space:
despite all of this, I still cannot broadcast on US approved channels.
I think this is because the EEPROM on the card is set as global. What
am I missing? Do you know how Linux intend for people to notify the
stack that this is an OK thing to do? I know projects like OpenWRT
carry patches to the driver, but I keep thinking surely this is not
the only way.




Information forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Mon, 19 Jul 2021 21:18:02 GMT) Full text and rfc822 format available.

Message #20 received at 49611 <at> debbugs.gnu.org (full text, mbox):

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
Cc: 49611 <at> debbugs.gnu.org, Brice Waegeneire <brice <at> waegenei.re>
Subject: Re: bug#49611: Despite wireless-regdb being installed in my
 operating-system, dmesg indicates it can't find `regulatory.db`
Date: Mon, 19 Jul 2021 21:17:23 +0000
[Message part 1 (text/plain, inline)]
Katherine Cox-Buday <cox.katherine.e <at> gmail.com> skribis:

> Thank you both! I was not aware that this belonged in the firmware
> field and not the packages field. This has solved the error message
> during boot. Further, adding the kernel argument successfully sets my
> region as US on boot.
>
> tags 49611 notabug
> close 49611
>
> This is not part of the bug per-say, but a question around this space:
> despite all of this, I still cannot broadcast on US approved channels.
> I think this is because the EEPROM on the card is set as global. What
> am I missing? Do you know how Linux intend for people to notify the
> stack that this is an OK thing to do? I know projects like OpenWRT
> carry patches to the driver, but I keep thinking surely this is not
> the only way.

Some WiFi devices can have extra EEPROM-based restrictions if they don't
implement some features.
I have a WiFi card that I can't use as access point on the 5 GHz band
because it doesn't implement radar detection, which is apparently
mandatory on this band to avoid causing interference.
Luckily I have another device based on a different chipset where it just
works.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Mon, 09 Aug 2021 23:41:02 GMT) Full text and rfc822 format available.

Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tom Fitzhenry <tom <at> tom-fitzhenry.me.uk>
To: bug-guix <at> gnu.org
Subject: Re: bug#49611: Despite wireless-regdb being installed in my
 operating-system, dmesg indicates it can't find `regulatory.db`
Date: Tue, 10 Aug 2021 09:40:11 +1000
On 20/07/2021 04:21, Katherine Cox-Buday wrote:
> I think this is because the EEPROM on the card is set as global. What
> am I missing? Do you know how Linux intend for people to notify the
> stack that this is an OK thing to do? I know projects like OpenWRT
> carry patches to the driver, but I keep thinking surely this is not
> the only way.

https://github.com/pcengines/apu2-documentation/issues/189 tracks this 
issue for PC Engines, which retails wireless cards whose EEPROM uses a 
global region.

My poor understanding is that Linux does not offer a way for end users 
to override the EEPROM, per "It should be reasonably impossible for a 
user to fail to comply with local regulations either unwittingly or by 
accident."[0]

It looks like the two supported ways to set regulatory domain are:
* a card vendor/retailer that performs certification, and flashes the 
EEPROM.
* a system integrator (e.g. off-the-shelf wireless routers, mobile 
phones, etc.) that performs certification and sets 
CONFIG_CFG80211_CERTIFICATION_ONUS.

Linux does offer a way to indicate your current region via CRDA[1], but 
this is for the "travelling in another country" usecase, and acts to 
restrict the driver to intersection(EEPROM, country).

0. https://wireless.wiki.kernel.org/en/developers/regulatory/statement
1. https://wireless.wiki.kernel.org/en/developers/regulatory




Information forwarded to bug-guix <at> gnu.org:
bug#49611; Package guix. (Mon, 09 Aug 2021 23:46:02 GMT) Full text and rfc822 format available.

Message #26 received at 49611 <at> debbugs.gnu.org (full text, mbox):

From: Tom Fitzhenry <tom <at> tom-fitzhenry.me.uk>
To: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>,
 Guillaume Le Vaillant <glv <at> posteo.net>
Cc: 49611 <at> debbugs.gnu.org, Brice Waegeneire <brice <at> waegenei.re>
Subject: Re: bug#49611: Despite wireless-regdb being installed in my
 operating-system, dmesg indicates it can't find `regulatory.db`
Date: Tue, 10 Aug 2021 09:45:46 +1000
On 20/07/2021 04:21, Katherine Cox-Buday wrote:
> This is not part of the bug per-say, but a question around this space:
> despite all of this, I still cannot broadcast on US approved channels.
> I think this is because the EEPROM on the card is set as global. What
> am I missing? Do you know how Linux intend for people to notify the
> stack that this is an OK thing to do? I know projects like OpenWRT
> carry patches to the driver, but I keep thinking surely this is not
> the only way.

https://github.com/pcengines/apu2-documentation/issues/189 tracks this 
issue for PC Engines, which retails wireless cards whose EEPROM uses a 
global region.

Disclaimer: I don't understand this well.

My understanding is that Linux does not offer a way for end users to 
override the EEPROM, per "It should be reasonably impossible for a user 
to fail to comply with local regulations either unwittingly or by 
accident."[0]

I can see two supported ways to set the regulatory domain:
* a card vendor/retailer performs certification, and flashes the EEPROM 
accordingly.
* a system integrator (e.g. off-the-shelf wireless routers, mobile 
phones, etc.) performs certification and sets 
CONFIG_CFG80211_CERTIFICATION_ONUS.

Linux does offer a way to indicate your current region via CRDA[1], but 
this is for the "travelling in another country" usecase, and acts to 
restrict the driver to intersection(EEPROM, country).

0. https://wireless.wiki.kernel.org/en/developers/regulatory/statement
1. https://wireless.wiki.kernel.org/en/developers/regulatory




This bug report was last modified 4 years and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.