2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2002-04-26 13:45:55 +02:00
|
|
|
#
|
|
|
|
# Build the ext2 root filesystem image
|
|
|
|
#
|
2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2002-04-26 13:45:55 +02:00
|
|
|
|
2017-07-09 07:00:38 +02:00
|
|
|
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
|
|
|
|
|
2017-07-09 07:00:39 +02:00
|
|
|
EXT2_MKFS_OPTS = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS))
|
|
|
|
|
2016-11-21 17:15:29 +01:00
|
|
|
# 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))
|
2017-07-04 00:50:58 +02:00
|
|
|
#" Syntax highlighting... :-/ )
|
|
|
|
|
2017-07-04 00:51:00 +02:00
|
|
|
EXT2_OPTS = \
|
2017-07-04 16:47:26 +02:00
|
|
|
-d $(TARGET_DIR) \
|
|
|
|
-r $(BR2_TARGET_ROOTFS_EXT2_REV) \
|
|
|
|
-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
|
|
|
|
-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
|
2017-07-09 07:00:39 +02:00
|
|
|
-L "$(EXT2_LABEL)" \
|
|
|
|
$(EXT2_MKFS_OPTS)
|
2014-12-06 23:40:06 +01:00
|
|
|
|
2017-07-04 16:47:26 +02:00
|
|
|
ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
|
2005-01-23 11:53:06 +01:00
|
|
|
|
2010-03-10 00:15:15 +01:00
|
|
|
define ROOTFS_EXT2_CMD
|
2017-07-04 16:47:26 +02:00
|
|
|
rm -f $@
|
2017-07-05 13:14:20 +02:00
|
|
|
$(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ \
|
2017-07-26 00:05:28 +02:00
|
|
|
"$(EXT2_SIZE)" \
|
|
|
|
|| { ret=$$?; \
|
|
|
|
echo "*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)" 1>&2; \
|
|
|
|
exit $$ret; \
|
|
|
|
}
|
2010-03-10 00:15:15 +01:00
|
|
|
endef
|
2002-04-26 13:45:55 +02:00
|
|
|
|
2013-11-07 00:12:29 +01:00
|
|
|
rootfs-ext2-symlink:
|
2013-11-07 00:12:33 +01:00
|
|
|
ln -sf rootfs.ext2$(ROOTFS_EXT2_COMPRESS_EXT) $(BINARIES_DIR)/rootfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN)$(ROOTFS_EXT2_COMPRESS_EXT)
|
2013-11-07 00:12:29 +01:00
|
|
|
|
2015-04-12 18:37:46 +02:00
|
|
|
.PHONY: rootfs-ext2-symlink
|
|
|
|
|
2013-04-11 14:17:52 +02:00
|
|
|
ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2)
|
2013-11-07 00:12:29 +01:00
|
|
|
ROOTFS_EXT2_POST_TARGETS += rootfs-ext2-symlink
|
2013-04-11 14:17:52 +02:00
|
|
|
endif
|
|
|
|
|
2010-04-19 14:24:11 +02:00
|
|
|
$(eval $(call ROOTFS_TARGET,ext2))
|