Ver Fonte

fs/ext2: remove ext2 revision 0 support

Revision 0 is very old and misses a number of features.  From man mkfs.ext2:

Set  the  file system revision for the new file system.  Note that 1.2
kernels only support revision 0 file systems.  The default is to create
revision 1 file systems.

We are unlikely to have a lot of Linux 1.2.x users, so drop support for it.

As revision 1 is the default, drop the -E revision argument to mkfs.ext2 for
simplicity.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
Peter Korsgaard há 6 meses atrás
pai
commit
ba38576aa6
4 ficheiros alterados com 9 adições e 35 exclusões
  1. 7 0
      Config.in.legacy
  2. 2 14
      fs/ext2/Config.in
  3. 0 1
      fs/ext2/ext2.mk
  4. 0 20
      support/testing/tests/fs/test_ext.py

+ 7 - 0
Config.in.legacy

@@ -146,6 +146,13 @@ endif
 
 comment "Legacy options removed in 2025.02"
 
+config BR2_TARGET_ROOTFS_EXT2_2r0
+	bool "ext2 rev0 support been removed"
+	select BR2_LEGACY
+	help
+	  Support for ext2 revision 0 format has been removed and
+	  revision 1 is now unconditionally used.
+
 config BR2_GDB_VERSION_13
 	bool "gdb 13.x has been removed"
 	select BR2_LEGACY

+ 2 - 14
fs/ext2/Config.in

@@ -13,10 +13,6 @@ choice
 	bool "ext2/3/4 variant"
 	default BR2_TARGET_ROOTFS_EXT2_2r1
 
-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
@@ -35,12 +31,6 @@ 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_LABEL
 	string "filesystem label"
 	default "rootfs"
@@ -85,8 +75,7 @@ config BR2_TARGET_ROOTFS_EXT2_RESBLKS
 
 config BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS
 	string "additional mke2fs options"
-	# Note: ext2 rev0 does not support filesystem options.
-	default "-O ^64bit" if !BR2_TARGET_ROOTFS_EXT2_2r0
+	default "-O ^64bit"
 	help
 	  Specify a space-separated list of mke2fs options, including
 	  any ext2/3/4 filesystem features.
@@ -101,8 +90,7 @@ 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. Note: this default does not apply to the old ext2
-	  (rev0) which does not support filesystem options.
+	  U-Boot.
 
 choice
 	prompt "Compression method"

+ 0 - 1
fs/ext2/ext2.mk

@@ -18,7 +18,6 @@ ROOTFS_EXT2_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
 
 ROOTFS_EXT2_OPTS = \
 	-d $(TARGET_DIR) \
-	-E revision=$(BR2_TARGET_ROOTFS_EXT2_REV) \
 	-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
 	-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
 	-L "$(ROOTFS_EXT2_LABEL)" \

+ 0 - 20
support/testing/tests/fs/test_ext.py

@@ -38,26 +38,6 @@ def boot_img_and_check_fs_type(emulator, builddir, fs_type):
 
 
 class TestExt2(infra.basetest.BRTest):
-    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
-        """
-        BR2_TARGET_ROOTFS_EXT2=y
-        BR2_TARGET_ROOTFS_EXT2_2r0=y
-        BR2_TARGET_ROOTFS_EXT2_LABEL="foobaz"
-        BR2_TARGET_ROOTFS_EXT2_SIZE="16384"
-        # BR2_TARGET_ROOTFS_TAR is not set
-        """
-
-    def test_run(self):
-        out = dumpe2fs_run(self.builddir, "rootfs.ext2")
-        self.assertEqual(dumpe2fs_getprop(out, VOLNAME_PROP), "foobaz")
-        self.assertEqual(dumpe2fs_getprop(out, REVISION_PROP), "0 (original)")
-
-        exit_code = boot_img_and_check_fs_type(self.emulator,
-                                               self.builddir, "ext2")
-        self.assertEqual(exit_code, 0)
-
-
-class TestExt2r1(infra.basetest.BRTest):
     config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
         """
         BR2_TARGET_ROOTFS_EXT2=y