All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 0/5] fs/ext2: cleanup and improvement
@ 2017-07-04 14:47 Samuel Martin
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option Samuel Martin
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Samuel Martin @ 2017-07-04 14:47 UTC (permalink / raw)
  To: buildroot

Hi all,

Here is anothe respin of the remaining patchs of (so even shorter)
series based on 2 series initially sent early last May by S?bastien
Szymanski and Yann E. Morin, refactoring and improving the ext2/3/4
image support.

Regards,


Samuel Martin (2):
  fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option
  fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS ->
    BR2_TARGET_ROOTFS_EXT2_SIZE

S?bastien Szymanski (3):
  fs/ext2: use mkfs to generate rootfs image
  fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option
  package/mke2img: remove package

 Config.in.legacy                            |  32 +++++
 DEVELOPERS                                  |   1 -
 configs/at91sam9x5ek_mmc_dev_defconfig      |   2 +-
 configs/beaglebone_qt5_defconfig            |   2 +-
 configs/firefly_rk3288_demo_defconfig       |   2 +-
 configs/minnowboard_max-graphical_defconfig |   2 +-
 configs/nanopi_neo_defconfig                |   2 +-
 configs/pc_x86_64_bios_defconfig            |   2 +-
 configs/pc_x86_64_efi_defconfig             |   2 +-
 configs/raspberrypi3_64_defconfig           |   2 +-
 fs/ext2/Config.in                           |  40 ++++--
 fs/ext2/ext2.mk                             |  26 ++--
 package/Config.in.host                      |   1 -
 package/mke2img/Config.in.host              |  11 --
 package/mke2img/mke2img                     | 205 ----------------------------
 package/mke2img/mke2img.mk                  |  13 --
 16 files changed, 82 insertions(+), 263 deletions(-)
 delete mode 100644 package/mke2img/Config.in.host
 delete mode 100755 package/mke2img/mke2img
 delete mode 100644 package/mke2img/mke2img.mk

--
2.13.2

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option
  2017-07-04 14:47 [Buildroot] [PATCH v5 0/5] fs/ext2: cleanup and improvement Samuel Martin
@ 2017-07-04 14:47 ` Samuel Martin
  2017-07-04 17:01   ` Arnout Vandecappelle
  2017-07-04 22:40   ` Thomas Petazzoni
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image Samuel Martin
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 15+ messages in thread
From: Samuel Martin @ 2017-07-04 14:47 UTC (permalink / raw)
  To: buildroot

Soon, the ext{2,3,4} rootfs image will no longer be generated with
genext2fs, but using mke2fs instead which has no support for the extra
inode number option.

So, deprecate the BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option and
recommend, in lieu, to set the total inode number, taking account of
the extra ones if needed.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
changes v4->v5:
- reword legacy option help text (Arnout)

changes v3->v4:
- rename deprecate prompt in Config.in.legacy (Arnout)
- introduce a _WRAP symbol to actually select BR2_LEGACY when needed
  (Arnout)

changes v2->v3:
- new patch (Yann)
---
 Config.in.legacy  | 15 +++++++++++++++
 fs/ext2/Config.in |  8 --------
 fs/ext2/ext2.mk   |  1 -
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index 453c5eb8b8..8ea468b64a 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -145,6 +145,21 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2017.08"
 
+config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES
+	int "ext2 extra inodes has been removed" if BR2_TARGET_ROOTFS_EXT2_INODES = 0
+	default 0
+	help
+	  Buildroot now uses mkfs.ext2/3/4 to generate ext2/3/4 images. It
+	  now automatically selects the number of inodes based on the image
+	  size. The extra number of inodes can no longer be provided; instead,
+	  provide the total number of inodes needed in
+	  BR2_TARGET_ROOTFS_EXT2_INODES.
+
+config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES_WRAP
+	bool
+	default y if BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES != 0
+	select BR2_LEGACY
+
 config BR2_STRIP_none
 	bool "Strip command 'none' has been removed"
 	select BR2_LEGACY
diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
index 6f16dde17f..ec1b5f2c55 100644
--- a/fs/ext2/Config.in
+++ b/fs/ext2/Config.in
@@ -55,14 +55,6 @@ config BR2_TARGET_ROOTFS_EXT2_INODES
 	int "exact number of inodes (leave at 0 for auto calculation)"
 	default 0
 
-config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES
-	int "extra inodes" if BR2_TARGET_ROOTFS_EXT2_INODES = 0
-	default 0
-	help
-	  Enter here the number of extra free inodes you want on
-	  your filesystem. By default, Buildroot will not leave
-	  many free inodes.
-
 config BR2_TARGET_ROOTFS_EXT2_RESBLKS
 	int "reserved blocks percentage"
 	default 5
diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
index 0d5fc7f118..8a648dd66c 100644
--- a/fs/ext2/ext2.mk
+++ b/fs/ext2/ext2.mk
@@ -15,7 +15,6 @@ EXT2_OPTS = \
 	-B 1024 \
 	-b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) \
 	-i $(BR2_TARGET_ROOTFS_EXT2_INODES) \
-	-I $(BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES) \
 	-r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
 	-l "$(EXT2_LABEL)"
 
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image
  2017-07-04 14:47 [Buildroot] [PATCH v5 0/5] fs/ext2: cleanup and improvement Samuel Martin
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option Samuel Martin
@ 2017-07-04 14:47 ` Samuel Martin
  2017-07-04 17:12   ` Arnout Vandecappelle
  2017-07-04 22:41   ` Thomas Petazzoni
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE Samuel Martin
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 15+ messages in thread
From: Samuel Martin @ 2017-07-04 14:47 UTC (permalink / raw)
  To: buildroot

From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>

mkfs is now capable of generating rootfs images. Use mkfs instead of
genext2fs.

If not set, we now let mkfs calculate the block size and the number of
inodes needed.

This change also adjusts the options to meet those of mkfs.

Notes:
* Passing a null inode number to mkfs triggers its automatic calculation.
* Passing a fs-size with no unit suffix to mkfs is interpreted as using
  1K block size.

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>

---
changes v4->v5:
- remove BR2_TARGET_ROOTFS_EXT2_BLOCKS renaming
- update commit log

changes v3->v4:
- disable the size check when ext* rootfs is disabled
- remove unneeded comment
- introduce a _WRAP symbol to actually select BR2_LEGACY when needed
  (Arnout)

changes v2->v3:
- reword commit log

changes v1->v2:
- rebase
- add default size value
---
 fs/ext2/Config.in |  2 +-
 fs/ext2/ext2.mk   | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
index ec1b5f2c55..9c58ac62ed 100644
--- a/fs/ext2/Config.in
+++ b/fs/ext2/Config.in
@@ -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
 
diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
index 8a648dd66c..bff442ff18 100644
--- a/fs/ext2/ext2.mk
+++ b/fs/ext2/ext2.mk
@@ -10,18 +10,18 @@ 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 1024 \
-	-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) \
+	-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) $@ \
+		 $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
 endef
 
 rootfs-ext2-symlink:
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE
  2017-07-04 14:47 [Buildroot] [PATCH v5 0/5] fs/ext2: cleanup and improvement Samuel Martin
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option Samuel Martin
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image Samuel Martin
@ 2017-07-04 14:47 ` Samuel Martin
  2017-07-04 17:28   ` Arnout Vandecappelle
  2017-07-04 23:39   ` Peter Korsgaard
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 4/5] fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option Samuel Martin
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 5/5] package/mke2img: remove package Samuel Martin
  4 siblings, 2 replies; 15+ messages in thread
From: Samuel Martin @ 2017-07-04 14:47 UTC (permalink / raw)
  To: buildroot

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>

---
changes v4->v5:
- new patch (Arnout)
---
 Config.in.legacy                            | 11 +++++++++++
 configs/at91sam9x5ek_mmc_dev_defconfig      |  2 +-
 configs/beaglebone_qt5_defconfig            |  2 +-
 configs/firefly_rk3288_demo_defconfig       |  2 +-
 configs/minnowboard_max-graphical_defconfig |  2 +-
 configs/nanopi_neo_defconfig                |  2 +-
 configs/pc_x86_64_bios_defconfig            |  2 +-
 configs/pc_x86_64_efi_defconfig             |  2 +-
 configs/raspberrypi3_64_defconfig           |  2 +-
 fs/ext2/Config.in                           | 13 ++++++++-----
 fs/ext2/ext2.mk                             |  8 ++++++--
 11 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index 8ea468b64a..a26869ac64 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -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
diff --git a/configs/at91sam9x5ek_mmc_dev_defconfig b/configs/at91sam9x5ek_mmc_dev_defconfig
index 0060111fca..1bf2983ee7 100644
--- a/configs/at91sam9x5ek_mmc_dev_defconfig
+++ b/configs/at91sam9x5ek_mmc_dev_defconfig
@@ -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="120000K"
 
 # Bootloaders
 BR2_TARGET_AT91BOOTSTRAP3=y
diff --git a/configs/beaglebone_qt5_defconfig b/configs/beaglebone_qt5_defconfig
index 34063739a2..fd408f5d09 100644
--- a/configs/beaglebone_qt5_defconfig
+++ b/configs/beaglebone_qt5_defconfig
@@ -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="126976K"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
diff --git a/configs/firefly_rk3288_demo_defconfig b/configs/firefly_rk3288_demo_defconfig
index 0f4dd368c4..cd06aa784f 100644
--- a/configs/firefly_rk3288_demo_defconfig
+++ b/configs/firefly_rk3288_demo_defconfig
@@ -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="250000K"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
diff --git a/configs/minnowboard_max-graphical_defconfig b/configs/minnowboard_max-graphical_defconfig
index 1a2cd33be2..855d257bc8 100644
--- a/configs/minnowboard_max-graphical_defconfig
+++ b/configs/minnowboard_max-graphical_defconfig
@@ -68,6 +68,6 @@ 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="120000K"
 # BR2_TARGET_ROOTFS_TAR is not set
 
diff --git a/configs/nanopi_neo_defconfig b/configs/nanopi_neo_defconfig
index a22705269d..5fd08328f1 100644
--- a/configs/nanopi_neo_defconfig
+++ b/configs/nanopi_neo_defconfig
@@ -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="32768K"
 BR2_TARGET_ROOTFS_EXT2_INODES=8192
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
diff --git a/configs/pc_x86_64_bios_defconfig b/configs/pc_x86_64_bios_defconfig
index d64f09a1dc..b68e49919a 100644
--- a/configs/pc_x86_64_bios_defconfig
+++ b/configs/pc_x86_64_bios_defconfig
@@ -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="120000K"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/pc/post-image.sh"
 
diff --git a/configs/pc_x86_64_efi_defconfig b/configs/pc_x86_64_efi_defconfig
index ea2abc39be..400dcffa64 100644
--- a/configs/pc_x86_64_efi_defconfig
+++ b/configs/pc_x86_64_efi_defconfig
@@ -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="120000K"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/pc/post-image.sh"
 
diff --git a/configs/raspberrypi3_64_defconfig b/configs/raspberrypi3_64_defconfig
index 13a505b031..0ed9f6f708 100644
--- a/configs/raspberrypi3_64_defconfig
+++ b/configs/raspberrypi3_64_defconfig
@@ -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="120000K"
 # 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"
diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
index 9c58ac62ed..b2363940f0 100644
--- a/fs/ext2/Config.in
+++ b/fs/ext2/Config.in
@@ -44,12 +44,15 @@ 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 != 0 # legacy 2017.08
+	default "61440K" # default size
 	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 bff442ff18..c8da9c4451 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_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))
@@ -20,8 +25,7 @@ ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
 
 define ROOTFS_EXT2_CMD
 	rm -f $@
-	PATH=$(BR_PATH) mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ \
-		 $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
+	PATH=$(BR_PATH) mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ $(EXT2_SIZE)
 endef
 
 rootfs-ext2-symlink:
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 4/5] fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option
  2017-07-04 14:47 [Buildroot] [PATCH v5 0/5] fs/ext2: cleanup and improvement Samuel Martin
                   ` (2 preceding siblings ...)
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE Samuel Martin
@ 2017-07-04 14:47 ` Samuel Martin
  2017-07-04 17:39   ` Arnout Vandecappelle
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 5/5] package/mke2img: remove package Samuel Martin
  4 siblings, 1 reply; 15+ messages in thread
From: Samuel Martin @ 2017-07-04 14:47 UTC (permalink / raw)
  To: buildroot

From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>

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>

---
changes v4->v5:
- turn the options to accept any mke2fs options, not only ext2/3/4
  features (Arnout)
- add explaination for the default value for this new option (Arnout)

changes v3->v4:
- none

changes v2->v3:
- none

changes v1->v2:
- rebase
---
 fs/ext2/Config.in | 17 +++++++++++++++++
 fs/ext2/ext2.mk   |  5 ++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
index b2363940f0..9bbeb797a5 100644
--- a/fs/ext2/Config.in
+++ b/fs/ext2/Config.in
@@ -67,6 +67,23 @@ config BR2_TARGET_ROOTFS_EXT2_RESBLKS
 	  Traditionally, this has been 5%, and all ext-related tools still
 	  default to reserving 5% when creating a new ext filesystem.
 
+config BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS
+	string "additional mke2fs options"
+	default "-O ^64bit"
+	help
+	  Specify a space-separated list of mke2fs options, including any
+	  ext2/3/4 filesystem features.
+
+	  For more information about the mke2fs option, see the manual page
+	  mke2fs(8).
+
+	  For more information about the ext2/3/4 features which can be set,
+	  see then manual page ext4(5).
+
+	  The defaults disables the 64bit ext2/3/4 filesystem support since
+	  its has been enable lately in 2017 in uboot, so most of the uboot
+	  versions do not support it yet.
+
 choice
 	prompt "Compression method"
 	default BR2_TARGET_ROOTFS_EXT2_NONE
diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
index c8da9c4451..a4c4a7b3d3 100644
--- a/fs/ext2/ext2.mk
+++ b/fs/ext2/ext2.mk
@@ -9,6 +9,8 @@ ifeq ($(BR2_TARGET_ROOTFS_EXT)-$(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))
@@ -19,7 +21,8 @@ EXT2_OPTS = \
 	-r $(BR2_TARGET_ROOTFS_EXT2_REV) \
 	-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
 	-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
-	-L "$(EXT2_LABEL)"
+	-L "$(EXT2_LABEL)" \
+	$(EXT2_MKFS_OPTS)
 
 ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
 
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 5/5] package/mke2img: remove package
  2017-07-04 14:47 [Buildroot] [PATCH v5 0/5] fs/ext2: cleanup and improvement Samuel Martin
                   ` (3 preceding siblings ...)
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 4/5] fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option Samuel Martin
@ 2017-07-04 14:47 ` Samuel Martin
  2017-07-04 22:55   ` Thomas Petazzoni
  4 siblings, 1 reply; 15+ messages in thread
From: Samuel Martin @ 2017-07-04 14:47 UTC (permalink / raw)
  To: buildroot

From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>

Now that we use mkfs to generate ext2/3/4 filesystem image by calling
mkfs directly from fs/ext2/ext2.mk, we can remove this package.

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>

---
changes v4->v5:
- none

changes v3->v4:
- none

changes v2->v3:
- none

changes v1->v2:
- rebase
---
 Config.in.legacy               |   6 ++
 DEVELOPERS                     |   1 -
 package/Config.in.host         |   1 -
 package/mke2img/Config.in.host |  11 ---
 package/mke2img/mke2img        | 205 -----------------------------------------
 package/mke2img/mke2img.mk     |  13 ---
 6 files changed, 6 insertions(+), 231 deletions(-)
 delete mode 100644 package/mke2img/Config.in.host
 delete mode 100755 package/mke2img/mke2img
 delete mode 100644 package/mke2img/mke2img.mk

diff --git a/Config.in.legacy b/Config.in.legacy
index a26869ac64..5081946a99 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -145,6 +145,12 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2017.08"
 
+config BR2_PACKAGE_HOST_MKE2IMG
+	bool "host mke2img has been removed"
+	select BR2_LEGACY
+	help
+	  We now call mkfs directly to generate ext2/3/4 filesystem image.
+
 config BR2_TARGET_ROOTFS_EXT2_BLOCKS
 	int "exact size in blocks has been removed"
 	default 0
diff --git a/DEVELOPERS b/DEVELOPERS
index 209491aef7..4faa1a8b2e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1783,7 +1783,6 @@ F:	package/libiscsi/
 F:	package/libseccomp/
 F:	package/linux-tools/
 F:	package/mesa3d-headers/
-F:	package/mke2img/
 F:	package/nbd/
 F:	package/nut/
 F:	package/nvidia-driver/
diff --git a/package/Config.in.host b/package/Config.in.host
index 0932b9f1f9..c5a852b858 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -24,7 +24,6 @@ menu "Host utilities"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
 	source "package/mfgtools/Config.in.host"
-	source "package/mke2img/Config.in.host"
 	source "package/mkpasswd/Config.in.host"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
diff --git a/package/mke2img/Config.in.host b/package/mke2img/Config.in.host
deleted file mode 100644
index b5bcb8455f..0000000000
--- a/package/mke2img/Config.in.host
+++ /dev/null
@@ -1,11 +0,0 @@
-config BR2_PACKAGE_HOST_MKE2IMG
-	bool "host mke2img"
-	select BR2_PACKAGE_HOST_E2FSPROGS
-	select BR2_PACKAGE_HOST_GENEXT2FS
-	help
-	  Easily create filesystems of the extend familly: ext2/3/4.
-
-	  This tool is bundled by, and specific to Buildroot. However, it can
-	  be used from post-images scripts is needed.
-
-	  https://code.google.com/p/mke2img/
diff --git a/package/mke2img/mke2img b/package/mke2img/mke2img
deleted file mode 100755
index 399012a2be..0000000000
--- a/package/mke2img/mke2img
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/usr/bin/env bash
-
-# Buildroot wrapper to the collection of ext2/3/4 filesystem tools:
-# - genext2fs, to generate ext2 filesystem images
-# - tune2fs, to modify an ext2/3/4 filesystem (possibly in an image file)
-# - e2fsck, to check and fix an ext2/3/4 filesystem (possibly in an image file)
-
-set -e
-
-main() {
-    local OPT OPTARG
-    local nb_blocks nb_inodes nb_res_blocks root_dir image gen rev label uuid
-    local -a genext2fs_opts
-    local -a tune2fs_opts
-    local tune2fs_O_opts
-
-    # Default values
-    gen=2
-    rev=1
-    nb_extra_inodes=0
-
-    while getopts :hB:b:i:I:r:d:o:G:R:l:u: OPT; do
-        case "${OPT}" in
-        h)  help; exit 0;;
-        B)  block_size="${OPTARG}";;
-        b)  nb_blocks=${OPTARG};;
-        i)  nb_inodes=${OPTARG};;
-        I)  nb_extra_inodes=${OPTARG};;
-        r)  nb_res_blocks=${OPTARG};;
-        d)  root_dir="${OPTARG}";;
-        o)  image="${OPTARG}";;
-        G)  gen=${OPTARG};;
-        R)  rev=${OPTARG};;
-        l)  label="${OPTARG}";;
-        u)  uuid="${OPTARG}";;
-        :)  error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
-        \?) error "unknown option '%s'\n" "${OPTARG}";;
-        esac
-    done
-
-    # Sanity checks
-    if [ -z "${root_dir}" ]; then
-        error "you must specify a root directory with '-d'\n"
-    fi
-    if [ -z "${image}" ]; then
-        error "you must specify an output image file with '-o'\n"
-    fi
-    if [ -z "${nb_blocks}" ]; then
-        error "you must specify the size of the output image with '-b'\n"
-    fi
-    case "${block_size}" in
-    1024|2048|4096) ;; # Sole valid values
-    '') error "you must specify the size of a block with -B\n";;
-    *)  error "invalid block size '%s' (valid: 1024. 2048, 4096)\n" "${block_size}";;
-    esac
-    case "${gen}:${rev}" in
-    2:0|2:1|3:1|4:1)
-        ;;
-    3:0|4:0)
-        error "revision 0 is invalid for ext3 and ext4\n"
-        ;;
-    *)  error "unknown ext generation '%s' and/or revision '%s'\n" \
-               "${gen}" "${rev}"
-        ;;
-    esac
-
-    # calculate needed inodes
-    if [ ${nb_inodes:-0} -eq 0 ]; then
-        nb_inodes=$(find "${root_dir}" | wc -l)
-        nb_inodes=$((nb_inodes+400))
-    fi
-    nb_inodes=$((nb_inodes+nb_extra_inodes))
-
-    # Upgrade to rev1 if needed
-    if [ ${rev} -ge 1 ]; then
-        tune2fs_O_opts+=",filetype,sparse_super"
-    fi
-
-    # Add a journal for ext3 and above
-    if [ ${gen} -ge 3 ]; then
-        tune2fs_opts+=( -j -J size=1 )
-    fi
-
-    # Add ext4 specific features
-    if [ ${gen} -ge 4 ]; then
-        tune2fs_O_opts+=",extents,uninit_bg,dir_index"
-    fi
-
-    # Add our -O options (there will be at most one leading comma, remove it)
-    if [ -n "${tune2fs_O_opts}" ]; then
-        tune2fs_opts+=( -O "${tune2fs_O_opts#,}" )
-    fi
-
-    # Add the label if specified
-    if [ -n "${label}" ]; then
-        tune2fs_opts+=( -L "${label}" )
-    fi
-
-    # Generate the filesystem
-    genext2fs_opts=( -z -B ${block_size} -b ${nb_blocks} -N ${nb_inodes} -d "${root_dir}" )
-    if [ -n "${nb_res_blocks}" ]; then
-        genext2fs_opts+=( -m ${nb_res_blocks} )
-    fi
-    genext2fs "${genext2fs_opts[@]}" "${image}"
-
-    # genext2fs does not generate a UUID, but fsck will whine if one
-    # is missing, so we need to add a UUID.
-    # Of course, this has to happen _before_ we run fsck.
-    # Also, some ext4 metadata are based on the UUID, so we must
-    # set it before we can convert the filesystem to ext4.
-    # If the user did not specify a UUID, we generate a random one.
-    # Although a random UUID may seem bad for reproducibility, there
-    # already are so many things that are not reproducible in a
-    # filesystem: file dates, file ordering, content of the files...
-    tune2fs -U "${uuid:-random}" "${image}"
-
-    # Upgrade the filesystem
-    if [ ${#tune2fs_opts[@]} -ne 0 ]; then
-        tune2fs "${tune2fs_opts[@]}" "${image}"
-    fi
-
-    # After changing filesystem options, running fsck is required
-    # (see: man tune2fs). Running e2fsck in other cases will ensure
-    # coherency of the filesystem, although it is not required.
-    # 'e2fsck -pDf' means:
-    #  - automatically repair
-    #  - optimise and check for duplicate entries
-    #  - force checking
-    # Sending output to oblivion, as e2fsck can be *very* verbose,
-    # especially with filesystems generated by genext2fs.
-    # Exit codes 1 & 2 are OK, it means fs errors were successfully
-    # corrected, hence our little trick with $ret.
-    ret=0
-    e2fsck -pDf "${image}" >/dev/null || ret=$?
-    case ${ret} in
-       0|1|2) ;;
-       *)   errorN ${ret} "failed to run e2fsck on '%s' (ext%d)\n" \
-                   "${image}" ${gen}
-    esac
-    printf "\n"
-    trace "e2fsck was successfully run on '%s' (ext%d)\n" "${image}" ${gen}
-    printf "\n"
-
-    # Remove count- and time-based checks, they are not welcome
-    # on embedded devices, where they can cause serious boot-time
-    # issues by tremendously slowing down the boot.
-    tune2fs -c 0 -i 0 "${image}"
-}
-
-help() {
-    cat <<_EOF_
-NAME
-    ${my_name} - Create an ext2/3/4 filesystem image
-
-SYNOPSIS
-    ${my_name} [OPTION]...
-
-DESCRIPTION
-    Create ext2/3/4 filesystem image from the content of a directory.
-
-    -b BLOCKS
-        Create a filesystem of BLOCKS 1024-byte blocs. The default is to
-        compute the required number of blocks.
-
-    -i INODES
-        Create a filesystem with INODES inodes. The default is to compute
-        the required number of inodes.
-
-    -r RES_BLOCKS
-        Create a filesystem with RES_BLOCKS reserved blocks. The default
-        is to reserve 0 block.
-
-    -d ROOT_DIR
-        Create a filesystem, using the content of ROOT_DIR as the content
-        of the root of the filesystem. Mandatory.
-
-    -o FILE
-        Create the filesystem in FILE. Madatory.
-
-    -G GEN -R REV
-        Create a filesystem of generation GEN (2, 3 or 4), and revision
-        REV (0 or 1). The default is to generate an ext2 revision 1
-        filesystem; revision 0 is invalid for ext3 and ext4.
-
-    -l LABEL
-        Create a filesystem with label LABEL. The default is to not set
-        a label.
-
-    -u UUID
-        Create filesystem with uuid UUID. The default is to set a random
-        UUID.
-
-  Exit status:
-    0   if OK
-    !0  in case of error
-_EOF_
-}
-
-trace()  { local msg="${1}"; shift; printf "%s: ${msg}" "${my_name}" "${@}"; }
-warn()   { trace "${@}" >&2; }
-errorN() { local ret="${1}"; shift; warn "${@}"; exit ${ret}; }
-error()  { errorN 1 "${@}"; }
-
-my_name="${0##*/}"
-main "$@"
diff --git a/package/mke2img/mke2img.mk b/package/mke2img/mke2img.mk
deleted file mode 100644
index 9de387a3a3..0000000000
--- a/package/mke2img/mke2img.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-#
-# mke2img
-#
-################################################################################
-
-HOST_MKE2IMG_DEPENDENCIES = host-genext2fs host-e2fsprogs
-
-define HOST_MKE2IMG_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 package/mke2img/mke2img $(HOST_DIR)/usr/bin/mke2img
-endef
-
-$(eval $(host-generic-package))
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option Samuel Martin
@ 2017-07-04 17:01   ` Arnout Vandecappelle
  2017-07-04 22:40   ` Thomas Petazzoni
  1 sibling, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 17:01 UTC (permalink / raw)
  To: buildroot



On 04-07-17 16:47, Samuel Martin wrote:
> Soon, the ext{2,3,4} rootfs image will no longer be generated with
> genext2fs, but using mke2fs instead which has no support for the extra
> inode number option.
> 
> So, deprecate the BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option and
> recommend, in lieu, to set the total inode number, taking account of
> the extra ones if needed.
> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> Cc: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> 
> ---
> changes v4->v5:
> - reword legacy option help text (Arnout)
> 
> changes v3->v4:
> - rename deprecate prompt in Config.in.legacy (Arnout)
> - introduce a _WRAP symbol to actually select BR2_LEGACY when needed
>   (Arnout)
> 
> changes v2->v3:
> - new patch (Yann)
> ---
>  Config.in.legacy  | 15 +++++++++++++++
>  fs/ext2/Config.in |  8 --------
>  fs/ext2/ext2.mk   |  1 -
>  3 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/Config.in.legacy b/Config.in.legacy
> index 453c5eb8b8..8ea468b64a 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -145,6 +145,21 @@ endif
>  ###############################################################################
>  comment "Legacy options removed in 2017.08"
>  
> +config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES
> +	int "ext2 extra inodes has been removed" if BR2_TARGET_ROOTFS_EXT2_INODES = 0
> +	default 0
> +	help
> +	  Buildroot now uses mkfs.ext2/3/4 to generate ext2/3/4 images. It
> +	  now automatically selects the number of inodes based on the image
> +	  size. The extra number of inodes can no longer be provided; instead,
> +	  provide the total number of inodes needed in
> +	  BR2_TARGET_ROOTFS_EXT2_INODES.
> +
> +config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES_WRAP
> +	bool
> +	default y if BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES != 0
> +	select BR2_LEGACY
> +
>  config BR2_STRIP_none
>  	bool "Strip command 'none' has been removed"
>  	select BR2_LEGACY
> diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
> index 6f16dde17f..ec1b5f2c55 100644
> --- a/fs/ext2/Config.in
> +++ b/fs/ext2/Config.in
> @@ -55,14 +55,6 @@ config BR2_TARGET_ROOTFS_EXT2_INODES
>  	int "exact number of inodes (leave at 0 for auto calculation)"
>  	default 0
>  
> -config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES
> -	int "extra inodes" if BR2_TARGET_ROOTFS_EXT2_INODES = 0
> -	default 0
> -	help
> -	  Enter here the number of extra free inodes you want on
> -	  your filesystem. By default, Buildroot will not leave
> -	  many free inodes.
> -
>  config BR2_TARGET_ROOTFS_EXT2_RESBLKS
>  	int "reserved blocks percentage"
>  	default 5
> diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
> index 0d5fc7f118..8a648dd66c 100644
> --- a/fs/ext2/ext2.mk
> +++ b/fs/ext2/ext2.mk
> @@ -15,7 +15,6 @@ EXT2_OPTS = \
>  	-B 1024 \
>  	-b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) \
>  	-i $(BR2_TARGET_ROOTFS_EXT2_INODES) \
> -	-I $(BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES) \
>  	-r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
>  	-l "$(EXT2_LABEL)"
>  
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image Samuel Martin
@ 2017-07-04 17:12   ` Arnout Vandecappelle
  2017-07-04 22:41   ` Thomas Petazzoni
  1 sibling, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 17:12 UTC (permalink / raw)
  To: buildroot



On 04-07-17 16:47, Samuel Martin wrote:
> From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> 
> mkfs is now capable of generating rootfs images. Use mkfs instead of
> genext2fs.
> 
> If not set, we now let mkfs calculate the block size and the number of
> inodes needed.
> 
> This change also adjusts the options to meet those of mkfs.
> 
> Notes:
> * Passing a null inode number to mkfs triggers its automatic calculation.
> * Passing a fs-size with no unit suffix to mkfs is interpreted as using
>   1K block size.
> 
> 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>
> 
> ---
> changes v4->v5:
> - remove BR2_TARGET_ROOTFS_EXT2_BLOCKS renaming
> - update commit log
> 
> changes v3->v4:
> - disable the size check when ext* rootfs is disabled
> - remove unneeded comment
> - introduce a _WRAP symbol to actually select BR2_LEGACY when needed
>   (Arnout)
> 
> changes v2->v3:
> - reword commit log
> 
> changes v1->v2:
> - rebase
> - add default size value
> ---
>  fs/ext2/Config.in |  2 +-
>  fs/ext2/ext2.mk   | 18 +++++++++---------
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
> index ec1b5f2c55..9c58ac62ed 100644
> --- a/fs/ext2/Config.in
> +++ b/fs/ext2/Config.in
> @@ -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
>  
> diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
> index 8a648dd66c..bff442ff18 100644
> --- a/fs/ext2/ext2.mk
> +++ b/fs/ext2/ext2.mk
> @@ -10,18 +10,18 @@ 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 1024 \
> -	-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) \
> +	-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) $@ \

 Now that we call mkfs.ext2 directly, we don't need to pass the updated PATH
anymore (mkfs.ext2 doesn't call out to anything else). So instead we could call
$(HOST_DIR)/usr/bin/mkfs.extN.

 But that could be fixed up later, so

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> +		 $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
>  endef
>  
>  rootfs-ext2-symlink:
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE Samuel Martin
@ 2017-07-04 17:28   ` Arnout Vandecappelle
  2017-07-04 23:39   ` Peter Korsgaard
  1 sibling, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 17:28 UTC (permalink / raw)
  To: buildroot



On 04-07-17 16:47, Samuel Martin wrote:
> 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.

 So I tried this and it is in fact very annoying that it changes. Anyone who was
using ext2 will be hit by this legacy stuff...


> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> 
> ---
> changes v4->v5:
> - new patch (Arnout)
> ---
>  Config.in.legacy                            | 11 +++++++++++
>  configs/at91sam9x5ek_mmc_dev_defconfig      |  2 +-
>  configs/beaglebone_qt5_defconfig            |  2 +-
>  configs/firefly_rk3288_demo_defconfig       |  2 +-
>  configs/minnowboard_max-graphical_defconfig |  2 +-
>  configs/nanopi_neo_defconfig                |  2 +-
>  configs/pc_x86_64_bios_defconfig            |  2 +-
>  configs/pc_x86_64_efi_defconfig             |  2 +-
>  configs/raspberrypi3_64_defconfig           |  2 +-
>  fs/ext2/Config.in                           | 13 ++++++++-----
>  fs/ext2/ext2.mk                             |  8 ++++++--
>  11 files changed, 33 insertions(+), 15 deletions(-)
> 
> diff --git a/Config.in.legacy b/Config.in.legacy
> index 8ea468b64a..a26869ac64 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -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.

 Add:
	  It has been set automatically to the value you had before.

> +
> +config BR2_TARGET_ROOTFS_EXT2_BLOCKS_WRAP
> +	bool
> +	default y if BR2_TARGET_ROOTFS_EXT2_BLOCKS != 0

 So this will hit legacy handling for anyone using the default value in 2017.05,
because there the default is 61440. And if we change it into != 61440, then it
will hit anyone who upgrades from <2017.05. And if we add || != 61440, it will
still hit anyone who changed the default.

 So@the very least we should add || != 61440 so anyone who was using the
default before will not get hit by legacy.

 Ideally we don't change the symbol name but then we can't change it from int to
string. So I guess we'll have to do this after all :-(



> +	select BR2_LEGACY
> +

 Add a comment that fs/ext2/Config.in refers this symbol.

>  config BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES
>  	int "ext2 extra inodes has been removed" if BR2_TARGET_ROOTFS_EXT2_INODES = 0
>  	default 0
> diff --git a/configs/at91sam9x5ek_mmc_dev_defconfig b/configs/at91sam9x5ek_mmc_dev_defconfig
> index 0060111fca..1bf2983ee7 100644
> --- a/configs/at91sam9x5ek_mmc_dev_defconfig
> +++ b/configs/at91sam9x5ek_mmc_dev_defconfig
> @@ -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="120000K"

 While you're at it, make it 120M instead. Not exactly the same but it's larger
so should be OK.

[snip]
> diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
> index 9c58ac62ed..b2363940f0 100644
> --- a/fs/ext2/Config.in
> +++ b/fs/ext2/Config.in
> @@ -44,12 +44,15 @@ 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 != 0 # legacy 2017.08

 Make it instead "if BR2_TARGET_ROOTFS_EXT2_BLOCKS_WRAP" - simpler.

> +	default "61440K" # default size

 Use "60M" instead.

>  	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 bff442ff18..c8da9c4451 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_EXT)-$(EXT2_SIZE),y-)
                                ^2

> +$(error BR2_TARGET_ROOTFS_EXT2_SIZE cannot be empty)

 I wonder if it makes sense to check this explicitly. There are thousands of
ways it can be wrong, empty is just one of them. If it is empty, mke2fs will
complain that the argument is missing.

> +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))
> @@ -20,8 +25,7 @@ ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
>  
>  define ROOTFS_EXT2_CMD
>  	rm -f $@
> -	PATH=$(BR_PATH) mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ \
> -		 $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
> +	PATH=$(BR_PATH) mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ $(EXT2_SIZE)

 Put quotes around EXT2_SIZE - a user may have added spaces there (which will
never work, but better let mke2fs give the appropriate error message).

 Regards,
 Arnout

>  endef
>  
>  rootfs-ext2-symlink:
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 4/5] fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 4/5] fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option Samuel Martin
@ 2017-07-04 17:39   ` Arnout Vandecappelle
  2017-07-05 12:08     ` Sébastien Szymanski
  0 siblings, 1 reply; 15+ messages in thread
From: Arnout Vandecappelle @ 2017-07-04 17:39 UTC (permalink / raw)
  To: buildroot



On 04-07-17 16:47, Samuel Martin wrote:
> From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> 
> 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>
> 
> ---
> changes v4->v5:
> - turn the options to accept any mke2fs options, not only ext2/3/4
>   features (Arnout)
> - add explaination for the default value for this new option (Arnout)
> 
> changes v3->v4:
> - none
> 
> changes v2->v3:
> - none
> 
> changes v1->v2:
> - rebase
> ---
>  fs/ext2/Config.in | 17 +++++++++++++++++
>  fs/ext2/ext2.mk   |  5 ++++-
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
> index b2363940f0..9bbeb797a5 100644
> --- a/fs/ext2/Config.in
> +++ b/fs/ext2/Config.in
> @@ -67,6 +67,23 @@ config BR2_TARGET_ROOTFS_EXT2_RESBLKS
>  	  Traditionally, this has been 5%, and all ext-related tools still
>  	  default to reserving 5% when creating a new ext filesystem.
>  
> +config BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS
> +	string "additional mke2fs options"
> +	default "-O ^64bit"
> +	help
> +	  Specify a space-separated list of mke2fs options, including any
> +	  ext2/3/4 filesystem features.
> +
> +	  For more information about the mke2fs option, see the manual page

 Lines should be wrapped at 72 columns, where tab counts for 8, so 62
significant characters.

> +	  mke2fs(8).
> +
> +	  For more information about the ext2/3/4 features which can be set,
> +	  see then manual page ext4(5).
> +
> +	  The defaults disables the 64bit ext2/3/4 filesystem support since
> +	  its has been enable lately in 2017 in uboot, so most of the uboot
> +	  versions do not support it yet.

 Replace:
	  The default is "-O ^64bit", i.e. disable the 64-bit filesystem.
	  This is chosen because U-Boot versions before 2017.02 don't
	  support that filesystem option, which may render the system
	  unbootable if it is used.

 BTW, on reading the ext4 man page, I doubt this is needed at all:

       64bit
              Enables the file system to be larger than 2^32 blocks.  This
feature is set automatically, as needed, but it can be  useful  to  specify
this  feature explicitly  if the file system might need to be resized larger
than 2^32 blocks, even if it was smaller than that threshold when it was
originally created.  Note that some older kernels and older versions of
e2fsprogs will not support file systems with this ext4 feature enabled.

In other words, unless you create a filesystem larger than 4TB, this option
wouldn't be set anyway...

 But OK, it doesn't hurt to have this default I guess.

 S?bastien, could you comment?


 Regards,
 Arnout


> +
>  choice
>  	prompt "Compression method"
>  	default BR2_TARGET_ROOTFS_EXT2_NONE
> diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
> index c8da9c4451..a4c4a7b3d3 100644
> --- a/fs/ext2/ext2.mk
> +++ b/fs/ext2/ext2.mk
> @@ -9,6 +9,8 @@ ifeq ($(BR2_TARGET_ROOTFS_EXT)-$(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))
> @@ -19,7 +21,8 @@ EXT2_OPTS = \
>  	-r $(BR2_TARGET_ROOTFS_EXT2_REV) \
>  	-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
>  	-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
> -	-L "$(EXT2_LABEL)"
> +	-L "$(EXT2_LABEL)" \
> +	$(EXT2_MKFS_OPTS)
>  
>  ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
>  
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option Samuel Martin
  2017-07-04 17:01   ` Arnout Vandecappelle
@ 2017-07-04 22:40   ` Thomas Petazzoni
  1 sibling, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2017-07-04 22:40 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue,  4 Jul 2017 16:47:25 +0200, Samuel Martin wrote:
> Soon, the ext{2,3,4} rootfs image will no longer be generated with
> genext2fs, but using mke2fs instead which has no support for the extra
> inode number option.
> 
> So, deprecate the BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option and
> recommend, in lieu, to set the total inode number, taking account of
> the extra ones if needed.
> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> Cc: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> ---
> changes v4->v5:
> - reword legacy option help text (Arnout)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image Samuel Martin
  2017-07-04 17:12   ` Arnout Vandecappelle
@ 2017-07-04 22:41   ` Thomas Petazzoni
  1 sibling, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2017-07-04 22:41 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue,  4 Jul 2017 16:47:26 +0200, Samuel Martin wrote:
> From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> 
> mkfs is now capable of generating rootfs images. Use mkfs instead of
> genext2fs.
> 
> If not set, we now let mkfs calculate the block size and the number of
> inodes needed.
> 
> This change also adjusts the options to meet those of mkfs.
> 
> Notes:
> * Passing a null inode number to mkfs triggers its automatic calculation.
> * Passing a fs-size with no unit suffix to mkfs is interpreted as using
>   1K block size.
> 
> 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>
> 
> ---
> changes v4->v5:
> - remove BR2_TARGET_ROOTFS_EXT2_BLOCKS renaming
> - update commit log

I've made the minor improvement suggested by Arnout: passing
PATH=$(BR_PATH) is no longer needed, and instead mkfs.ext is called
directly using its $(HOST_DIR)/usr/sbin/ path.

Applied to master with this change. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 5/5] package/mke2img: remove package
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 5/5] package/mke2img: remove package Samuel Martin
@ 2017-07-04 22:55   ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2017-07-04 22:55 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue,  4 Jul 2017 16:47:29 +0200, Samuel Martin wrote:
> From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> 
> Now that we use mkfs to generate ext2/3/4 filesystem image by calling
> mkfs directly from fs/ext2/ext2.mk, we can remove this package.
> 
> 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>
> 
> ---
> changes v4->v5:
> - none

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE
  2017-07-04 14:47 ` [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE Samuel Martin
  2017-07-04 17:28   ` Arnout Vandecappelle
@ 2017-07-04 23:39   ` Peter Korsgaard
  1 sibling, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2017-07-04 23:39 UTC (permalink / raw)
  To: buildroot

>>>>> "Samuel" == Samuel Martin <s.martin49@gmail.com> writes:

 > 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).

 > +++ b/fs/ext2/ext2.mk
 > @@ -4,6 +4,11 @@
 >  #
 >  ################################################################################
 
 > +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

Hmm, shouldn't that be BR2_TARGET_ROOTFS_EXT2 instead of
BR2_TARGET_ROOTFS_EXT?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v5 4/5] fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option
  2017-07-04 17:39   ` Arnout Vandecappelle
@ 2017-07-05 12:08     ` Sébastien Szymanski
  0 siblings, 0 replies; 15+ messages in thread
From: Sébastien Szymanski @ 2017-07-05 12:08 UTC (permalink / raw)
  To: buildroot

Hi,

On 07/04/2017 07:39 PM, Arnout Vandecappelle wrote:
> 
> 
> On 04-07-17 16:47, Samuel Martin wrote:
>> From: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
>>
>> 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>
>>
>> ---
>> changes v4->v5:
>> - turn the options to accept any mke2fs options, not only ext2/3/4
>>   features (Arnout)
>> - add explaination for the default value for this new option (Arnout)
>>
>> changes v3->v4:
>> - none
>>
>> changes v2->v3:
>> - none
>>
>> changes v1->v2:
>> - rebase
>> ---
>>  fs/ext2/Config.in | 17 +++++++++++++++++
>>  fs/ext2/ext2.mk   |  5 ++++-
>>  2 files changed, 21 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
>> index b2363940f0..9bbeb797a5 100644
>> --- a/fs/ext2/Config.in
>> +++ b/fs/ext2/Config.in
>> @@ -67,6 +67,23 @@ config BR2_TARGET_ROOTFS_EXT2_RESBLKS
>>  	  Traditionally, this has been 5%, and all ext-related tools still
>>  	  default to reserving 5% when creating a new ext filesystem.
>>  
>> +config BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS
>> +	string "additional mke2fs options"
>> +	default "-O ^64bit"
>> +	help
>> +	  Specify a space-separated list of mke2fs options, including any
>> +	  ext2/3/4 filesystem features.
>> +
>> +	  For more information about the mke2fs option, see the manual page
> 
>  Lines should be wrapped at 72 columns, where tab counts for 8, so 62
> significant characters.
> 
>> +	  mke2fs(8).
>> +
>> +	  For more information about the ext2/3/4 features which can be set,
>> +	  see then manual page ext4(5).
>> +
>> +	  The defaults disables the 64bit ext2/3/4 filesystem support since
>> +	  its has been enable lately in 2017 in uboot, so most of the uboot
>> +	  versions do not support it yet.
> 
>  Replace:
> 	  The default is "-O ^64bit", i.e. disable the 64-bit filesystem.
> 	  This is chosen because U-Boot versions before 2017.02 don't
> 	  support that filesystem option, which may render the system
> 	  unbootable if it is used.
> 
>  BTW, on reading the ext4 man page, I doubt this is needed at all:
> 
>        64bit
>               Enables the file system to be larger than 2^32 blocks.  This
> feature is set automatically, as needed, but it can be  useful  to  specify
> this  feature explicitly  if the file system might need to be resized larger
> than 2^32 blocks, even if it was smaller than that threshold when it was
> originally created.  Note that some older kernels and older versions of
> e2fsprogs will not support file systems with this ext4 feature enabled.
> 
> In other words, unless you create a filesystem larger than 4TB, this option
> wouldn't be set anyway...
> 
>  But OK, it doesn't hurt to have this default I guess.
> 
>  S?bastien, could you comment?

Since e2fsprogs 1.43 [1], the 64bit feature is enabled by default.

[1] http://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.43

"Mke2fs will now create file systems with the metadata_csum and 64bit
features enabled by default."

Regards,

> 
> 
>  Regards,
>  Arnout
> 
> 
>> +
>>  choice
>>  	prompt "Compression method"
>>  	default BR2_TARGET_ROOTFS_EXT2_NONE
>> diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
>> index c8da9c4451..a4c4a7b3d3 100644
>> --- a/fs/ext2/ext2.mk
>> +++ b/fs/ext2/ext2.mk
>> @@ -9,6 +9,8 @@ ifeq ($(BR2_TARGET_ROOTFS_EXT)-$(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))
>> @@ -19,7 +21,8 @@ EXT2_OPTS = \
>>  	-r $(BR2_TARGET_ROOTFS_EXT2_REV) \
>>  	-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
>>  	-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
>> -	-L "$(EXT2_LABEL)"
>> +	-L "$(EXT2_LABEL)" \
>> +	$(EXT2_MKFS_OPTS)
>>  
>>  ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
>>  
>>
> 


-- 
S?bastien Szymanski
Software engineer, Armadeus Systems
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-07-05 12:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-04 14:47 [Buildroot] [PATCH v5 0/5] fs/ext2: cleanup and improvement Samuel Martin
2017-07-04 14:47 ` [Buildroot] [PATCH v5 1/5] fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option Samuel Martin
2017-07-04 17:01   ` Arnout Vandecappelle
2017-07-04 22:40   ` Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH v5 2/5] fs/ext2: use mkfs to generate rootfs image Samuel Martin
2017-07-04 17:12   ` Arnout Vandecappelle
2017-07-04 22:41   ` Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH v5 3/5] fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS -> BR2_TARGET_ROOTFS_EXT2_SIZE Samuel Martin
2017-07-04 17:28   ` Arnout Vandecappelle
2017-07-04 23:39   ` Peter Korsgaard
2017-07-04 14:47 ` [Buildroot] [PATCH v5 4/5] fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS option Samuel Martin
2017-07-04 17:39   ` Arnout Vandecappelle
2017-07-05 12:08     ` Sébastien Szymanski
2017-07-04 14:47 ` [Buildroot] [PATCH v5 5/5] package/mke2img: remove package Samuel Martin
2017-07-04 22:55   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.