Skip to contentSkip to conversation

bluez5: Point hciattach bcm43xx firmware search path to /lib/firmware

PATCH Superseded Marek Vasut 3 participants 4 messages Oct 31, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bluez5: Point hciattach bcm43xx firmware search path to /lib/firmware

Currently the hciattach bcm43xx firmware loader looks up the firmware blob in /etc/firmware . Change this to /lib/firmware instead, so that the path is consistent with Linux kernel which also looks up firmware for the WiFi part in /lib/firmware .

---
Cc: Alexander Kanavin <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
 meta/recipes-connectivity/bluez5/bluez5.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-connectivity/bluez5/bluez5.inc +2 -0
index f07e318897..fe10be7324 100644
@@ -68,6 +68,8 @@ EXTRA_OECONF = "\
   --without-zsh-completion-dir \
 "
 
+CFLAGS:append = " -DFIRMWARE_DIR=\\"/lib/firmware\\""
+
 # bluez5 builds a large number of useful utilities but does not
 # install them.  Specify which ones we want put into ${PN}-noinst-tools.
 NOINST_TOOLS_READLINE ??= ""
Signature · 1 line
2.35.1
#1 lore raw

Hi Marek,

Marek Vasut <[email protected]> escreveu no dia segunda, 31/10/2022 à(s) 16:30:

Quoted 20 lines

Currently the hciattach bcm43xx firmware loader looks up the firmware blob in /etc/firmware . Change this to /lib/firmware instead, so that the path is consistent with Linux kernel which also looks up firmware for the WiFi part in /lib/firmware .

---
Cc: Alexander Kanavin <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
 meta/recipes-connectivity/bluez5/bluez5.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-connectivity/bluez5/bluez5.inc +0 -0
index f07e318897..fe10be7324 100644

meta/recipes-connectivity/bluez5/bluez5.inc EXTRA_OECONF = "\ · line 72

Quoted 5 lines
meta/recipes-connectivity/bluez5/bluez5.inc +1 -0
@@ -68,6 +68,8 @@ EXTRA_OECONF = "\
   --without-zsh-completion-dir \
 "
 
+CFLAGS:append = " -DFIRMWARE_DIR=\\"/lib/firmware\\""
 

Escape chars can be tricky when parsing and as the path doesn't have any space we can have " -DFIRMWARE_DIR=/lib/firmware" or not?

Another options to avoid escape chars can be
CFLAGS:append = ' -DFIRMWARE_DIR="/lib/firmware"'

Jose

Quoted 19 lines
meta/recipes-connectivity/bluez5/bluez5.inc +1 -0
+
 # bluez5 builds a large number of useful utilities but does not
 # install them.  Specify which ones we want put into ${PN}-noinst-tools.

NOINST_TOOLS_READLINE ??= ""
--
2.35.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#172331):
https://lists.openembedded.org/g/openembedded-core/message/172331
Mute This Topic: https://lists.openembedded.org/mt/94689423/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma
#2 lore raw
Quoted 1 line · Jose Quaresma

Hi Marek,

Hi,

Quoted 25 lines

Marek Vasut <[email protected]> escreveu no dia segunda, 31/10/2022 à(s) 16:30:

Quoted 23 lines

Currently the hciattach bcm43xx firmware loader looks up the firmware blob in /etc/firmware . Change this to /lib/firmware instead, so that the path is consistent with Linux kernel which also looks up firmware for the WiFi part in /lib/firmware .

---
Cc: Alexander Kanavin <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
  meta/recipes-connectivity/bluez5/bluez5.inc | 2 ++
  1 file changed, 2 insertions(+)
meta/recipes-connectivity/bluez5/bluez5.inc +0 -0
index f07e318897..fe10be7324 100644
@@ -68,6 +68,8 @@ EXTRA_OECONF = "\
    --without-zsh-completion-dir \
  "
 
Quoted 6 lines

meta/recipes-connectivity/bluez5/bluez5.inc EXTRA_OECONF = "\ · line 72

Quoted 2 lines
meta/recipes-connectivity/bluez5/bluez5.inc +1 -0
+CFLAGS:append = " -DFIRMWARE_DIR=\\"/lib/firmware\\""
 

Escape chars can be tricky when parsing and as the path doesn't have any space we can have " -DFIRMWARE_DIR=/lib/firmware" or not?

No, because then the macro gets expanded in place in hciconfig_bcm43xx.c to something like printf(/lib/firmware); which the compiler does not like obviously. The quotes are really mandatory there, I tried various combinations (sigh) until I arrived at this working one.

Quoted 2 lines

Another options to avoid escape chars can be
CFLAGS:append = ' -DFIRMWARE_DIR="/lib/firmware"'

[...]

#3 lore raw
Quoted 54 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Marek Vasut
Sent: den 31 oktober 2022 21:54
To: Jose Quaresma <[email protected]>
Cc: [email protected]; Alexander Kanavin <[email protected]>; Alexandre Belloni <[email protected]>; Richard Purdie <[email protected]>
Subject: Re: [OE-core] [PATCH] bluez5: Point hciattach bcm43xx firmware search path to /lib/firmware

Quoted 1 line · Jose Quaresma

Hi Marek,

Hi,

Quoted 1 line

Marek Vasut <[email protected]> escreveu no dia segunda, 31/10/2022 à(s)

16:30:

Quoted 24 lines
Quoted 24 lines

Currently the hciattach bcm43xx firmware loader looks up the firmware blob in /etc/firmware . Change this to /lib/firmware instead, so that the path is consistent with Linux kernel which also looks up firmware for the WiFi part in /lib/firmware .

---
Cc: Alexander Kanavin <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
  meta/recipes-connectivity/bluez5/bluez5.inc | 2 ++
  1 file changed, 2 insertions(+)
meta/recipes-connectivity/bluez5/bluez5.inc +0 -0
index f07e318897..fe10be7324 100644
@@ -68,6 +68,8 @@ EXTRA_OECONF = "\
    --without-zsh-completion-dir \
  "
 
Quoted 6 lines

meta/recipes-connectivity/bluez5/bluez5.inc EXTRA_OECONF = "\ · line 72

Quoted 2 lines
meta/recipes-connectivity/bluez5/bluez5.inc +1 -0
+CFLAGS:append = " -DFIRMWARE_DIR=\\"/lib/firmware\\""
 

Escape chars can be tricky when parsing and as the path doesn't have any space we can have " -DFIRMWARE_DIR=/lib/firmware" or not?

No, because then the macro gets expanded in place in hciconfig_bcm43xx.c to something like printf(/lib/firmware); which the compiler does not like obviously. The quotes are really mandatory there, I tried various combinations (sigh) until I arrived at this working one.

Quoted 4 lines
Quoted 2 lines

Another options to avoid escape chars can be
CFLAGS:append = ' -DFIRMWARE_DIR="/lib/firmware"'

[...]

You should change "/lib" to "${nonarch_base_libdir}".

//Peter