linux: handle read-only dts files
authorHollis Blanchard <hollis_blanchard@mentor.com>
Wed, 12 Aug 2015 00:11:49 +0000 (17:11 -0700)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 19 Jan 2016 20:46:58 +0000 (21:46 +0100)
Some fine version control systems make all files read-only. The custom DTS file
may therefore be read-only, and that permission is preserved when copying into
the Linux build directory. A subsequent rebuild tries to 'cp' again, which
fails with a "Permission denied" error unless the -f option is used.

Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com>
Acked-by: Nikolay Dimitrov <picmaster@mail.bg>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
linux/linux.mk

index 045294b2cae221a636c332404eac7e5e5cf5884d..3c53a0bc058df03d75ca79f7e22668ccc5e0aa0d 100644 (file)
@@ -304,7 +304,7 @@ endif
 # configuration has changed.
 define LINUX_BUILD_CMDS
        $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-               cp $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
+               cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
        $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
        @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then      \
                $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;        \