Skip to contentSkip to conversation

fs/ext2: fixes for ext2r0 with host-e2fsprogs >= 1.47.2

PATCH In review Julien Olivain 2 participants 3 messages Jan 13, 2025 – Feb 3, 2025 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/ext2: fixes for ext2r0 with host-e2fsprogs >= 1.47.2

Since Buildroot commit [1] "package/e2fsprogs: bump version to 1.47.2", running the runtime test tests.fs.test_ext.TestExt2 with the command:

    utils/docker-run support/testing/run-tests \
        -d dl -o output_folder \
        tests.fs.test_ext.TestExt2
    tail output_folder/TestExt2-build.log

Fails with error in the log:

mkfs.ext2: the -r option has been removed.

If you really need compatibility with pre-1995 Linux systems, use the command-line option "-E revision=0".

Upstream commit [2] "tune2fs: replace the -r option with -E revision=<fs-rev>" removed this option.

This commit fixes the issue by using the new form with -E. Also, BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS has a default value to "-O ^64bit". Passing a "-O ..." option now generates an error when a ext2r0 filesystem is created (because this revision does not support ext2 filesystem feature options). This commit sets this default value only if BR2_TARGET_ROOTFS_EXT2_2r0 is not set.

Fixes [3]

[1] https://gitlab.com/buildroot.org/buildroot/-/commit/db459859fa3c8fb7a2c0c8b8616637644d9c12bf
[2] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=3fffe9dd6be5a5ed77755cf23c267b4afd1e7651
[3] https://gitlab.com/buildroot.org/buildroot/-/jobs/8830670170

---
Patch tested in:
https://gitlab.com/jolivain/buildroot/-/pipelines/1623295044

---
 fs/ext2/Config.in | 6 ++++--
 fs/ext2/ext2.mk   | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
fs/ext2/Config.in +4 -2
index 4451d0797f..7d42621202 100644
@@ -85,7 +85,8 @@ config BR2_TARGET_ROOTFS_EXT2_RESBLKS
 
 config BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS
 	string "additional mke2fs options"
-	default "-O ^64bit"
+	# Note: ext2 rev0 does not support filesystem options.
+	default "-O ^64bit" if !BR2_TARGET_ROOTFS_EXT2_2r0
 	help
 	  Specify a space-separated list of mke2fs options, including
 	  any ext2/3/4 filesystem features.
@@ -100,7 +101,8 @@ config BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS
 	  support. This default value has been chosen because U-Boot
 	  versions before 2017.02 don't support this filesystem
 	  option: using it may make the filesystem unreadable by
-	  U-Boot.
+	  U-Boot. Note: this default does not apply to the old ext2
+	  (rev0) which does not support filesystem options.
 
 choice
 	prompt "Compression method"
fs/ext2/ext2.mk +1 -1
index e69e79cd2e..b49a8456f4 100644
@@ -18,7 +18,7 @@ ROOTFS_EXT2_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
 
 ROOTFS_EXT2_OPTS = \
 	-d $(TARGET_DIR) \
-	-r $(BR2_TARGET_ROOTFS_EXT2_REV) \
+	-E revision=$(BR2_TARGET_ROOTFS_EXT2_REV) \
 	-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
 	-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
 	-L "$(ROOTFS_EXT2_LABEL)" \
Signature · 6 lines
2.47.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Julien" == Julien Olivain <[email protected]> writes:

Since Buildroot commit [1] "package/e2fsprogs: bump version to 1.47.2", running the runtime test tests.fs.test_ext.TestExt2 with the command:

    utils/docker-run support/testing/run-tests \
        -d dl -o output_folder \
        tests.fs.test_ext.TestExt2
    tail output_folder/TestExt2-build.log

Fails with error in the log:

mkfs.ext2: the -r option has been removed.

If you really need compatibility with pre-1995 Linux systems, use the command-line option "-E revision=0".

Upstream commit [2] "tune2fs: replace the -r option with -E revision=<fs-rev>" removed this option.

This commit fixes the issue by using the new form with -E. Also, BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS has a default value to "-O ^64bit". Passing a "-O ..." option now generates an error when a ext2r0 filesystem is created (because this revision does not support ext2 filesystem feature options). This commit sets this default value only if BR2_TARGET_ROOTFS_EXT2_2r0 is not set.

Quoted 7 lines
Fixes [3]

[1] https://gitlab.com/buildroot.org/buildroot/-/commit/db459859fa3c8fb7a2c0c8b8616637644d9c12bf
[2] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=3fffe9dd6be5a5ed77755cf23c267b4afd1e7651
[3] https://gitlab.com/buildroot.org/buildroot/-/jobs/8830670170

Committed, thanks.

Maybe we should consider dropping r0 support?

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi Peter,

Quoted 36 lines · Peter Korsgaard
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Julien" == Julien Olivain <[email protected]> writes:

Since Buildroot commit [1] "package/e2fsprogs: bump version to 1.47.2", running the runtime test tests.fs.test_ext.TestExt2 with

the

Quoted 7 lines

command:

    utils/docker-run support/testing/run-tests \
        -d dl -o output_folder \
        tests.fs.test_ext.TestExt2
    tail output_folder/TestExt2-build.log
Quoted 5 lines

Fails with error in the log:

mkfs.ext2: the -r option has been removed.

If you really need compatibility with pre-1995 Linux systems,

use the

Quoted 10 lines

command-line option "-E revision=0".

Upstream commit [2] "tune2fs: replace the -r option with -E revision=<fs-rev>" removed this option.

This commit fixes the issue by using the new form with -E. Also, BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS has a default value to "-O ^64bit". Passing a "-O ..." option now generates an error when a ext2r0 filesystem is created (because this revision does not support ext2 filesystem feature options). This commit sets this default

value

Quoted 5 lines

only if BR2_TARGET_ROOTFS_EXT2_2r0 is not set.

Fixes [3]

[1]

https://gitlab.com/buildroot.org/buildroot/-/commit/db459859fa3c8fb7a2c0c8b8616637644d9c12bf

Quoted 1 line

[2]

Quoted 8 lines

https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=3fffe9dd6be5a5ed77755cf23c267b4afd1e7651

Quoted 3 lines

[3] https://gitlab.com/buildroot.org/buildroot/-/jobs/8830670170

Committed, thanks.

Maybe we should consider dropping r0 support?

I agree, this very old option could be removed.

Quoted 1 line

Bye, Peter Korsgaard

Best regards,

Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot