diff mbox

[RFC/PATCH,2/4] ensure target fs is writable

Message ID 1340031743-29694-3-git-send-email-ntl@pobox.com
State Changes Requested
Delegated to: Yann E. MORIN
Headers show

Commit Message

Nathan Lynch June 18, 2012, 3:02 p.m. UTC
If the source target skeleton is read-only, modifications to the
output target (such as creating /etc/hostname and /etc/issue) fail.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
---
 Makefile |    1 +
 1 file changed, 1 insertion(+)

Comments

Arnout Vandecappelle June 20, 2012, 11:12 p.m. UTC | #1
On 06/18/12 17:02, Nathan Lynch wrote:
> If the source target skeleton is read-only, modifications to the
> output target (such as creating /etc/hostname and /etc/issue) fail.
>
> Signed-off-by: Nathan Lynch<ntl@pobox.com>
> ---
>   Makefile |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index 9a9634d..38276cd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -378,6 +378,7 @@ endif
>   	if ! [ -d "$(TARGET_DIR)/bin" ]; then \
>   		if [ -d "$(TARGET_SKELETON)" ]; then \
>   			cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
> +			chmod -R u+w $(TARGET_DIR)/; \

  Maybe it's safer to do this only on directories, e.g. with
rsync -a --chmod=Du+w $(TARGET_SKELETON)/ $(TARGET_DIR)/
(untested)


  Regards,
  Arnout
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 9a9634d..38276cd 100644
--- a/Makefile
+++ b/Makefile
@@ -378,6 +378,7 @@  endif
 	if ! [ -d "$(TARGET_DIR)/bin" ]; then \
 		if [ -d "$(TARGET_SKELETON)" ]; then \
 			cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
+			chmod -R u+w $(TARGET_DIR)/; \
 		fi; \
 	fi
 	-find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf