summaryrefslogtreecommitdiffstats
path: root/fs/ext2/ext2.mk
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-04-19 14:24:11 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2010-04-19 14:33:14 +0200
commitfb951b93423356a7b648a8e268cd5af57d964f45 (patch)
tree52cedf70ce02752a76aeb683942097e2139f4668 /fs/ext2/ext2.mk
parentf7f01e18e77dd43d535002783e9a40deedd2d924 (diff)
downloadbuildroot-novena-fb951b93423356a7b648a8e268cd5af57d964f45.tar.gz
buildroot-novena-fb951b93423356a7b648a8e268cd5af57d964f45.zip
fs/ext2: fix blocks/inodes calculation
With the ROOTFS_TARGET conversion, EXT2_OPTS gets evaluated very early (before TARGET_DIR is populated with files), so the calculated blocks/inodes numbers are wrong. Fix it by moving the calculation to a shell script wrapper around genext2fs, so it only gets executed just before genext2fs runs. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'fs/ext2/ext2.mk')
-rw-r--r--fs/ext2/ext2.mk13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
index f3d3ff92f..18a6df424 100644
--- a/fs/ext2/ext2.mk
+++ b/fs/ext2/ext2.mk
@@ -24,17 +24,8 @@ endif
ROOTFS_EXT2_DEPENDENCIES = host-genext2fs
-ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0)
-GENEXT2_REALSIZE=$(shell LC_ALL=C du -s -c -k $(TARGET_DIR) | grep total | sed -e "s/total//")
-GENEXT2_ADDTOROOTSIZE=$(shell if [ $(GENEXT2_REALSIZE) -ge 20000 ]; then echo 16384; else echo 2400; fi)
-GENEXT2_SIZE=$(shell expr $(GENEXT2_REALSIZE) + $(GENEXT2_ADDTOROOTSIZE))
-GENEXT2_ADDTOINODESIZE=$(shell find $(TARGET_DIR) | wc -l)
-GENEXT2_INODES=$(shell expr $(GENEXT2_ADDTOINODESIZE) + 400)
-EXT2_OPTS += -b $(GENEXT2_SIZE) -N $(GENEXT2_INODES)
-endif
-
define ROOTFS_EXT2_CMD
- $(HOST_DIR)/usr/bin/genext2fs -d $(TARGET_DIR) $(EXT2_OPTS) $$@
+ PATH=$(TARGET_PATH) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $$@
endef
-$(eval $(call ROOTFS_TARGET,ext2)) \ No newline at end of file
+$(eval $(call ROOTFS_TARGET,ext2))