kumquat-buildroot/fs/ext2/ext2.mk
Sébastien Szymanski b404b27d41 fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option
This option lets the user specify mke2fs options and/or ext2/3/4
features.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[Thomas: improve wording a bit, fix typos.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-09 15:35:42 +02:00

45 lines
1.3 KiB
Makefile

################################################################################
#
# Build the ext2 root filesystem image
#
################################################################################
EXT2_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_SIZE))
ifeq ($(BR2_TARGET_ROOTFS_EXT2)-$(EXT2_SIZE),y-)
$(error BR2_TARGET_ROOTFS_EXT2_SIZE cannot be empty)
endif
EXT2_MKFS_OPTS = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS))
# 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))
#" Syntax highlighting... :-/ )
EXT2_OPTS = \
-d $(TARGET_DIR) \
-r $(BR2_TARGET_ROOTFS_EXT2_REV) \
-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
-L "$(EXT2_LABEL)" \
$(EXT2_MKFS_OPTS)
ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
define ROOTFS_EXT2_CMD
rm -f $@
$(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ \
"$(EXT2_SIZE)"
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))