target: ensure target/ dir is writable
authorNathan Lynch <ntl@pobox.com>
Tue, 28 Jan 2014 20:11:21 +0000 (21:11 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 28 Jan 2014 21:51:47 +0000 (22:51 +0100)
If the source target skeleton is read-only (eg. because Buildroot's
source dir is), modifications to the output target (such as creating
/etc/hostname and /etc/issue) fail.

(This can happen if the Buildroot source dir is NFS-mounted read-only
to be shared between different machines, for example).

Signed-off-by: Nathan Lynch <ntl@pobox.com>
[yann.morin.1998@free.fr: we use rsync now, not cp; --chmod=Du+w
 suggested by Arnout; clarify commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Makefile

index 067458b6a9d1cbb24d3f26ccd07eb340f2e199c4..d8a8dad093f229e50c12786859309c2b39884386 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -473,7 +473,7 @@ RSYNC_VCS_EXCLUSIONS = \
 $(BUILD_DIR)/.root:
        mkdir -p $(TARGET_DIR)
        rsync -a $(RSYNC_VCS_EXCLUSIONS) \
-               --exclude .empty --exclude '*~' \
+               --chmod=Du+w --exclude .empty --exclude '*~' \
                $(TARGET_SKELETON)/ $(TARGET_DIR)/
        cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
        @ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
@@ -549,7 +549,7 @@ endif
        @$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
                $(call MESSAGE,"Copying overlay $(d)"); \
                rsync -a $(RSYNC_VCS_EXCLUSIONS) \
-                       --exclude .empty --exclude '*~' \
+                       --chmod=Du+w --exclude .empty --exclude '*~' \
                        $(d)/ $(TARGET_DIR)$(sep))
 
        @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \