2002-04-26 13:45:55 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Build the ext2 root filesystem image
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
2005-02-12 05:32:17 +01:00
|
|
|
EXT2_OPTS :=
|
2002-10-23 09:56:20 +02:00
|
|
|
|
2008-12-08 09:15:58 +01:00
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_EXT2_SQUASH),y)
|
2005-02-19 00:58:16 +01:00
|
|
|
EXT2_OPTS += -U
|
2005-02-12 05:32:17 +01:00
|
|
|
endif
|
2005-01-23 11:53:06 +01:00
|
|
|
|
2005-02-12 05:32:17 +01:00
|
|
|
ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0)
|
2008-12-08 09:15:58 +01:00
|
|
|
EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
|
2005-01-23 11:53:06 +01:00
|
|
|
endif
|
|
|
|
|
2005-02-12 05:32:17 +01:00
|
|
|
ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_INODES)),0)
|
2008-12-08 09:15:58 +01:00
|
|
|
EXT2_OPTS += -N $(BR2_TARGET_ROOTFS_EXT2_INODES)
|
2005-01-23 11:53:06 +01:00
|
|
|
endif
|
|
|
|
|
2006-12-22 13:34:35 +01:00
|
|
|
ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),)
|
2008-12-08 09:15:58 +01:00
|
|
|
EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
|
2005-01-23 11:53:06 +01:00
|
|
|
endif
|
|
|
|
|
2010-03-10 00:15:15 +01:00
|
|
|
ROOTFS_EXT2_DEPENDENCIES = host-genext2fs
|
2005-01-23 11:53:06 +01:00
|
|
|
|
2005-02-12 05:32:17 +01:00
|
|
|
ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0)
|
2010-03-10 00:15:15 +01:00
|
|
|
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)
|
2005-02-12 05:32:17 +01:00
|
|
|
endif
|
|
|
|
|
2010-03-10 00:15:15 +01:00
|
|
|
define ROOTFS_EXT2_CMD
|
|
|
|
$(HOST_DIR)/usr/bin/genext2fs -d $(TARGET_DIR) $(EXT2_OPTS) $$@
|
|
|
|
endef
|
2002-04-26 13:45:55 +02:00
|
|
|
|
2010-03-10 00:15:15 +01:00
|
|
|
$(eval $(call ROOTFS_TARGET,ext2))
|