@@ -145,6 +145,17 @@ endif
###############################################################################
comment "Legacy options removed in 2017.08"
+config BR2_TARGET_ROOTFS_EXT2_BLOCKS
+ int "exact size in blocks has been removed"
+ default 0
+ help
+ This option has been removed in favor of BR2_TARGET_ROOTFS_EXT2_SIZE.
+
+config BR2_TARGET_ROOTFS_EXT2_BLOCKS_WRAP
+ bool
+ default y if BR2_TARGET_ROOTFS_EXT2_BLOCKS != 0
+ select BR2_LEGACY
+
config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES
int "ext2 extra inodes has been removed" if BR2_TARGET_ROOTFS_EXT2_INODES = 0
default 0
@@ -1,6 +1,6 @@
config BR2_TARGET_ROOTFS_EXT2
bool "ext2/3/4 root filesystem"
- select BR2_PACKAGE_HOST_MKE2IMG
+ select BR2_PACKAGE_HOST_E2FSPROGS
help
Build an ext2/3/4 root filesystem
@@ -66,19 +66,20 @@ config BR2_TARGET_ROOTFS_EXT2_BLOCK_SIZE
default 2048 if BR2_TARGET_ROOTFS_EXT2_BLOCK_2048
default 4096 if BR2_TARGET_ROOTFS_EXT2_BLOCK_4096
-# 61440 block of 1024 bytes = 60MB, i.e usually small enough to fit
-# on a 64MB media
-config BR2_TARGET_ROOTFS_EXT2_BLOCKS
- int "exact size in blocks"
- default 61440
- help
- Specify the file system size as a number of blocks, which
- size is specified above.
-
config BR2_TARGET_ROOTFS_EXT2_INODES
int "exact number of inodes (leave at 0 for auto calculation)"
default 0
+config BR2_TARGET_ROOTFS_EXT2_SIZE
+ string "exact size"
+ default BR2_TARGET_ROOTFS_EXT2_BLOCKS if BR2_TARGET_ROOTFS_EXT2_BLOCKS != 0 # legacy 2017.08
+ default "60M" # default size
+ help
+ The size of the filesystem image. If it does not have a suffix, it is
+ interpreted as power-of-two kilobytes. If it is suffixed by 'k', 'm',
+ 'g', 't' (either upper-case or lower-case), then it is interpreted in
+ power-of-two kilobytes, megabytes, gigabytes, terabytes, etc.
+
config BR2_TARGET_ROOTFS_EXT2_RESBLKS
int "reserved blocks percentage"
default 5
@@ -4,24 +4,29 @@
#
################################################################################
+EXT2_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_SIZE))
+ifeq ($(BR2_TARGET_ROOTFS_EXT)-$(EXT2_SIZE),y-)
+$(error BR2_TARGET_ROOTFS_EXT2_SIZE cannot be empty)
+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))
#" Syntax highlighting... :-/ )
EXT2_OPTS = \
- -G $(BR2_TARGET_ROOTFS_EXT2_GEN) \
- -R $(BR2_TARGET_ROOTFS_EXT2_REV) \
- -B $(BR2_TARGET_ROOTFS_EXT2_BLOCK_SIZE) \
- -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) \
- -i $(BR2_TARGET_ROOTFS_EXT2_INODES) \
- -r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
- -l "$(EXT2_LABEL)"
+ -d $(TARGET_DIR) \
+ -r $(BR2_TARGET_ROOTFS_EXT2_REV) \
+ -b $(BR2_TARGET_ROOTFS_EXT2_BLOCK_SIZE) \
+ -N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
+ -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
+ -L "$(EXT2_LABEL)"
-ROOTFS_EXT2_DEPENDENCIES = host-mke2img
+ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
define ROOTFS_EXT2_CMD
- PATH=$(BR_PATH) mke2img -d $(TARGET_DIR) $(EXT2_OPTS) -o $@
+ rm -f $@
+ PATH=$(BR_PATH) mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ $(EXT2_SIZE)
endef
rootfs-ext2-symlink: