Skip to contentSkip to conversation

Pull request for branch yem-ext234

GIT PULL New Yann E. MORIN 3 participants 25 messages Mar 7, 2013 – Mar 17, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello All!

This patch series enhances the ext2 fs backend to also build ext3 and ext4 filesystems, and differentiate between ext2 rev0 and ext2 rev1 filesystems.

This patch series is based on the previously-sent 'yem-host-image-tools' pull-request, and requires changes in that series.

Changes v1 -> v2:
- enhance the ext2/3/4 generation (Arnout, Peter)
- allow fs generators to specify the image extension (Arnout)
- remove ext2 count- and time-based fsck (Arnout)

The following changes since commit 296699691239a90d5118c5cbe72f1ff57b3761a5:

package/mtools: new host-package (2013-03-07 00:29:51 +0100)

are available in the git repository at:
git://gitorious.org/buildroot/buildroot.git yem-ext234

Yann E. MORIN (6):
fs/ext2: enclose the ext2 options in if...endif fs/ext2: add ability to build ext3/4 too
fs: allow image generators to specify file-extension fs/ext2: use the ext2 variant to name the generated rootfs image fs/ext2: add support for ext2 rev0 and rev1
fs/ext2: remove count- and time-based fsck

 fs/common.mk                     |   17 ++++++--
 fs/ext2/Config.in                |   57 ++++++++++++++++++++++-----
 fs/ext2/ext2.mk                  |   10 ++++-
 fs/ext2/genext2fs.sh             |   77 +++++++++++++++++++++++++++++++++++++-
 package/e2fsprogs/Config.in.host |    2 +-
 5 files changed, 144 insertions(+), 19 deletions(-)

Regards,
Yann E. MORIN

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/6 fs/ext2: enclose the ext2 options in if...endif

Use a 'if...endif' construct instead of repeating the 'depends on' for each symbols.

---
 fs/ext2/Config.in |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
fs/ext2/Config.in +3 -4
index 2af44a8..cb4beed 100644
@@ -3,25 +3,23 @@ config BR2_TARGET_ROOTFS_EXT2
 	help
 	  Build an ext2 root filesystem
 
+if BR2_TARGET_ROOTFS_EXT2
+
 config BR2_TARGET_ROOTFS_EXT2_BLOCKS
 	int "size in blocks (leave at 0 for auto calculation)"
-	depends on BR2_TARGET_ROOTFS_EXT2
 	default 0
 
 config BR2_TARGET_ROOTFS_EXT2_INODES
 	int "inodes (leave at 0 for auto calculation)"
-	depends on BR2_TARGET_ROOTFS_EXT2
 	default 0
 
 config BR2_TARGET_ROOTFS_EXT2_RESBLKS
 	int "reserved blocks percentage"
-	depends on BR2_TARGET_ROOTFS_EXT2
 	default 0
 
 choice
 	prompt "Compression method"
 	default BR2_TARGET_ROOTFS_EXT2_NONE
-	depends on BR2_TARGET_ROOTFS_EXT2
 	help
 	  Select compressor for ext2 filesystem of the root filesystem
 
@@ -47,3 +45,4 @@ config BR2_TARGET_ROOTFS_EXT2_LZMA
 
 endchoice
 
+endif # BR2_TARGET_ROOTFS_EXT2
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 1/6 fs/ext2: enclose the ext2 options in if...endif

Dear Yann E. MORIN,

Quoted 5 lines · Yann E. MORIN

Use a 'if...endif' construct instead of repeating the 'depends on' for each symbols.

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

In reply to Yann E. MORIN

Use the host-e2fsprogs to tune2fs the generated rootfs.ext2 image, and upgrade it to either one of ext2, ext3 or ext4.

Since calling tune2fs may require running e2fsck (tune2fs will warn to do so when certain FS options are changed), we systematically call e2fsck. This makes the code path simpler, and as a side-effect checks that genext2fs did not generate garbage.

In turn, e2fsck will unconditionally add a UUID to the filesystem, which is bad for reproducibility, so we call tune2fs again to remove the UUID. This does not require checking the filesystem.

To ensure compatibility of Buildroot's .config, leave ext2 as the default. Boards' .config can override this at will.

Cc Arnout Vandecappelle <[email protected]>
Cc Peter Korsgaard <[email protected]>

---
Changes v1->v2: (all after comments by Arnout)
- menuconfig prompt rework (& Peter)
- cleanup ext2.mk
- use environment to pass ext generation/variant
- add rational for 1081 additional blocks
- explain the reason we run e2fsck

---
 fs/ext2/Config.in                |   36 ++++++++++++++++----
 fs/ext2/ext2.mk                  |    7 +++-
 fs/ext2/genext2fs.sh             |   70 +++++++++++++++++++++++++++++++++++++-
 package/e2fsprogs/Config.in.host |    2 +-
 4 files changed, 105 insertions(+), 10 deletions(-)
fs/ext2/Config.in +29 -7
index cb4beed..c8320e2 100644
@@ -1,10 +1,32 @@
 config BR2_TARGET_ROOTFS_EXT2
-	bool "ext2 root filesystem"
+	bool "ext2/3/4 root filesystem"
+	select BR2_PACKAGE_HOST_E2FSPROGS
 	help
-	  Build an ext2 root filesystem
+	  Build an ext2/3/4 root filesystem
 
 if BR2_TARGET_ROOTFS_EXT2
 
+choice
+	bool "ext2/3/4 variant"
+	default BR2_TARGET_ROOTFS_EXT2_2
+
+config BR2_TARGET_ROOTFS_EXT2_2
+	bool "ext2"
+
+config BR2_TARGET_ROOTFS_EXT2_3
+	bool "ext3"
+
+config BR2_TARGET_ROOTFS_EXT2_4
+	bool "ext4"
+
+endchoice
+
+config BR2_TARGET_ROOTFS_EXT2_GEN
+	int
+	default 2 if BR2_TARGET_ROOTFS_EXT2_2
+	default 3 if BR2_TARGET_ROOTFS_EXT2_3
+	default 4 if BR2_TARGET_ROOTFS_EXT2_4
+
 config BR2_TARGET_ROOTFS_EXT2_BLOCKS
 	int "size in blocks (leave at 0 for auto calculation)"
 	default 0
@@ -21,27 +43,27 @@ choice
 	prompt "Compression method"
 	default BR2_TARGET_ROOTFS_EXT2_NONE
 	help
-	  Select compressor for ext2 filesystem of the root filesystem
+	  Select compressor for ext2/3/4 filesystem of the root filesystem
 
 config BR2_TARGET_ROOTFS_EXT2_NONE
 	bool "no compression"
 	help
-	  Do not compress the ext2 filesystem.
+	  Do not compress the ext2/3/4 filesystem.
 
 config BR2_TARGET_ROOTFS_EXT2_GZIP
 	bool "gzip"
 	help
-	  Do compress the ext2 filesystem with gzip.
+	  Do compress the ext2/3/4 filesystem with gzip.
 
 config BR2_TARGET_ROOTFS_EXT2_BZIP2
 	bool "bzip2"
 	help
-	  Do compress the ext2 filesystem with bzip2.
+	  Do compress the ext2/3/4 filesystem with bzip2.
 
 config BR2_TARGET_ROOTFS_EXT2_LZMA
 	bool "lzma"
 	help
-	  Do compress the ext2 filesystem with lzma.
+	  Do compress the ext2/3/4 filesystem with lzma.
 
 endchoice
 
fs/ext2/ext2.mk +6 -1
index 7b71592..1660d9c 100644
@@ -19,9 +19,14 @@ EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
 endif
 
 ROOTFS_EXT2_DEPENDENCIES = host-genext2fs
+ifeq ($(BR2_PACKAGE_HOST_E2FSPROGS),y)
+ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
+endif
+
+EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN)
 
 define ROOTFS_EXT2_CMD
-	PATH=$(TARGET_PATH) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
+	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
 endef
 
 $(eval $(call ROOTFS_TARGET,ext2))
fs/ext2/genext2fs.sh +69 -1

92 lines not on this page · raw message

package/e2fsprogs/Config.in.host +1 -1
index ea6a0bd..0c001c2 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_HOST_E2FSPROGS
 	bool "host e2fsprogs"
 	help
-	  The EXT2 file system utilities.
+	  The EXT2/3/4 file system utilities.
 	  
 	  http://e2fsprogs.sf.net
Signature · 1 line
1.7.2.5
#4 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

Dear Yann E. MORIN,

fs/ext2/ext2.mk EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) · line 24

Quoted 4 lines · Yann E. MORIN

ROOTFS_EXT2_DEPENDENCIES = host-genext2fs

fs/ext2/ext2.mk +3 -0
+ifeq ($(BR2_PACKAGE_HOST_E2FSPROGS),y)
+ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
+endif

I believe the ifeq () here is useless: you are anyway selecting BR2_PACKAGE_HOST_E2FSPROGS from BR2_TARGET_ROOTFS_EXT2.

Initially, I was confused by this test: it would mean that you could potentially work without host-e2fsprogs, which isn't the case.

fs/ext2/ext2.mk EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) · line 30

Quoted 6 lines
fs/ext2/ext2.mk +2 -1
+EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN)
 
 define ROOTFS_EXT2_CMD
-	PATH=$(TARGET_PATH) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
+	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
 endef

Why PATH=$(TARGET_PATH) ? I know it was like this, but HOST_PATH would be more appropriate. That said, it's completely silly to have both TARGET_PATH and HOST_PATH, since they are essentially the same thing.

Also, why do you pass GEN= in the environment? Other options are passed through normal command line options, so it's strange to move away from this idea just for GEN=<foo>, no?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

Thomas, All,

Quoted 9 lines · On Sunday 10 March 2013 Thomas Petazzoni wrote:

fs/ext2/ext2.mk EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) · line 24

Quoted 4 lines · Yann E. MORIN

ROOTFS_EXT2_DEPENDENCIES = host-genext2fs

fs/ext2/ext2.mk +3 -0
+ifeq ($(BR2_PACKAGE_HOST_E2FSPROGS),y)
+ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
+endif

I believe the ifeq () here is useless: you are anyway selecting BR2_PACKAGE_HOST_E2FSPROGS from BR2_TARGET_ROOTFS_EXT2.

Oh, right, we just have to have an unconditional dependency.

Quoted 2 lines

Initially, I was confused by this test: it would mean that you could potentially work without host-e2fsprogs, which isn't the case.

That was just a remnant from when e2fsprogs was a dependency only for ext3 and ext4. Now, we need it for ext2, too.

Nice catch! :-)

Quoted 10 lines

fs/ext2/ext2.mk EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) · line 30

Quoted 6 lines
fs/ext2/ext2.mk +2 -1
+EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN)
 
 define ROOTFS_EXT2_CMD
-	PATH=$(TARGET_PATH) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
+	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
 endef

Why PATH=$(TARGET_PATH) ? I know it was like this, but HOST_PATH would be more appropriate. That said, it's completely silly to have both TARGET_PATH and HOST_PATH, since they are essentially the same thing.

Well, ask Peter! ;-)

    http://git.buildroot.org/buildroot/commit/fs/ext2/ext2.mk?id=fb951b9
Quoted 3 lines

Also, why do you pass GEN= in the environment? Other options are passed through normal command line options, so it's strange to move away from this idea just for GEN=<foo>, no?

That's what I initially did, but Arnout suggested to pass it in the env instead:

    http://lists.busybox.net/pipermail/buildroot/2013-February/067488.html
    http://lists.busybox.net/pipermail/buildroot/2013-February/067552.html

The problem I see with passing it as an option is that it is not a valid option for genext2fs, and it means we have to reconstruct the genext2fs options in the script, which is a bit ugly, as you can see in my previous submission.

But I do not have a strong opinion either...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

Dear Yann E. MORIN,

Quoted 11 lines · Yann E. MORIN
Quoted 10 lines

fs/ext2/ext2.mk EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) · line 30

Quoted 6 lines
fs/ext2/ext2.mk +2 -1
+EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN)
 
 define ROOTFS_EXT2_CMD
-	PATH=$(TARGET_PATH) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
+	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
 endef

Why PATH=$(TARGET_PATH) ? I know it was like this, but HOST_PATH would be more appropriate. That said, it's completely silly to have both TARGET_PATH and HOST_PATH, since they are essentially the same thing.

Quoted 2 lines

Well, ask Peter! ;-)

    http://git.buildroot.org/buildroot/commit/fs/ext2/ext2.mk?id=fb951b9

Huhu. We should probably have one single <something>_PATH variable, doesn't make much sense to have HOST_PATH and TARGET_PATH. But fair enough, that's another topic not related at all with the present patch set.

Quoted 6 lines
Quoted 3 lines

Also, why do you pass GEN= in the environment? Other options are passed through normal command line options, so it's strange to move away from this idea just for GEN=<foo>, no?

That's what I initially did, but Arnout suggested to pass it in the env instead:

Quoted 7 lines
    http://lists.busybox.net/pipermail/buildroot/2013-February/067488.html
    http://lists.busybox.net/pipermail/buildroot/2013-February/067552.html

The problem I see with passing it as an option is that it is not a valid option for genext2fs, and it means we have to reconstruct the genext2fs options in the script, which is a bit ugly, as you can see in my previous submission.

Ok, fair enough, I'm fine with the environment variable. Not entirely pretty, but the other option isn't either. So just let's go with the existing code.

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

In reply to Yann E. MORIN

Dear Yann E. MORIN,

fs/ext2/genext2fs.sh then · line 74

Quoted 2 lines · Yann E. MORIN
fs/ext2/genext2fs.sh +2 -0
+    # e2fsck will force a UUID, which we do not want
+    tune2fs -U clear "${IMG}"

I think you already explained that you're removing the UUID to make the filesystem creation reproducible (i.e avoid having random bits in the filesystem image). Even though I'm not it's entirely feasible (some binaries inside the filesystem may contain build dates and things like that), I think it's an interesting goal. So my only suggestion here would be to extend a bit your comment, to explain *why* you do not want this UUID.

Maybe we could set the volume name to 'buildroot' ? I.e:

	tune2fs -L buildroot "${IMG}"

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#8 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

Thomas, All,

Quoted 5 lines · On Sunday 10 March 2013 Thomas Petazzoni wrote:

fs/ext2/genext2fs.sh then · line 74

Quoted 2 lines · Yann E. MORIN
fs/ext2/genext2fs.sh +2 -0
+    # e2fsck will force a UUID, which we do not want
+    tune2fs -U clear "${IMG}"
Quoted 7 lines

I think you already explained that you're removing the UUID to make the filesystem creation reproducible (i.e avoid having random bits in the filesystem image). Even though I'm not it's entirely feasible (some binaries inside the filesystem may contain build dates and things like that), I think it's an interesting goal. So my only suggestion here would be to extend a bit your comment, to explain *why* you do not want this UUID.

Yes, will do.

Quoted 3 lines

Maybe we could set the volume name to 'buildroot' ? I.e:

	tune2fs -L buildroot "${IMG}"

Good idea, too.

Thank you!

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

In reply to Thomas Petazzoni
Quoted 3 lines · Thomas Petazzoni

Maybe we could set the volume name to 'buildroot' ? I.e:

	tune2fs -L buildroot "${IMG}"

I don't particularly like that. If you're going to add volume names, it
should be configurable.

Regards,
Arnout

Signature · 6 lines
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:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#10 lore raw

PATCH 2/6 fs/ext2: add ability to build ext3/4 too

Arnout, Thomas, All,

Quoted 7 lines · On Tuesday 12 March 2013 Arnout Vandecappelle wrote:
Quoted 3 lines · Thomas Petazzoni

Maybe we could set the volume name to 'buildroot' ? I.e:

	tune2fs -L buildroot "${IMG}"

I don't particularly like that. If you're going to add volume names, it
should be configurable.

It can even be a generic FS option, that can be used by all FS that can set a label.

Material for a separate series, though; will do later.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH 3/6 fs: allow image generators to specify file-extension

In reply to Yann E. MORIN

For some filesystems, the generator can output different /versions/ of the filesystem (eg. ext can output ext{2,3,4}). In this case, it can be usefull to have the generated rootfs image with the actual version of the filesystem, rather than the generic name.

Add a second parameter to ROOTFS_TARGET, to specify the extension, and default to using the generator name.

Thanks to Arnout for the initial idea (my implementation is a bit different than what he suggested):

    http://lists.busybox.net/pipermail/buildroot/2013-February/067554.html
Cc Arnout Vandecappelle <[email protected]>
---
 fs/common.mk |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
fs/common.mk +13 -4
index 8b5b2f2..9ba9faa 100644
@@ -36,13 +36,18 @@ FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
 ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \
 	$(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE))
 
+# Internal image generation rules
+# Arguments:
+#   $1: name of the image generator (eg. ext, squashfs, tar...)
+#   $2: uppercase of $1
+#   $3: file-extension of the generated image file
 define ROOTFS_TARGET_INTERNAL
 
 # extra deps
 ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma)
 
-$$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES)
-	@$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
+$$(BINARIES_DIR)/rootfs.$(3): $$(ROOTFS_$(2)_DEPENDENCIES)
+	@$$(call MESSAGE,"Generating root filesystem image rootfs.$(3)")
 	$$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),$$(call $$(hook))$$(sep))
 	rm -f $$(FAKEROOT_SCRIPT)
 	rm -f $$(TARGET_DIR_WARNING_FILE)
@@ -74,15 +79,19 @@ endif
 rootfs-$(1)-show-depends:
 	@echo $$(ROOTFS_$(2)_DEPENDENCIES)
 
-rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(1) $$(ROOTFS_$(2)_POST_TARGETS)
+rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(3) $$(ROOTFS_$(2)_POST_TARGETS)
 
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y)
 TARGETS += rootfs-$(1)
 endif
 endef
 
+# Define the way to build a rootfs image (eg. filesystem, tarball...)
+# Arguments:
+#   $1: name of the image generator (eg. ext2, tar...)
+#   $2: file-extension of the generated image (optional, defaults to $1)
 define ROOTFS_TARGET
-$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1)))
+$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1)),$(or $(2),$(1)))
 endef
 
 include fs/*/*.mk
Signature · 1 line
1.7.2.5
#12 lore raw

PATCH 4/6 fs/ext2: use the ext2 variant to name the generated rootfs image

In reply to Yann E. MORIN
Cc Arnout Vandecappelle <[email protected]>
---
 fs/ext2/ext2.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext2/ext2.mk +1 -1
index 1660d9c..57acad7 100644
@@ -29,4 +29,4 @@ define ROOTFS_EXT2_CMD
 	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
 endef
 
-$(eval $(call ROOTFS_TARGET,ext2))
+$(eval $(call ROOTFS_TARGET,ext2,ext$(BR2_TARGET_ROOTFS_EXT2_GEN)))
Signature · 1 line
1.7.2.5
#13 lore raw

PATCH 4/6 fs/ext2: use the ext2 variant to name the generated rootfs image

Dear Yann E. MORIN,

Quoted 11 lines · Yann E. MORIN
Cc Arnout Vandecappelle <[email protected]>
---
 fs/ext2/ext2.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext2/ext2.mk +0 -0
index 1660d9c..57acad7 100644

fs/ext2/ext2.mk define ROOTFS_EXT2_CMD · line 32

Quoted 5 lines
fs/ext2/ext2.mk +1 -1
@@ -29,4 +29,4 @@ define ROOTFS_EXT2_CMD
 	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
 endef
 
-$(eval $(call ROOTFS_TARGET,ext2))
+$(eval $(call ROOTFS_TARGET,ext2,ext$(BR2_TARGET_ROOTFS_EXT2_GEN)))

It is not a very strong opinion here, but I'm not sure I like this idea of the file extension being dependent on BR2_TARGET_ROOTFS_EXT2_GEN.

I think I would have preferred something that renames the filesystem to:

$(eval $(call ROOTFS_TARGET,ext))

which generates a rootfs.ext image, with a compatibility symbolic link ext2 -> ext. This can for example be done in a ROOTFS_EXT_POST_GEN_HOOKS.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#14 lore raw

PATCH 4/6 fs/ext2: use the ext2 variant to name the generated rootfs image

Quoted 23 lines · Thomas Petazzoni

Dear Yann E. MORIN,

Quoted 11 lines · Yann E. MORIN
Cc Arnout Vandecappelle <[email protected]>
---
  fs/ext2/ext2.mk |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext2/ext2.mk +0 -0
index 1660d9c..57acad7 100644

fs/ext2/ext2.mk define ROOTFS_EXT2_CMD · line 32

Quoted 5 lines
fs/ext2/ext2.mk +1 -1
@@ -29,4 +29,4 @@ define ROOTFS_EXT2_CMD
  	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
  endef
 
-$(eval $(call ROOTFS_TARGET,ext2))
+$(eval $(call ROOTFS_TARGET,ext2,ext$(BR2_TARGET_ROOTFS_EXT2_GEN)))

It is not a very strong opinion here, but I'm not sure I like this idea of the file extension being dependent on BR2_TARGET_ROOTFS_EXT2_GEN.

Quoted 8 lines

I think I would have preferred something that renames the filesystem to:

$(eval $(call ROOTFS_TARGET,ext))

which generates a rootfs.ext image, with a compatibility symbolic link ext2 -> ext. This can for example be done in a ROOTFS_EXT_POST_GEN_HOOKS.

That sounds like a good idea to me.

Regards,
Arnout

Signature · 6 lines
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:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#15 lore raw

PATCH 4/6 fs/ext2: use the ext2 variant to name the generated rootfs image

In reply to Thomas Petazzoni

Thomas, All,

Quoted 21 lines · On Sunday 10 March 2013 Thomas Petazzoni wrote:
Quoted 11 lines · Yann E. MORIN
Cc Arnout Vandecappelle <[email protected]>
---
 fs/ext2/ext2.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext2/ext2.mk +0 -0
index 1660d9c..57acad7 100644

fs/ext2/ext2.mk define ROOTFS_EXT2_CMD · line 32

Quoted 5 lines
fs/ext2/ext2.mk +1 -1
@@ -29,4 +29,4 @@ define ROOTFS_EXT2_CMD
 	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
 endef
 
-$(eval $(call ROOTFS_TARGET,ext2))
+$(eval $(call ROOTFS_TARGET,ext2,ext$(BR2_TARGET_ROOTFS_EXT2_GEN)))

It is not a very strong opinion here, but I'm not sure I like this idea of the file extension being dependent on BR2_TARGET_ROOTFS_EXT2_GEN.

Quoted 8 lines

I think I would have preferred something that renames the filesystem to:

$(eval $(call ROOTFS_TARGET,ext))

which generates a rootfs.ext image, with a compatibility symbolic link ext2 -> ext. This can for example be done in a ROOTFS_EXT_POST_GEN_HOOKS.

The problem I see with renaming the file system is that the FS infra uses the name of the filesystem to see if it is enabled by way of:

    fs/common.mk:
    79  ifeq ($$(BR2_TARGET_ROOTFS_$(2)),y)
    80  TARGETS += rootfs-$(1)
    81  endif

where:
- $(1) is the name of the FS as supplied to ROOTFS_TARGET
- $(2) is the uppercase of $(1)

So, if we rename ext2 -> ext, we'd have to also rename BR2_TARGET_ROOTFS_EXT2 to BR2_TARGET_ROOTFS_EXT which was duly refused by Peter and Arnout:

    http://lists.busybox.net/pipermail/buildroot/2013-February/067587.html

    <Peter>
    Arnout's first comment was about the defconfigs /
    BR2_TARGET_ROOTFS_EXT{2,} change, which we both dislike
    </Peter>

However, Peter and Arnout expressed there interest in renaming the FS:

    <Peter>
    the 2nd was about the fs/ renames which should be transparent to
    the user.
    </Peter>

Unfortunately, it is not transparent, as it implies a rename of the kconfig symbol, which in turn would imply fixing the defconfigs, and the boards documentation.

True, I've reverted the whole rename without explanations. I forgot to mention that in the series' introductory email.

So, what next? I see four options:

0- don't rename anything, continue calling it .ext2 (although it may be

    ext2, ext3 or ext4): status-quo;
 1- only rename the fs directory, which *is* transparent
      - fs/ext2                 ->  fs/ext
 2- completely rename the filesystem:
      - fs/ext2                 ->  fs/ext
      - BR2_TARGET_ROOTFS_EXT2  ->  BR2_TARGET_ROOTFS_EXT

but do not fix the defconfigs and boards doc. Anyway, add a deprecated symbol for BR2_TARGET_ROOTFS_EXT2.
3- same as 3, but also fix defconfigs and boards doc.

For all those four options, we can add a post-fs-hook that symlinks the image file with the correct extension.

Finally, the curent proposal (allow to specify the FS extension) is not incompatible with any of the above four options.

So, up to you guys. ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#16 lore raw

PATCH 4/6 fs/ext2: use the ext2 variant to name the generated rootfs image

Quoted 13 lines · Yann E. MORIN

So, what next? I see four options:

0- don't rename anything, continue calling it .ext2 (although it may be

     ext2, ext3 or ext4): status-quo;
  1- only rename the fs directory, which*is*  transparent
       - fs/ext2                 ->  fs/ext
  2- completely rename the filesystem:
       - fs/ext2                 ->  fs/ext
       - BR2_TARGET_ROOTFS_EXT2  ->  BR2_TARGET_ROOTFS_EXT

but do not fix the defconfigs and boards doc. Anyway, add a deprecated symbol for BR2_TARGET_ROOTFS_EXT2.
3- same as 3, but also fix defconfigs and boards doc.

Quoted 5 lines

For all those four options, we can add a post-fs-hook that symlinks the image file with the correct extension.

Finally, the curent proposal (allow to specify the FS extension) is not incompatible with any of the above four options.

I don't have a problem with the directory and the config symbol using
ext2 - these are anyway internal kitchen. I wouldn't want to change only the directory name and not the config symbol, because that does make reading the code more difficult.

What is important, is that the name in the images directory has the
correct extension. This can be done either by the addition ROOTFS_TARGET argument, or by symlinking in a post-hook. I'm slightly in favour of the latter, because it is much simpler. On the other hand, Yann has done the change already and it may be useful for other filesystems at some point too.

So for me, it is either Yann's implementation, or symlinking in a
post-hook.

BTW, note that the image still is an ext2 image (it can be read by ext2
code). So having the rootfs.ext4 -> rootfs.ext2 symlink is not a problem at all.

Regards,
Arnout

Signature · 6 lines
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:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#17 lore raw

PATCH 4/6 fs/ext2: use the ext2 variant to name the generated rootfs image

Arnout, Thomas, All,

Quoted 17 lines · On Thursday 14 March 2013 Arnout Vandecappelle wrote:
Quoted 16 lines · Yann E. MORIN

So, what next? I see four options:

0- don't rename anything, continue calling it .ext2 (although it may be

     ext2, ext3 or ext4): status-quo;
  1- only rename the fs directory, which*is*  transparent
       - fs/ext2                 ->  fs/ext
  2- completely rename the filesystem:
       - fs/ext2                 ->  fs/ext
       - BR2_TARGET_ROOTFS_EXT2  ->  BR2_TARGET_ROOTFS_EXT

but do not fix the defconfigs and boards doc. Anyway, add a deprecated symbol for BR2_TARGET_ROOTFS_EXT2.
3- same as 3, but also fix defconfigs and boards doc.

For all those four options, we can add a post-fs-hook that symlinks the image file with the correct extension.

Quoted 7 lines
Quoted 2 lines

Finally, the curent proposal (allow to specify the FS extension) is not incompatible with any of the above four options.

I don't have a problem with the directory and the config symbol using
ext2 - these are anyway internal kitchen. I wouldn't want to change only the directory name and not the config symbol, because that does make reading the code more difficult.

OK, fair enough.

Quoted 8 lines

What is important, is that the name in the images directory has the
correct extension. This can be done either by the addition ROOTFS_TARGET argument, or by symlinking in a post-hook. I'm slightly in favour of the latter, because it is much simpler. On the other hand, Yann has done the change already and it may be useful for other filesystems at some point too.

So for me, it is either Yann's implementation, or symlinking in a
post-hook.

In that case, I think the post-image-hook is more appropriate. I will rework this to use a hook.

I will also drop patch 3/6:
fs: allow image generators to specify file-extension

Quoted 3 lines

BTW, note that the image still is an ext2 image (it can be read by ext2
code). So having the rootfs.ext4 -> rootfs.ext2 symlink is not a problem at all.

OK, will do.

Thank you!

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#18 lore raw

PATCH 5/6 fs/ext2: add support for ext2 rev0 and rev1

In reply to Yann E. MORIN

Some bootloaders have a buggy ext2 support, and require ext2 rev1 instead of the traditional ext2 rev0 that genext2fs produces.

tune2fs accepts only one '-O list' at a time, so we need to construct a list of -O options.

Cc Arnout Vandecappelle <[email protected]>

---
Changes v1->v2:
- separate GEN/REV and use two environment variables (Arnout)
- all are revision 1, except ext2r0 (Arnout)

---
 fs/ext2/Config.in    |   20 +++++++++++++++++---
 fs/ext2/ext2.mk      |    3 ++-
 fs/ext2/genext2fs.sh |   12 +++++++++---
 3 files changed, 28 insertions(+), 7 deletions(-)
fs/ext2/Config.in +17 -3
index c8320e2..097242e 100644
@@ -6,12 +6,20 @@ config BR2_TARGET_ROOTFS_EXT2
 
 if BR2_TARGET_ROOTFS_EXT2
 
+config BR2_TARGET_ROOTFS_EXT2_2
+	bool
+
 choice
 	bool "ext2/3/4 variant"
-	default BR2_TARGET_ROOTFS_EXT2_2
+	default BR2_TARGET_ROOTFS_EXT2_2r0
 
-config BR2_TARGET_ROOTFS_EXT2_2
-	bool "ext2"
+config BR2_TARGET_ROOTFS_EXT2_2r0
+	bool "ext2 (rev0)"
+	select BR2_TARGET_ROOTFS_EXT2_2
+
+config BR2_TARGET_ROOTFS_EXT2_2r1
+	bool "ext2 (rev1)"
+	select BR2_TARGET_ROOTFS_EXT2_2
 
 config BR2_TARGET_ROOTFS_EXT2_3
 	bool "ext3"
@@ -27,6 +35,12 @@ config BR2_TARGET_ROOTFS_EXT2_GEN
 	default 3 if BR2_TARGET_ROOTFS_EXT2_3
 	default 4 if BR2_TARGET_ROOTFS_EXT2_4
 
+# All ext generations are revision 1, except ext2r0, which is revision 0
+config BR2_TARGET_ROOTFS_EXT2_REV
+    int
+    default 0   if BR2_TARGET_ROOTFS_EXT2_2r0
+    default 1   if !BR2_TARGET_ROOTFS_EXT2_2r0
+
 config BR2_TARGET_ROOTFS_EXT2_BLOCKS
 	int "size in blocks (leave at 0 for auto calculation)"
 	default 0
fs/ext2/ext2.mk +2 -1
index 57acad7..b383020 100644
@@ -23,7 +23,8 @@ ifeq ($(BR2_PACKAGE_HOST_E2FSPROGS),y)
 ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
 endif
 
-EXT2_ENV = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN)
+EXT2_ENV  = GEN=$(BR2_TARGET_ROOTFS_EXT2_GEN)
+EXT2_ENV += REV=$(BR2_TARGET_ROOTFS_EXT2_REV)
 
 define ROOTFS_EXT2_CMD
 	PATH=$(TARGET_PATH) $(EXT2_ENV) fs/ext2/genext2fs.sh -d $(TARGET_DIR) $(EXT2_OPTS) $@
fs/ext2/genext2fs.sh +9 -3
index 0790729..c466bc2 100755
@@ -75,15 +75,21 @@ e2tunefsck() {
 }
 
 # Check we know what generation to generate
-case "${GEN}" in
-    2|3|4)
+case "${GEN}:${REV}" in
+    2:0|2:1|3:1|4:1)
 	;;
     *)
-	printf "%s: unknown ext generation to generate\n" "${0##*/}" >&2
+	printf "%s: unknown ext generation '%s' and/or revision '%s'\n" \
+	       "${0##*/}" "${GEN}" "${REV}" >&2
 	exit 1
 	;;
 esac
 
+# Upgrade to rev1 if needed
+if [ ${REV} -ge 1 ]; then
+    EXT_OPTS_O="${EXT_OPTS_O},filetype"
+fi
+
 # Add a journal for ext3 and above
 if [ ${GEN} -ge 3 ]; then
     EXT_OPTS="${EXT_OPTS} -j -J size=1"
Signature · 1 line
1.7.2.5
#19 lore raw

PATCH 5/6 fs/ext2: add support for ext2 rev0 and rev1

Quoted 8 lines · Yann E. MORIN

Some bootloaders have a buggy ext2 support, and require ext2 rev1 instead of the traditional ext2 rev0 that genext2fs produces.

tune2fs accepts only one '-O list' at a time, so we need to construct a list of -O options.

Cc Arnout Vandecappelle<[email protected]>

I like your new approach for gen/rev configuration!

Regards,
Arnout

Signature · 6 lines
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:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#20 lore raw

PATCH 6/6 fs/ext2: remove count- and time-based fsck

In reply to Yann E. MORIN

Set the count- and time-based checks intervals to 0, thus effectively disabling automatic checks at boot.

(After a suggestion by Arnout.)

Cc Arnout Vandecappelle <[email protected]>
---
 fs/ext2/genext2fs.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
fs/ext2/genext2fs.sh +3 -2
index c466bc2..e4177ae 100755
@@ -70,8 +70,9 @@ e2tunefsck() {
     esac
     printf "e2fsck was successfully run on rootfs.ext${GEN}\n"
 
-    # e2fsck will force a UUID, which we do not want
-    tune2fs -U clear "${IMG}"
+    # e2fsck will force a UUID, which we do not want;
+    # remove count- and time-based checks
+    tune2fs -U clear -c 0 -i 0 "${IMG}"
 }
 
 # Check we know what generation to generate
Signature · 1 line
1.7.2.5
#21 lore raw

PATCH 6/6 fs/ext2: remove count- and time-based fsck

Quoted 7 lines · Yann E. MORIN

Set the count- and time-based checks intervals to 0, thus effectively disabling automatic checks at boot.

(After a suggestion by Arnout.)

Cc Arnout Vandecappelle<[email protected]>
Signature · 6 lines
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:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#22 lore raw
In reply to Yann E. MORIN

Dear Yann E. MORIN,

Quoted 5 lines · Yann E. MORIN

This patch series enhances the ext2 fs backend to also build ext3 and ext4 filesystems, and differentiate between ext2 rev0 and ext2 rev1 filesystems.

This patch series is based on the previously-sent 'yem-host-image-tools' pull-request, and requires changes in that series.

I just tested this with the following defconfig:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set

and building the ext4 image fails:

tune2fs 1.42.7 (21-Jan-2013)

Please run e2fsck on the filesystem.

Creating journal inode:
Journal size too big for filesystem.
make: *** [/home/thomas/projets/buildroot/output/images/rootfs.ext4] Erreur 1

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#23 lore raw

Thomas, All,

Quoted 16 lines · On Sunday 10 March 2013 Thomas Petazzoni wrote:
Quoted 5 lines · Yann E. MORIN

This patch series enhances the ext2 fs backend to also build ext3 and ext4 filesystems, and differentiate between ext2 rev0 and ext2 rev1 filesystems.

This patch series is based on the previously-sent 'yem-host-image-tools' pull-request, and requires changes in that series.

I just tested this with the following defconfig:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set

Quoted 5 lines

and building the ext4 image fails:

tune2fs 1.42.7 (21-Jan-2013)

Please run e2fsck on the filesystem.

That part is expected: tune2fs will explicitly state the above when some features of ext2/3/4 are activated.

WE handle that in the script by explictly calling to e2fsck afterward.

Quoted 3 lines

Creating journal inode:
Journal size too big for filesystem.
make: *** [/home/thomas/projets/buildroot/output/images/rootfs.ext4] Erreur 1

Ah, this is... sad. It seems the heuristic to compute the number of extra sectors to add is not good enough.

I'll see what I can do with that.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#24 lore raw
In reply to Thomas Petazzoni

Thomas, All,

Quoted 18 lines · On Sunday 10 March 2013 Thomas Petazzoni wrote:
Quoted 5 lines · Yann E. MORIN

This patch series enhances the ext2 fs backend to also build ext3 and ext4 filesystems, and differentiate between ext2 rev0 and ext2 rev1 filesystems.

This patch series is based on the previously-sent 'yem-host-image-tools' pull-request, and requires changes in that series.

I just tested this with the following defconfig:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set

and building the ext4 image fails:

Quoted 7 lines

tune2fs 1.42.7 (21-Jan-2013)

Please run e2fsck on the filesystem.

Creating journal inode:
Journal size too big for filesystem.
make: *** [/home/thomas/projets/buildroot/output/images/rootfs.ext4] Erreur 1

I am unable to reproduce this failure with your defconfig:

---8<---
echo " PATH="/home/ymorin/dev/buildroot/O-misc/host/bin:/home/ymorin/dev/bu ildroot/O-misc/host/usr/bin:/home/ymorin/dev/buildroot/O-misc/host/usr/sbin/ :/home/ymorin/bin:/home/ymorin/bin:/opt/zbar/bin:/opt/stgit/bin:/opt/qemu/bi n:/opt/pkg++/bin:/opt/kcfg/bin:/opt/hg/bin:/opt/firefox/bin:/opt/bencode/bin :/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" GEN=4 REV=1 fs/ex t2/genext2fs.sh -d /home/ymorin/dev/buildroot/O-misc/target /home/ymorin/de v/buildroot/O-misc/images/rootfs.ext2" >> /home/ymorin/dev/buildroot/O-misc/ build/_fakeroot.fs
chmod a+x /home/ymorin/dev/buildroot/O-misc/build/_fakeroot.fs /home/ymorin/dev/buildroot/O-misc/host/usr/bin/fakeroot -- /home/ymorin/dev/ buildroot/O-misc/build/_fakeroot.fs rootdir=/home/ymorin/dev/buildroot/O-misc/target table='/home/ymorin/dev/buildroot/O-misc/build/_device_table.txt' tune2fs 1.42.7 (21-Jan-2013)

Please run e2fsck on the filesystem.

Creating journal inode: done
This filesystem will be automatically checked every 20 mounts or 0 days, whichever comes first. Use tune2fs -c or -i to override.

e2fsck was successfully run on 'rootfs.ext2' (ext4)

tune2fs 1.42.7 (21-Jan-2013)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
cp support/misc/target-dir-warning.txt /home/ymorin/dev/buildroot/O-misc/tar get/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
ln -sf rootfs.ext2 /home/ymorin/dev/buildroot/O-misc/images/rootfs.ext4 ---8<---

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'