diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-04-07 20:30:43 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-04-07 20:30:43 +0000 |
commit | ee66f55213b1fd5a006e8638d524e490c9f65f3b (patch) | |
tree | 79a582b6718d15377af224e818304c73f5271c3b /target/ext2/ext2root.mk | |
parent | f333602f7309753302b61c8a2aa1e217d95121e4 (diff) |
rework fakeroot handling to avoid races during parallel make causing several
fakeroot instances stomping eachother's temp files.
Diffstat (limited to 'target/ext2/ext2root.mk')
-rw-r--r-- | target/ext2/ext2root.mk | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/target/ext2/ext2root.mk b/target/ext2/ext2root.mk index fec8795b5..06ab3d2f3 100644 --- a/target/ext2/ext2root.mk +++ b/target/ext2/ext2root.mk @@ -65,24 +65,24 @@ else EXT2_TARGET := $(EXT2_BASE) endif -$(EXT2_BASE): host-fakeroot makedevs $(STAGING_DIR)/fakeroot.env genext2fs +$(EXT2_BASE): host-fakeroot makedevs genext2fs -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true; @rm -rf $(TARGET_DIR)/usr/man @rm -rf $(TARGET_DIR)/usr/share/man @rm -rf $(TARGET_DIR)/usr/info -/sbin/ldconfig -r $(TARGET_DIR) 2>/dev/null # Use fakeroot to pretend all target binaries are owned by root + rm -f $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) + cat $(STAGING_DIR)/.fakeroot* > $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) -$(STAGING_DIR)/usr/bin/fakeroot \ - -i $(STAGING_DIR)/fakeroot.env \ - -s $(STAGING_DIR)/fakeroot.env -- \ + -i $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) \ + -s $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) -- \ chown -R root:root $(TARGET_DIR) # Use fakeroot to pretend to create all needed device nodes $(STAGING_DIR)/usr/bin/fakeroot \ - -i $(STAGING_DIR)/fakeroot.env \ - -s $(STAGING_DIR)/fakeroot.env -- \ - $(STAGING_DIR)/bin/makedevs \ - -d $(TARGET_DEVICE_TABLE) \ - $(TARGET_DIR) + -i $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) \ + -s $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) -- \ + $(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR) # Use fakeroot so genext2fs believes the previous fakery ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) GENEXT2_REALSIZE=`LANG=C du -l -s -c -k $(TARGET_DIR) | grep total | sed -e "s/total//"`; \ @@ -92,22 +92,23 @@ ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) GENEXT2_INODES=`expr $$GENEXT2_ADDTOINODESIZE + 400`; \ set -x; \ $(STAGING_DIR)/usr/bin/fakeroot \ - -i $(STAGING_DIR)/fakeroot.env \ - -s $(STAGING_DIR)/fakeroot.env -- \ - $(GENEXT2_DIR)/genext2fs \ + -i $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) \ + -s $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) -- \ + $(GENEXT2_DIR)/genext2fs \ -b $$GENEXT2_SIZE \ -i $$GENEXT2_INODES \ -d $(TARGET_DIR) \ $(EXT2_OPTS) $(EXT2_BASE) else $(STAGING_DIR)/usr/bin/fakeroot \ - -i $(STAGING_DIR)/fakeroot.env \ - -s $(STAGING_DIR)/fakeroot.env -- \ - $(GENEXT2_DIR)/genext2fs \ + -i $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) \ + -s $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) -- \ + $(GENEXT2_DIR)/genext2fs \ -d $(TARGET_DIR) \ $(EXT2_OPTS) \ $(EXT2_BASE) endif + -@rm -f $(STAGING_DIR)/_fakeroot.$(EXT2_TARGET) $(EXT2_BASE).gz: $(EXT2_BASE) @gzip --best -fv $(EXT2_BASE) |