From: Yann E. MORIN Date: Wed, 1 Apr 2015 21:54:57 +0000 (+0200) Subject: package/linux-firmware: add support to copy entire directories X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b55bd5a9e25e;p=buildroot.git package/linux-firmware: add support to copy entire directories Signed-off-by: "Yann E. MORIN" Cc: David BARBION Cc: Thomas Petazzoni Signed-off-by: Thomas Petazzoni --- diff --git a/package/linux-firmware/linux-firmware.mk b/package/linux-firmware/linux-firmware.mk index 71c86117f1..5a68138c89 100644 --- a/package/linux-firmware/linux-firmware.mk +++ b/package/linux-firmware/linux-firmware.mk @@ -293,6 +293,23 @@ LINUX_FIRMWARE_ALL_LICENSE_FILES += LICENCE.broadcom_bcm43xx endif ifneq ($(LINUX_FIRMWARE_FILES),) +define LINUX_FIRMWARE_INSTALL_FILES + $(TAR) c -C $(@D) $(sort $(LINUX_FIRMWARE_FILES)) | \ + $(TAR) x -C $(TARGET_DIR)/lib/firmware +endef +endif + +ifneq ($(LINUX_FIRMWARE_DIRS),) +# We need to rm-rf the destination directory to avoid copying +# into it in itself, should we re-install the package. +define LINUX_FIRMWARE_INSTALL_DIRS + $(foreach d,$(LINUX_FIRMWARE_DIRS), \ + rm -rf $(TARGET_DIR)/lib/firmware/$(d); \ + cp -a $(@D)/$(d) $(TARGET_DIR)/lib/firmware/$(d)$(sep)) +endef +endif + +ifneq ($(LINUX_FIRMWARE_FILES)$(LINUX_FIRMWARE_DIRS),) # Most firmware files are under a proprietary license, so no need to # repeat it for every selections above. Those firmwares that have more @@ -308,12 +325,12 @@ LINUX_FIRMWARE_ALL_LICENSE_FILES += WHENCE # duplicates LINUX_FIRMWARE_LICENSE_FILES = $(sort $(LINUX_FIRMWARE_ALL_LICENSE_FILES)) +endif + define LINUX_FIRMWARE_INSTALL_TARGET_CMDS mkdir -p $(TARGET_DIR)/lib/firmware - $(TAR) c -C $(@D) $(sort $(LINUX_FIRMWARE_FILES)) | \ - $(TAR) x -C $(TARGET_DIR)/lib/firmware + $(LINUX_FIRMWARE_INSTALL_FILES) + $(LINUX_FIRMWARE_INSTALL_DIRS) endef -endif - $(eval $(generic-package))