linux-firmware: support paths with subdirs in LINUX_FIRMWARE_DIRS
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 15 Apr 2018 20:22:45 +0000 (22:22 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 16 Apr 2018 12:51:02 +0000 (14:51 +0200)
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/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/linux-firmware/linux-firmware.mk

index efe5cdd7dd68085f9d141f4ac17bd5c3b7f997dd..11231613e9cb8ccd8e3fc1ed5f25f293a2d0059a 100644 (file)
@@ -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