From 51e6e87053c9b5192069bfe9d6ff18f5282d3b27 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Mon, 13 Jan 2025 21:02:24 +0100 Subject: [PATCH] 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=" 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 Signed-off-by: Julien Olivain Signed-off-by: Peter Korsgaard --- fs/ext2/Config.in | 6 ++++-- fs/ext2/ext2.mk | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in index 4451d0797f..7d42621202 100644 --- a/fs/ext2/Config.in +++ b/fs/ext2/Config.in @@ -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" diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk index e69e79cd2e..b49a8456f4 100644 --- a/fs/ext2/ext2.mk +++ b/fs/ext2/ext2.mk @@ -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)" \