diff options
author | Eric Andersen <andersen@codepoet.org> | 2005-08-04 06:32:52 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2005-08-04 06:32:52 +0000 |
commit | d1345f067e18a2967638eb888c7ff5010d523acf (patch) | |
tree | 209a7f9055e89cd63d6f0a7994ae923b12312cb5 /target | |
parent | 1172dbb8b15c2ccddfa9492850d2f6fbb61e2263 (diff) | |
download | buildroot-novena-d1345f067e18a2967638eb888c7ff5010d523acf.tar.gz buildroot-novena-d1345f067e18a2967638eb888c7ff5010d523acf.zip |
Allow packages to use fakeroot. To accomodate this, convert all
target filesystem creation tools to also use fakeroot.
Diffstat (limited to 'target')
-rw-r--r-- | target/cramfs/cramfs.mk | 20 | ||||
-rw-r--r-- | target/ext2/ext2root.mk | 21 | ||||
-rw-r--r-- | target/jffs2/jffs2root.mk | 25 | ||||
-rw-r--r-- | target/squashfs/squashfsroot.mk | 7 | ||||
-rw-r--r-- | target/tar/tarroot.mk | 7 |
5 files changed, 61 insertions, 19 deletions
diff --git a/target/cramfs/cramfs.mk b/target/cramfs/cramfs.mk index a53cbff4f..2964dddd3 100644 --- a/target/cramfs/cramfs.mk +++ b/target/cramfs/cramfs.mk @@ -64,8 +64,24 @@ cramfsroot: cramfs @rm -rf $(TARGET_DIR)/usr/man @rm -rf $(TARGET_DIR)/usr/info /sbin/ldconfig -r $(TARGET_DIR) - $(CRAMFS_DIR)/mkcramfs -q $(CRAMFS_ENDIANNESS) -D \ - target/generic/device_table.txt $(TARGET_DIR) $(IMAGE).cramfs + # Use fakeroot to pretend all target binaries are owned by root + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + 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) + # Use fakeroot so mkcramfs believes the previous fakery + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + $(CRAMFS_DIR)/mkcramfs -q $(CRAMFS_ENDIANNESS) \ + $(TARGET_DIR) $(IMAGE).cramfs cramfsroot-source: cramfs-source diff --git a/target/ext2/ext2root.mk b/target/ext2/ext2root.mk index 8056fafcd..a934c5a5a 100644 --- a/target/ext2/ext2root.mk +++ b/target/ext2/ext2root.mk @@ -71,6 +71,19 @@ $(EXT2_BASE): genext2fs @rm -rf $(TARGET_DIR)/usr/share/man @rm -rf $(TARGET_DIR)/usr/info /sbin/ldconfig -r $(TARGET_DIR) + # Use fakeroot to pretend all target binaries are owned by root + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + 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) + # 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//"`; \ GENEXT2_ADDTOROOTSIZE=`if [ $$GENEXT2_REALSIZE -ge 20000 ] ; then echo 16384; else echo 2400; fi`; \ @@ -78,16 +91,20 @@ ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) GENEXT2_ADDTOINODESIZE=`find $(TARGET_DIR) | wc -l`; \ 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 \ -b $$GENEXT2_SIZE \ -i $$GENEXT2_INODES \ -d $(TARGET_DIR) \ - -D $(TARGET_DEVICE_TABLE) \ $(EXT2_OPTS) $(EXT2_BASE) else + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ $(GENEXT2_DIR)/genext2fs \ -d $(TARGET_DIR) \ - -D $(TARGET_DEVICE_TABLE) \ $(EXT2_OPTS) \ $(EXT2_BASE) endif diff --git a/target/jffs2/jffs2root.mk b/target/jffs2/jffs2root.mk index 83cdeb63a..04922aaf2 100644 --- a/target/jffs2/jffs2root.mk +++ b/target/jffs2/jffs2root.mk @@ -44,11 +44,26 @@ $(JFFS2_TARGET): mtd-host @rm -rf $(TARGET_DIR)/usr/share/man @rm -rf $(TARGET_DIR)/usr/info /sbin/ldconfig -r $(TARGET_DIR) - $(MKFS_JFFS2) \ - $(JFFS2_OPTS) \ - -d $(BUILD_DIR)/root \ - -o $(JFFS2_TARGET) \ - -D $(TARGET_DEVICE_TABLE) + # Use fakeroot to pretend all target binaries are owned by root + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + 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) + # Use fakeroot so mkfs.jffs2 believes the previous fakery + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + $(MKFS_JFFS2) \ + $(JFFS2_OPTS) \ + -d $(BUILD_DIR)/root \ + -o $(JFFS2_TARGET) @ls -l $(JFFS2_TARGET) JFFS2_COPYTO := $(strip $(subst ",,$(BR2_TARGET_ROOTFS_JFFS2_COPYTO))) diff --git a/target/squashfs/squashfsroot.mk b/target/squashfs/squashfsroot.mk index abbd61848..d64380d21 100644 --- a/target/squashfs/squashfsroot.mk +++ b/target/squashfs/squashfsroot.mk @@ -58,9 +58,6 @@ squashfsroot: squashfs host-fakeroot makedevs @rm -rf $(TARGET_DIR)/usr/man @rm -rf $(TARGET_DIR)/usr/info /sbin/ldconfig -r $(TARGET_DIR) - # Use fakeroot to munge permissions and do root-like things - rm -f $(STAGING_DIR)/fakeroot.env - touch $(STAGING_DIR)/fakeroot.env # Use fakeroot to pretend all target binaries are owned by root $(STAGING_DIR)/usr/bin/fakeroot \ -i $(STAGING_DIR)/fakeroot.env \ @@ -71,9 +68,9 @@ squashfsroot: squashfs host-fakeroot makedevs -i $(STAGING_DIR)/fakeroot.env \ -s $(STAGING_DIR)/fakeroot.env -- \ $(STAGING_DIR)/bin/makedevs \ - -d target/generic/device_table.txt \ + -d $(TARGET_DEVICE_TABLE) \ $(TARGET_DIR) - # Use fakeroot to fake out mksquashfs per the previous fakery + # Use fakeroot so mksquashfs believes the previous fakery $(STAGING_DIR)/usr/bin/fakeroot \ -i $(STAGING_DIR)/fakeroot.env \ -s $(STAGING_DIR)/fakeroot.env -- \ diff --git a/target/tar/tarroot.mk b/target/tar/tarroot.mk index d5837442b..2ac07cddc 100644 --- a/target/tar/tarroot.mk +++ b/target/tar/tarroot.mk @@ -11,9 +11,6 @@ tarroot: host-fakeroot makedevs @rm -rf $(TARGET_DIR)/usr/man @rm -rf $(TARGET_DIR)/usr/info /sbin/ldconfig -r $(TARGET_DIR) - # Use fakeroot to munge permissions and do root-like things - rm -f $(STAGING_DIR)/fakeroot.env - touch $(STAGING_DIR)/fakeroot.env # Use fakeroot to pretend all target binaries are owned by root $(STAGING_DIR)/usr/bin/fakeroot \ -i $(STAGING_DIR)/fakeroot.env \ @@ -24,9 +21,9 @@ tarroot: host-fakeroot makedevs -i $(STAGING_DIR)/fakeroot.env \ -s $(STAGING_DIR)/fakeroot.env -- \ $(STAGING_DIR)/bin/makedevs \ - -d target/generic/device_table.txt \ + -d $(TARGET_DEVICE_TABLE) \ $(TARGET_DIR) - # Use fakeroot to fake out tar per the previous fakery + # Use fakeroot so tar believes the previous fakery $(STAGING_DIR)/usr/bin/fakeroot \ -i $(STAGING_DIR)/fakeroot.env \ -s $(STAGING_DIR)/fakeroot.env -- \ |