]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS to BR2_TARGET_ROOTFS_EXT2_SIZE
authorSamuel Martin <s.martin49@gmail.com>
Sun, 9 Jul 2017 05:00:38 +0000 (07:00 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 9 Jul 2017 13:35:30 +0000 (15:35 +0200)
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>
Config.in.legacy
configs/at91sam9x5ek_mmc_dev_defconfig
configs/beaglebone_qt5_defconfig
configs/firefly_rk3288_demo_defconfig
configs/minnowboard_max-graphical_defconfig
configs/nanopi_neo_defconfig
configs/pc_x86_64_bios_defconfig
configs/pc_x86_64_efi_defconfig
configs/raspberrypi3_64_defconfig
fs/ext2/Config.in
fs/ext2/ext2.mk

index 12362da6f2ca5ba42c368b11d580457ae463f965..805d5a46cbd65d0517b2f19dfa750c71c8a157e1 100644 (file)
@@ -152,6 +152,23 @@ config BR2_PACKAGE_HOST_MKE2IMG
          We now call mkfs directly to generate ext2/3/4 filesystem
          image, so mke2img is no longer necessary.
 
+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. It has been set automatically
+         to the value you had before. Set to 0 here to remove the
+         warning.
+
+config BR2_TARGET_ROOTFS_EXT2_BLOCKS_WRAP
+       bool
+       default y if BR2_TARGET_ROOTFS_EXT2_BLOCKS != 0 && \
+               BR2_TARGET_ROOTFS_EXT2_BLOCKS != 61440 # deprecated default value
+       select BR2_LEGACY
+
+# Note: BR2_TARGET_ROOTFS_EXT2_BLOCKS_WRAP still referenced in fs/ext2/Config.in
+
 config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES
        int "ext2 extra inodes has been removed" if BR2_TARGET_ROOTFS_EXT2_INODES = 0
        default 0
index 0060111fca15001b95328aab6b3c7faf38f41432..d704b8152a852737edd6b9c40878adaedd034e8d 100644 (file)
@@ -81,7 +81,7 @@ BR2_PACKAGE_VIM=y
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=120000
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
 
 # Bootloaders
 BR2_TARGET_AT91BOOTSTRAP3=y
index 34063739a2c38e4a9f200df463c75fc065043e77..4135f718ed5a71f1ae8b5fc2bbced475a1c9b50a 100644 (file)
@@ -25,7 +25,7 @@ BR2_PACKAGE_TI_SGX_KM=y
 BR2_PACKAGE_TI_SGX_UM=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=126976
+BR2_TARGET_ROOTFS_EXT2_SIZE="124M"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
index 0f4dd368c43851bd98c2537593c145a767b33c39..d394ede30eddca093110517f1d5b417da9f2d8ae 100644 (file)
@@ -25,7 +25,7 @@ BR2_PACKAGE_QT5BASE_EGLFS=y
 BR2_PACKAGE_MALI_T76X=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=250000
+BR2_TARGET_ROOTFS_EXT2_SIZE="250M"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
index 1a2cd33be25b004b78e7fa02919161809cf4c8a9..3540f9fa8778e67843c9495b03277cfd383a955c 100644 (file)
@@ -68,6 +68,5 @@ BR2_PACKAGE_STARTUP_NOTIFICATION=y
 # Filesystem image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=120000
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
 # BR2_TARGET_ROOTFS_TAR is not set
-
index a22705269d9c3ebf350e453d6ca3c8383cf73d53..aa464917b560af5a7fa788431255fea3a0ff10c2 100644 (file)
@@ -31,7 +31,7 @@ BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
 # Build an sdcard image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=32768
+BR2_TARGET_ROOTFS_EXT2_SIZE="32M"
 BR2_TARGET_ROOTFS_EXT2_INODES=8192
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
index d64f09a1dcbf08984e09c71924b96889803bd687..7e852f36505656fec95714f214f51ab6ac9458e0 100644 (file)
@@ -17,7 +17,7 @@ BR2_TARGET_GRUB2=y
 # Filesystem / image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=120000
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/pc/post-image.sh"
 
index ea2abc39be59ebbeb488ea4b0e875ffdec17eeef..f558c3e8cb74f7dd6b65d7f05ababc1ec0179866 100644 (file)
@@ -20,7 +20,7 @@ BR2_TARGET_GRUB2_X86_64_EFI=y
 # Filesystem / image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=120000
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/pc/post-image.sh"
 
index 13a505b03107f60f63cf4f37f890fb512b0537d3..23db9ccb0504976bc6d30e89f3703f8deb7edc4b 100644 (file)
@@ -30,7 +30,7 @@ BR2_PACKAGE_HOST_MTOOLS=y
 # Filesystem / image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=120000
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3-64/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3-64/post-image.sh"
index 9c58ac62ed1b9f79bc5b0c7995ea2d2bbf4a8475..493f6c930cf486a40159c73bb7368b55cfd02c68 100644 (file)
@@ -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)"
index 99d03f10cf2eae9373a53e6d53cf4a8c3460660c..fdd4a389a0703d0b85e5d80d021fa69cf591b652 100644 (file)
@@ -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: