[PATCH v6 3/3] tests: Support Changed mkfs.ext2 Behavior for -r Flag

Andrew Hamilton <[email protected]>
Newsgroups org.gnu.grub-devel
Message-ID <[email protected]>
Correct nuisance ext234_test failure on newer Linux
distros.

Recently, the mkfs.ext2 utility removed support for the
-r flag to specify old (version 0) formats of ext2. A
new flag was added to allow the same behavior. Support
both ways of specifying version 0 ext2 file systems
when testing ext2 in GRUB.

Signed-off-by: Andrew Hamilton <[email protected]>
Reviewed-by: Daniel Kiper <[email protected]>
---
 tests/util/grub-fs-tester.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index 54add3b73..87ff8bc6f 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -880,7 +880,11 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
 		xnilfs2)
 		    "mkfs.nilfs2" -L "$FSLABEL" -b $BLKSIZE  -q "${MOUNTDEVICE}" ;;
 		xext2_old)
-		    MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.ext2" -r 0 -b $BLKSIZE -L "$FSLABEL" -q "${MOUNTDEVICE}"
+                    if "mkfs.ext2" -r 0 2>&1 | grep -F "the -r option has been removed"; then
+                        MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.ext2" -E revision=0 -b $BLKSIZE -L "$FSLABEL" -q "${MOUNTDEVICE}"
+                    else
+                        MKE2FS_DEVICE_SECTSIZE=$SECSIZE "mkfs.ext2" -r 0 -b $BLKSIZE -L "$FSLABEL" -q "${MOUNTDEVICE}"
+                    fi
 		    MOUNTFS=ext2
 		    ;;
 		xext4_metabg)
-- 
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.