Changeset 26259


Ignore:
Timestamp:
2011-03-21T18:38:15+01:00 (7 years ago)
Author:
jow
Message:

[include] image.mk: only upgrade permissions instead of overwriting, utilize tar -p flag for targz image targets (#7667)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/image.mk

    r24090 r26259  
    112112ifneq ($(CONFIG_TARGET_ROOTFS_TARGZ),) 
    113113  define Image/mkfs/targz 
    114                 $(TAR) -zcf $(BIN_DIR)/$(IMG_PREFIX)-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ . 
     114                # Preserve permissions (-p) when building as non-root user 
     115                $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ . 
    115116  endef 
    116117endif 
     
    138139 
    139140define Image/mkfs/prepare/default 
    140         - $(FIND) $(TARGET_DIR) -type f -not -perm +0100 -not -name 'ssh_host*' -print0 | $(XARGS) -0 chmod 0644 
    141         - $(FIND) $(TARGET_DIR) -type f -perm +0100 -print0 | $(XARGS) -0 chmod 0755 
    142         - $(FIND) $(TARGET_DIR) -type d -print0 | $(XARGS) -0 chmod 0755 
     141        # Use symbolic permissions to avoid clobbering SUID/SGID/sticky bits 
     142        - $(FIND) $(TARGET_DIR) -type f -not -perm +0100 -not -name 'ssh_host*' -print0 | $(XARGS) -0 chmod u+rw,g+r,o+r 
     143        - $(FIND) $(TARGET_DIR) -type f -perm +0100 -print0 | $(XARGS) -0 chmod u+rwx,g+rx,o+rx 
     144        - $(FIND) $(TARGET_DIR) -type d -print0 | $(XARGS) -0 chmod u+rwx,g+rx,o+rx 
    143145        $(INSTALL_DIR) $(TARGET_DIR)/tmp 
    144146        chmod 0777 $(TARGET_DIR)/tmp 
Note: See TracChangeset for help on using the changeset viewer.