grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] EROFS test fixes and improvements
@ 2025-11-09  3:20 Glenn Washburn
  2025-11-09  3:20 ` [PATCH 1/4] tests/erofs_test: Only test and set labels if supported by erofs-utils Glenn Washburn
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Glenn Washburn @ 2025-11-09  3:20 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Leo Sandoval, Andrew Hamilton, Glenn Washburn

I believe these patches to be adequately explained in their commit
messages.

Glenn

Glenn Washburn (4):
  tests/erofs_test: Only test and set labels if supported by erofs-utils
  tests/erofs_test: Remove root check
  tests/erofs_test: Disable filetime check for erofs_compact
  tests/erofs_test: Improve accuracy of FSTIME check

 tests/erofs_test.in          |  8 --------
 tests/util/grub-fs-tester.in | 28 ++++++++++++++++++++++------
 2 files changed, 22 insertions(+), 14 deletions(-)

-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] tests/erofs_test: Only test and set labels if supported by erofs-utils
  2025-11-09  3:20 [PATCH 0/4] EROFS test fixes and improvements Glenn Washburn
@ 2025-11-09  3:20 ` Glenn Washburn
  2025-11-09  3:20 ` [PATCH 2/4] tests/erofs_test: Remove root check Glenn Washburn
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Glenn Washburn @ 2025-11-09  3:20 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Leo Sandoval, Andrew Hamilton, Glenn Washburn

Support for setting the label of an erofs volume was added in version 1.6
of erofs-utils. However, current Debian 12 has version 1.5. This causes
the erofs filesystem tests to fail when trying to create a volume with a
label. Check version of mkfs.erofs and if its 1.6 or above set the label,
otherwise do not and disable the label check.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 tests/util/grub-fs-tester.in | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index f83af652f6cc..37f54fabe8f1 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -595,6 +595,12 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
 		x"cpio_"* | x"tarfs" | x"squash4_"* | x"minix" | x"minix2" \
 		    | x"minix3" | xreiserfs_old)
 		    NOFSLABEL=y;;
+		x"erofs_"*)
+		    VER=$(mkfs.erofs 2>/dev/null | head -n1 | (read _ V; echo $V))
+		    if [ "$(echo -e "${VER}\n1.6" | sort -V | head -n1)" != "1.6" ]; then
+			NOFSLABEL=y
+			unset FSLABEL
+		    fi;;
 	    esac
 
 	    PDIRCOMPNUM=210
@@ -1121,16 +1127,16 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
 		    echo mksquashfs "$MASTER" "${FSIMAGEP}0.img" -always-use-fragments -comp "${fs/squash4_/}" -b $BLKSIZE
 		    mksquashfs "$MASTER" "${FSIMAGEP}0.img" -always-use-fragments -comp "${fs/squash4_/}" -b $BLKSIZE ;;
 		x"erofs_compact")
-			echo mkfs.erofs -Eforce-inode-compact -L "$FSLABEL" "${FSIMAGEP}0.img" "$MNTPOINTRW"
-			mkfs.erofs -Eforce-inode-compact -L "$FSLABEL" "${FSIMAGEP}0.img" "$MNTPOINTRW"
+			echo mkfs.erofs -Eforce-inode-compact ${FSLABEL:+-L "$FSLABEL"} "${FSIMAGEP}0.img" "$MNTPOINTRW"
+			mkfs.erofs -Eforce-inode-compact ${FSLABEL+-L "$FSLABEL"} "${FSIMAGEP}0.img" "$MNTPOINTRW"
 			;;
 		x"erofs_extended")
-			echo mkfs.erofs -Eforce-inode-extended -L "$FSLABEL" "${FSIMAGEP}0.img" "$MNTPOINTRW"
-			mkfs.erofs -Eforce-inode-extended -L "$FSLABEL" "${FSIMAGEP}0.img" "$MNTPOINTRW"
+			echo mkfs.erofs -Eforce-inode-extended ${FSLABEL+-L "$FSLABEL"} "${FSIMAGEP}0.img" "$MNTPOINTRW"
+			mkfs.erofs -Eforce-inode-extended ${FSLABEL+-L "$FSLABEL"} "${FSIMAGEP}0.img" "$MNTPOINTRW"
 			;;
 		x"erofs_chunk")
-			echo mkfs.erofs --chunksize=1048576 -L "$FSLABEL" "${FSIMAGEP}0.img" "$MNTPOINTRW"
-			mkfs.erofs --chunksize=1048576 -L "$FSLABEL" "${FSIMAGEP}0.img" "$MNTPOINTRW"
+			echo mkfs.erofs --chunksize=1048576 ${FSLABEL+-L "$FSLABEL"} "${FSIMAGEP}0.img" "$MNTPOINTRW"
+			mkfs.erofs --chunksize=1048576 ${FSLABEL+-L "$FSLABEL"} "${FSIMAGEP}0.img" "$MNTPOINTRW"
 			;;
 		x"bfs")
 		    sleep 1
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] tests/erofs_test: Remove root check
  2025-11-09  3:20 [PATCH 0/4] EROFS test fixes and improvements Glenn Washburn
  2025-11-09  3:20 ` [PATCH 1/4] tests/erofs_test: Only test and set labels if supported by erofs-utils Glenn Washburn
@ 2025-11-09  3:20 ` Glenn Washburn
  2025-11-09  3:20 ` [PATCH 3/4] tests/erofs_test: Disable filetime check for erofs_compact Glenn Washburn
  2025-11-09  3:20 ` [PATCH 4/4] tests/erofs_test: Improve accuracy of FSTIME check Glenn Washburn
  3 siblings, 0 replies; 5+ messages in thread
From: Glenn Washburn @ 2025-11-09  3:20 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Leo Sandoval, Andrew Hamilton, Glenn Washburn

The erofs tests do not ever mount the generated erofs image. So root is
not needed, as with the squashfs and iso9660 filesystems.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 tests/erofs_test.in | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/tests/erofs_test.in b/tests/erofs_test.in
index 51111627acec..5b7678b1e234 100644
--- a/tests/erofs_test.in
+++ b/tests/erofs_test.in
@@ -2,14 +2,6 @@
 
 set -e
 
-if [ "x$EUID" = "x" ] ; then
-  EUID=`id -u`
-fi
-
-if [ "$EUID" != 0 ] ; then
-   exit 99
-fi
-
 if ! which mkfs.erofs >/dev/null 2>&1; then
    echo "mkfs.erofs not installed; cannot test erofs."
    exit 99
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] tests/erofs_test: Disable filetime check for erofs_compact
  2025-11-09  3:20 [PATCH 0/4] EROFS test fixes and improvements Glenn Washburn
  2025-11-09  3:20 ` [PATCH 1/4] tests/erofs_test: Only test and set labels if supported by erofs-utils Glenn Washburn
  2025-11-09  3:20 ` [PATCH 2/4] tests/erofs_test: Remove root check Glenn Washburn
@ 2025-11-09  3:20 ` Glenn Washburn
  2025-11-09  3:20 ` [PATCH 4/4] tests/erofs_test: Improve accuracy of FSTIME check Glenn Washburn
  3 siblings, 0 replies; 5+ messages in thread
From: Glenn Washburn @ 2025-11-09  3:20 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Leo Sandoval, Andrew Hamilton, Glenn Washburn

Compact EROFS inodes do not allow for modification times that are
different from FS creation times. The file modification time check is
done between the EROFS image and the file system where test temporary
files are written to, not the files as seen from the mounted EROFS image.
So its likely that the file modification time will be different, more
so when run on slower systems.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 tests/util/grub-fs-tester.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index 37f54fabe8f1..579b937f5bc1 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -587,6 +587,10 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
 		# FS LIMITATION: romfs has no timestamps.
 		x"romfs")
 		    NOFILETIME=y; NOFSTIME=y;;
+		# FS LIMITATION: Compact inodes do not allow for modification
+		#   times that are different from FS creation times.
+		x"erofs_compact")
+		    NOFILETIME=y;;
 	    esac
 
 	    NOFSLABEL=n
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] tests/erofs_test: Improve accuracy of FSTIME check
  2025-11-09  3:20 [PATCH 0/4] EROFS test fixes and improvements Glenn Washburn
                   ` (2 preceding siblings ...)
  2025-11-09  3:20 ` [PATCH 3/4] tests/erofs_test: Disable filetime check for erofs_compact Glenn Washburn
@ 2025-11-09  3:20 ` Glenn Washburn
  3 siblings, 0 replies; 5+ messages in thread
From: Glenn Washburn @ 2025-11-09  3:20 UTC (permalink / raw)
  To: grub-devel; +Cc: Daniel Kiper, Leo Sandoval, Andrew Hamilton, Glenn Washburn

On resource constrained test runs, the last modification time on the
image is an unreliable date to check against the filesystem creation
time. Use dump.erofs to get the filesystem creation time from the
superblock. This should get the timestamp as shown by GRUB's ls -l.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 tests/util/grub-fs-tester.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index 579b937f5bc1..c4d557d530fc 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -1470,6 +1470,12 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
 			# With some abstractions like mdraid flushing to disk
 			# may be delayed for a long time.
 			FSTIME="$UMOUNT_TIME";;
+		    x"erofs_"*)
+			# Creating the erofs image may take more than a few
+			# seconds. Use the more accurate timestamp from the
+			# superblock.
+			FSTIME="$(dump.erofs -s "${FSIMAGEP}0.img" | grep ^"Filesystem created:" | (read _ _ REST; echo $REST) )"
+			FSTIME="$(date -d "$FSTIME" -u '+%Y-%m-%d %H:%M:%S')";;
 		    xsquash*)
 			# Creating the squash image may take more than a few
 			# seconds. Use the more accurate timestamp from the
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-09  3:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-09  3:20 [PATCH 0/4] EROFS test fixes and improvements Glenn Washburn
2025-11-09  3:20 ` [PATCH 1/4] tests/erofs_test: Only test and set labels if supported by erofs-utils Glenn Washburn
2025-11-09  3:20 ` [PATCH 2/4] tests/erofs_test: Remove root check Glenn Washburn
2025-11-09  3:20 ` [PATCH 3/4] tests/erofs_test: Disable filetime check for erofs_compact Glenn Washburn
2025-11-09  3:20 ` [PATCH 4/4] tests/erofs_test: Improve accuracy of FSTIME check Glenn Washburn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).