aboutsummaryrefslogtreecommitdiff
path: root/fs/ext2
diff options
context:
space:
mode:
authorGravatar Samuel Martin <s.martin49@gmail.com>2017-07-09 07:00:38 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-07-09 15:35:30 +0200
commitbee9e881a2d3addd6880b39f3e33a7180d0b1eb4 (patch)
tree1964d27772b0cbc22efdff1d7d01a3d0505fa78e /fs/ext2
parent0dcf75eb7dfc545ddf47a156b76bedb2a2d86526 (diff)
downloadbuildroot-bee9e881a2d3addd6880b39f3e33a7180d0b1eb4.tar.gz
buildroot-bee9e881a2d3addd6880b39f3e33a7180d0b1eb4.tar.bz2
fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS to BR2_TARGET_ROOTFS_EXT2_SIZE
This change deprecates the ext2/3/4 rootfs size in blocks symbol in favor of one that mimic the fs-size argument behavior of mkfs (i.e. size in a human readable format accepting k, m, g or t suffix or their upper-case variants). This change also updates the defconfigs that used to set BR2_TARGET_ROOTFS_EXT2_BLOCKS symbol. Signed-off-by: Samuel Martin <s.martin49@gmail.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/Config.in14
-rw-r--r--fs/ext2/ext2.mk7
2 files changed, 15 insertions, 6 deletions
diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
index 9c58ac62ed..493f6c930c 100644
--- a/fs/ext2/Config.in
+++ b/fs/ext2/Config.in
@@ -44,12 +44,16 @@ config BR2_TARGET_ROOTFS_EXT2_REV
config BR2_TARGET_ROOTFS_EXT2_LABEL
string "filesystem label"
-# 61440 = 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
+config BR2_TARGET_ROOTFS_EXT2_SIZE
+ string "exact size"
+ default BR2_TARGET_ROOTFS_EXT2_BLOCKS if BR2_TARGET_ROOTFS_EXT2_BLOCKS_WRAP # legacy 2017.08
+ default "60M"
help
- Specify the file system size as a number of 1024-byte blocks.
+ 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_INODES
int "exact number of inodes (leave at 0 for auto calculation)"
diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
index 99d03f10cf..fdd4a389a0 100644
--- a/fs/ext2/ext2.mk
+++ b/fs/ext2/ext2.mk
@@ -4,6 +4,11 @@
#
################################################################################
+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
+
# 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))
@@ -21,7 +26,7 @@ ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
define ROOTFS_EXT2_CMD
rm -f $@
$(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ \
- $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
+ "$(EXT2_SIZE)"
endef
rootfs-ext2-symlink: