Skip to contentSkip to conversation

linux-firmware: support paths with subdirs in LINUX_FIRMWARE_DIRS

PATCH New Thomas Petazzoni 2 participants 3 messages Apr 15, 2018 – Apr 16, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-firmware: support paths with subdirs in LINUX_FIRMWARE_DIRS

Following commit cdb7876f63a253254b86637aaac8b255a426b60a ("linux-firmware: add Qualcomm video accelerator and GPU firmware options"), LINUX_FIRMWARE_DIRS can now contain entries with subdirs, such as "qcom/venus-1.8". Such entries are currently not supported by the logic in LINUX_FIRMWARE_INSTALL_DIRS.

Indeed the current logic consists in:

- Removing the destination directory
- Copying to the destination directory

Unfortunately, the last step fails if a component of the path leading to the destination directory does not exist. To overcome this, we simply add the appropriate mkdir before the copy.

Fixes:

http://autobuild.buildroot.net/results/54cbca90742faf486e59d95b95a0b0494e47b385/

---
 package/linux-firmware/linux-firmware.mk | 1 +
 1 file changed, 1 insertion(+)
package/linux-firmware/linux-firmware.mk +1 -0
index efe5cdd7dd..11231613e9 100644
@@ -499,6 +499,7 @@ ifneq ($(LINUX_FIRMWARE_DIRS),)
 define LINUX_FIRMWARE_INSTALL_DIRS
 	$(foreach d,$(LINUX_FIRMWARE_DIRS), \
 		rm -rf $(TARGET_DIR)/lib/firmware/$(d); \
+		mkdir -p $(dir $(TARGET_DIR)/lib/firmware/$(d)); \
 		cp -a $(@D)/$(d) $(TARGET_DIR)/lib/firmware/$(d)$(sep))
 endef
 endif
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 linux-firmware: support paths with subdirs in LINUX_FIRMWARE_DIRS

Thomas, All,

On 2018-04-15 22:22 +0200, Thomas Petazzoni spake thusly:

Quoted 15 lines

Following commit cdb7876f63a253254b86637aaac8b255a426b60a ("linux-firmware: add Qualcomm video accelerator and GPU firmware options"), LINUX_FIRMWARE_DIRS can now contain entries with subdirs, such as "qcom/venus-1.8". Such entries are currently not supported by the logic in LINUX_FIRMWARE_INSTALL_DIRS.

Indeed the current logic consists in:

- Removing the destination directory
- Copying to the destination directory

Unfortunately, the last step fails if a component of the path leading to the destination directory does not exist. To overcome this, we simply add the appropriate mkdir before the copy.

Quoted 5 lines

Fixes:

http://autobuild.buildroot.net/results/54cbca90742faf486e59d95b95a0b0494e47b385/

Regards,
Yann E. MORIN.

Quoted 19 lines
---
 package/linux-firmware/linux-firmware.mk | 1 +
 1 file changed, 1 insertion(+)
package/linux-firmware/linux-firmware.mk +1 -0
index efe5cdd7dd..11231613e9 100644
@@ -499,6 +499,7 @@ ifneq ($(LINUX_FIRMWARE_DIRS),)
 define LINUX_FIRMWARE_INSTALL_DIRS
 	$(foreach d,$(LINUX_FIRMWARE_DIRS), \
 		rm -rf $(TARGET_DIR)/lib/firmware/$(d); \
+		mkdir -p $(dir $(TARGET_DIR)/lib/firmware/$(d)); \
 		cp -a $(@D)/$(d) $(TARGET_DIR)/lib/firmware/$(d)$(sep))
 endef
 endif
Signature · 1 line
2.14.3
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
author Applied
#2 lore raw

PATCH 1/1 linux-firmware: support paths with subdirs in LINUX_FIRMWARE_DIRS

In reply to Thomas Petazzoni

Hello,

Quoted 15 lines · Thomas Petazzoni

Following commit cdb7876f63a253254b86637aaac8b255a426b60a ("linux-firmware: add Qualcomm video accelerator and GPU firmware options"), LINUX_FIRMWARE_DIRS can now contain entries with subdirs, such as "qcom/venus-1.8". Such entries are currently not supported by the logic in LINUX_FIRMWARE_INSTALL_DIRS.

Indeed the current logic consists in:

- Removing the destination directory
- Copying to the destination directory

Unfortunately, the last step fails if a component of the path leading to the destination directory does not exist. To overcome this, we simply add the appropriate mkdir before the copy.

Quoted 8 lines

Fixes:

http://autobuild.buildroot.net/results/54cbca90742faf486e59d95b95a0b0494e47b385/

---
 package/linux-firmware/linux-firmware.mk | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com