Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Apr 2026 09:57:04 +0000
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 9d8a3938e601 - main - sysutils/grub2-bhyve: Add support for additional EXT4 incompatible features
Message-ID:  <69d777f0.476c1.4e5e1a06@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by oshogbo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9d8a3938e60119f53efe857a2e565cc3190ed5d0

commit 9d8a3938e60119f53efe857a2e565cc3190ed5d0
Author:     Mariusz Zaborski <oshogbo@FreeBSD.org>
AuthorDate: 2026-03-03 15:28:05 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2026-04-09 09:54:04 +0000

    sysutils/grub2-bhyve: Add support for additional EXT4 incompatible features
    
    Handle the following EXT4 incompatible features:
    
    EXT4_FEATURE_INCOMPAT_MMP (Multi-Mount Protection)
    Prevents multiple read-write mounts of the same filesystem.
    Since grub2-bhyve mounts filesystems read-only, it is safe to ignore.
    
    EXT4_FEATURE_INCOMPAT_CSUM_SEED
    Allows tools such as tune2fs to change the UUID on a mounted
    metadata-checksummed filesystem. Safe to ignore because the
    driver does not perform checksum verification.
    
    EXT4_FEATURE_INCOMPAT_LARGEDIR
    Enables directories larger than 2GB and 3-level htrees.
    Safe to ignore because the GRUB ext2 driver does not implement
    DIR_INDEX.
    
    This patch mirrors upstream behavior. It unblocks booting from
    distributions such as Alpine Linux.
    
    PR:             286702
    Approved-by:    lwhsu
    Differential Revision:  https://reviews.freebsd.org/D55633
---
 sysutils/grub2-bhyve/Makefile           |  2 +-
 sysutils/grub2-bhyve/files/patch-ext2.c | 42 +++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/sysutils/grub2-bhyve/Makefile b/sysutils/grub2-bhyve/Makefile
index e0b8866ce671..9b92c08a405d 100644
--- a/sysutils/grub2-bhyve/Makefile
+++ b/sysutils/grub2-bhyve/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	grub2-bhyve
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.40
-PORTREVISION=	11
+PORTREVISION=	12
 CATEGORIES=	sysutils
 
 PATCH_SITES+=	https://github.com/grehan-freebsd/grub2-bhyve/commit/
diff --git a/sysutils/grub2-bhyve/files/patch-ext2.c b/sysutils/grub2-bhyve/files/patch-ext2.c
new file mode 100644
index 000000000000..571791222b2d
--- /dev/null
+++ b/sysutils/grub2-bhyve/files/patch-ext2.c
@@ -0,0 +1,42 @@
+--- grub-core/fs/ext2.c
++++ grub-core/fs/ext2.c
+@@ -100,7 +100,10 @@ GRUB_MOD_LICENSE ("GPLv3+");
+ #define EXT2_FEATURE_INCOMPAT_META_BG		0x0010
+ #define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* Extents used */
+ #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
++#define EXT4_FEATURE_INCOMPAT_MMP		0x0100
+ #define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
++#define EXT4_FEATURE_INCOMPAT_CSUM_SEED		0x2000
++#define EXT4_FEATURE_INCOMPAT_LARGEDIR		0x4000 /* >2GB or 3 level htree */
+ 
+ /* The set of back-incompatible features this driver DOES support. Add (OR)
+  * flags here as the related features are implemented into the driver.  */
+@@ -114,8 +117,26 @@ GRUB_MOD_LICENSE ("GPLv3+");
+  *                 journal because they will ignore the journal, but the next
+  *                 ext3 driver to mount the volume will find the journal and
+  *                 replay it, potentially corrupting the metadata written by
+- *                 the ext2 drivers. Safe to ignore for this RO driver.  */
+-#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER )
++ *                 the ext2 drivers. Safe to ignore for this RO driver.
++ * mmp:            Not really back-incompatible - was added as such to
++ *                 avoid multiple read-write mounts. Safe to ignore for this
++ *                 RO driver.
++ * checksum seed:  Not really back-incompatible - was added to allow tools
++ *                 such as tune2fs to change the UUID on a mounted metadata
++ *                 checksummed filesystem. Safe to ignore for now since the
++ *                 driver doesn't support checksum verification. However, it
++ *                 has to be removed from this list if the support is added later.
++ * large_dir:      Not back-incompatible given that the GRUB ext2 driver does
++ *                 not implement EXT2_FEATURE_COMPAT_DIR_INDEX. If the GRUB
++ *                 eventually supports the htree feature (aka dir_index)
++ *                 it should support 3 level htrees and then move
++ *                 EXT4_FEATURE_INCOMPAT_LARGEDIR to
++ *                 EXT2_DRIVER_SUPPORTED_INCOMPAT.
++ */
++#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
++                                      | EXT4_FEATURE_INCOMPAT_MMP \
++                                      | EXT4_FEATURE_INCOMPAT_CSUM_SEED \
++                                      | EXT4_FEATURE_INCOMPAT_LARGEDIR)
+ 
+ 
+ #define EXT3_JOURNAL_MAGIC_NUMBER	0xc03b3998U


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69d777f0.476c1.4e5e1a06>