c6bca8cef0
Auto-calculation of the rootfs size cannot be done in a reliable way as it depends on the host filesystem and is broken on non ext4 host (see bugs [1] [2]). So let the user specify the size he wants for his rootfs. [1] https://bugs.busybox.net/show_bug.cgi?id=8831 [2] https://bugs.busybox.net/show_bug.cgi?id=9496 Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: as suggested by Arnout, use 60 MB as the default size instead of 64 MB.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
45 lines
1.3 KiB
Makefile
45 lines
1.3 KiB
Makefile
################################################################################
|
|
#
|
|
# Build the ext2 root filesystem image
|
|
#
|
|
################################################################################
|
|
|
|
EXT2_OPTS = -G $(BR2_TARGET_ROOTFS_EXT2_GEN) -R $(BR2_TARGET_ROOTFS_EXT2_REV)
|
|
|
|
ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0)
|
|
EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
|
|
endif
|
|
|
|
ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_INODES)),0)
|
|
EXT2_OPTS += -i $(BR2_TARGET_ROOTFS_EXT2_INODES)
|
|
endif
|
|
EXT2_OPTS += -I $(BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES)
|
|
|
|
ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),0)
|
|
EXT2_OPTS += -r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
|
|
endif
|
|
|
|
# qstrip results in stripping consecutive spaces into a single one. So the
|
|
# variable is not qstrip-ed to preserve the integrity of the string value.
|
|
EXT2_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
|
|
ifneq ($(EXT2_LABEL),)
|
|
EXT2_OPTS += -l "$(EXT2_LABEL)"
|
|
endif
|
|
|
|
ROOTFS_EXT2_DEPENDENCIES = host-mke2img
|
|
|
|
define ROOTFS_EXT2_CMD
|
|
PATH=$(BR_PATH) mke2img -d $(TARGET_DIR) $(EXT2_OPTS) -o $@
|
|
endef
|
|
|
|
rootfs-ext2-symlink:
|
|
ln -sf rootfs.ext2$(ROOTFS_EXT2_COMPRESS_EXT) $(BINARIES_DIR)/rootfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN)$(ROOTFS_EXT2_COMPRESS_EXT)
|
|
|
|
.PHONY: rootfs-ext2-symlink
|
|
|
|
ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2)
|
|
ROOTFS_EXT2_POST_TARGETS += rootfs-ext2-symlink
|
|
endif
|
|
|
|
$(eval $(call ROOTFS_TARGET,ext2))
|