From 53ce584c8f0106928b99b9462763de9245d56bbd Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 23:28:55 +0100 Subject: [PATCH] merge specfile changes from 2.04: updated patch to customize boot message posttrans: use OS name from /etc/os-release when building EFI loaders add -theme-starfield subpackage [release 2.06-6mamba;Thu Apr 20 2023] --- ...02_beta3-openmamba-default-nomodeset.patch | 44 ------ grub-2.04-binutils-2.36.patch | 44 ------ grub-2.04-e2fsprogs-1.47.patch | 23 --- grub-2.06-e2fsprogs-1.47.patch | 135 ++++++++++++++++++ grub-2.06-openmamba-default-nomodeset.patch | 18 +++ grub.spec | 69 +++++---- grub2-default | 1 + 7 files changed, 194 insertions(+), 140 deletions(-) delete mode 100644 grub-2.02_beta3-openmamba-default-nomodeset.patch delete mode 100644 grub-2.04-binutils-2.36.patch delete mode 100644 grub-2.04-e2fsprogs-1.47.patch create mode 100644 grub-2.06-e2fsprogs-1.47.patch create mode 100644 grub-2.06-openmamba-default-nomodeset.patch diff --git a/grub-2.02_beta3-openmamba-default-nomodeset.patch b/grub-2.02_beta3-openmamba-default-nomodeset.patch deleted file mode 100644 index 1a7812b..0000000 --- a/grub-2.02_beta3-openmamba-default-nomodeset.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- grub-2.02_beta3/util/grub.d/10_linux.in.orig 2016-08-25 21:54:04.745747726 +0200 -+++ grub-2.02_beta3/util/grub.d/10_linux.in 2016-08-25 21:58:24.552485179 +0200 -@@ -225,8 +225,13 @@ - fi - - if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then -- linux_entry "${OS}" "${version}" simple \ -- "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -+ if [ "x${GRUB_DEFAULT_NOMODESET}" = xtrue ]; then -+ linux_entry "${OS} (proprietary video driver)" "${version}" nomodeset \ -+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} nomodeset" -+ else -+ linux_entry "${OS}" "${version}" simple \ -+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -+ fi - - submenu_indentation="$grub_tab" - -@@ -242,8 +247,13 @@ - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" - fi - -- linux_entry "${OS} (proprietary video driver)" "${version}" nomodeset \ -- "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} nomodeset" -+ if [ "x${GRUB_DEFAULT_NOMODESET}" = xtrue ]; then -+ linux_entry "${OS}" "${version}" simple \ -+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -+ else -+ linux_entry "${OS} (proprietary video driver)" "${version}" nomodeset \ -+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} nomodeset" -+ fi - - linux_entry "${OS} (with debug messages)" "${version}" debug \ - "${GRUB_CMDLINE_LINUX} debug" ---- grub-2.02_beta3/util/grub-mkconfig.in.orig 2016-08-25 22:00:24.140179518 +0200 -+++ grub-2.02_beta3/util/grub-mkconfig.in 2016-08-25 22:25:21.236957757 +0200 -@@ -230,6 +230,7 @@ - GRUB_SAVEDEFAULT \ - GRUB_ENABLE_CRYPTODISK \ - GRUB_BADRAM \ -+ GRUB_DEFAULT_NOMODESET \ - GRUB_OS_PROBER_SKIP_LIST \ - GRUB_DISABLE_SUBMENU - diff --git a/grub-2.04-binutils-2.36.patch b/grub-2.04-binutils-2.36.patch deleted file mode 100644 index 5cb3270..0000000 --- a/grub-2.04-binutils-2.36.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 5cea201f288246488e2189c49d969d00ebec2898 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Fri, 19 Feb 2021 17:40:43 +0800 -Subject: [PATCH] Fix build error in binutils 2.36 - -The build fails in binutils 2.36 - -[ 520s] cat kernel_syms.lst > syminfo.lst.new -[ 520s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: section .note.gnu.property VMA [0000000000400158,0000000000400187] overlaps section .bss VMA [000000000000f000,000000000041e1af] - -It is caused by assembler now generates the GNU property notes section -by default. Use the assmbler option -mx86-used-note=no to disable the -section from being generated to workaround the ensuing linker issue. - -Signed-off-by: Michael Chang ---- - configure.ac | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/configure.ac b/configure.ac -index fa8f74bb9..38ee5f579 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -836,6 +836,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p - TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow" - fi - -+if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then -+ AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [ -+ CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror" -+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], -+ [grub_cv_cc_mx86_used_note=yes], -+ [grub_cv_cc_mx86_used_note=no]) -+ ]) -+ -+ if test "x$grub_cv_cc_mx86_used_note" = xyes; then -+ TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no" -+ TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no" -+ fi -+fi -+ - # GRUB doesn't use float or doubles at all. Yet some toolchains may decide - # that floats are a good fit to run instead of what's written in the code. - # Given that floating point unit is disabled (if present to begin with) diff --git a/grub-2.04-e2fsprogs-1.47.patch b/grub-2.04-e2fsprogs-1.47.patch deleted file mode 100644 index 9de1a80..0000000 --- a/grub-2.04-e2fsprogs-1.47.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -Nru grub-2.04/grub-core/fs/ext2.c grub-2.04/grub-core/fs/ext2.c ---- grub-2.04/grub-core/fs/ext2.c 2019-04-23 10:54:47.000000000 +0200 -+++ grub-2.04/grub-core/fs/ext2.c 2023-03-04 14:37:37.639563356 +0100 -@@ -102,6 +102,8 @@ - #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 */ - #define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 - - /* The set of back-incompatible features this driver DOES support. Add (OR) -@@ -124,7 +126,9 @@ - * RO driver. - */ - #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \ -- | EXT4_FEATURE_INCOMPAT_MMP) -+ | EXT4_FEATURE_INCOMPAT_MMP \ -+ | EXT4_FEATURE_INCOMPAT_CSUM_SEED \ -+ | EXT4_FEATURE_INCOMPAT_LARGEDIR) - - - #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U diff --git a/grub-2.06-e2fsprogs-1.47.patch b/grub-2.06-e2fsprogs-1.47.patch new file mode 100644 index 0000000..c90fc06 --- /dev/null +++ b/grub-2.06-e2fsprogs-1.47.patch @@ -0,0 +1,135 @@ +Submitted By: Xi Ruoyao +Date: 2023-02-18 +Initial Package Version: 2.06 +Upstream Status: Committed +Origin: Upstream git repository, commit SHA follows: + 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 + 2e9fa73a040462b81bfbfe56c0bc7ad2d30b446b +Description: Recognize ext2/3/4 filesystem features + metdata_csum_seed and large_dir; ignore them as + they are not used by GRUB and can be safely + ignored, instead of treat these unrecognized + features as hard errors. Particularly, the + metadata_csum_seed feature is enabled by + e2fsprogs >= 1.47.0, so failing to recognize it + will cause grub-install failure if the /boot + partition (or /, when /boot is not a separate + partition) is created by a recent mkfs.ext4. + +From 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Fri, 11 Jun 2021 21:36:16 +0200 +Subject: [PATCH] fs/ext2: Ignore checksum seed incompat feature + +This incompat feature is used to denote that the filesystem stored its +metadata checksum seed in the superblock. This is used to allow tune2fs +changing the UUID on a mounted metdata_csum filesystem without having +to rewrite all the disk metadata. However, the GRUB doesn't use the +metadata checksum at all. So, it can just ignore this feature if it +is enabled. This is consistent with the GRUB filesystem code in general +which just does a best effort to access the filesystem's data. + +The checksum seed incompat feature has to be removed from the ignore +list if the support for metadata checksum verification is added to the +GRUB ext2 driver later. + +Suggested-by: Eric Sandeen +Suggested-by: Lukas Czerner +Signed-off-by: Javier Martinez Canillas +Reviewed-by: Lukas Czerner +Reviewed-by: Daniel Kiper +--- + grub-core/fs/ext2.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c +index e7dd78e66..4953a1591 100644 +--- a/grub-core/fs/ext2.c ++++ b/grub-core/fs/ext2.c +@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #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_ENCRYPT 0x10000 + + /* The set of back-incompatible features this driver DOES support. Add (OR) +@@ -123,10 +124,15 @@ GRUB_MOD_LICENSE ("GPLv3+"); + * 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. + */ + #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \ +- | EXT4_FEATURE_INCOMPAT_MMP) +- ++ | EXT4_FEATURE_INCOMPAT_MMP \ ++ | EXT4_FEATURE_INCOMPAT_CSUM_SEED) + + #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U + +-- +2.39.2 + +From 2e9fa73a040462b81bfbfe56c0bc7ad2d30b446b Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 30 Aug 2022 22:41:59 -0400 +Subject: [PATCH] fs/ext2: Ignore the large_dir incompat feature + +Recently, ext4 added the large_dir feature, which adds support for +a 3 level htree directory support. + +The GRUB supports existing file systems with htree directories by +ignoring their existence, and since the index nodes for the hash tree +look like deleted directory entries (by design), the GRUB can simply do +a brute force O(n) linear search of directories. The same is true for +3 level deep htrees indicated by large_dir feature flag. + +Hence, it is safe for the GRUB to ignore the large_dir incompat feature. + +Fixes: https://savannah.gnu.org/bugs/?61606 + +Signed-off-by: Theodore Ts'o +Reviewed-by: Daniel Kiper +--- + grub-core/fs/ext2.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c +index 0989e26e1..e1cc5e62a 100644 +--- a/grub-core/fs/ext2.c ++++ b/grub-core/fs/ext2.c +@@ -104,6 +104,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); + #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 */ + #define EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 + + /* The set of back-incompatible features this driver DOES support. Add (OR) +@@ -129,10 +130,17 @@ GRUB_MOD_LICENSE ("GPLv3+"); + * 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_CSUM_SEED \ ++ | EXT4_FEATURE_INCOMPAT_LARGEDIR) + + #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U + +-- +2.39.2 + diff --git a/grub-2.06-openmamba-default-nomodeset.patch b/grub-2.06-openmamba-default-nomodeset.patch new file mode 100644 index 0000000..cef4f7a --- /dev/null +++ b/grub-2.06-openmamba-default-nomodeset.patch @@ -0,0 +1,18 @@ +--- grub-2.06/util/grub.d/10_linux.in.orig 2021-09-02 20:07:58.277889876 +0200 ++++ grub-2.06/util/grub.d/10_linux.in 2021-09-02 20:09:06.876239109 +0200 +@@ -270,8 +270,13 @@ + fi + + if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then +- linux_entry "${OS}" "${version}" simple \ +- "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" ++ if [ "x${GRUB_DEFAULT_NOMODESET}" = xtrue ]; then ++ linux_entry "${OS} (proprietary video driver)" "${version}" nomodeset \ ++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} nomodeset" ++ else ++ linux_entry "${OS}" "${version}" simple \ ++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" ++ fi + + submenu_indentation="$grub_tab" + diff --git a/grub.spec b/grub.spec index 029799d..80a3866 100644 --- a/grub.spec +++ b/grub.spec @@ -3,8 +3,8 @@ #%define betaver %(echo %version| cut -d. -f3) Name: grub Epoch: 2 -Version: 2.04 -Release: 7mamba +Version: 2.06 +Release: 6mamba Summary: A Multiboot boot loader derived from GRUB, the GRand Unified Bootloader Group: System/Kernel and Hardware Vendor: openmamba @@ -29,12 +29,11 @@ Patch3: %{name}2-1.97-sysconfig.patch Patch9: %{name}2-1.99-fix_saved_entry_default.patch Patch10: grub-2.00-flex-2.5.37.patch Patch11: grub-2.00-gcc-4.5.patch -Patch12: grub-2.02_beta3-openmamba-default-nomodeset.patch +Patch12: grub-2.06-openmamba-default-nomodeset.patch Patch13: grub-2.02-silent-boot.patch Patch14: grub-2.04-fix-enable-nls-install-locale-dir.patch Patch15: grub-2.04-custom-boot-message.patch -Patch16: grub-2.04-binutils-2.36.patch -Patch17: grub-2.04-e2fsprogs-1.47.patch +Patch16: grub-2.06-e2fsprogs-1.47.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -51,7 +50,7 @@ BuildRequires: bison BuildRequires: help2man BuildRequires: flex BuildRequires: dejavu-fonts-ttf -BuildRequires: libzfs-devel +BuildRequires: libzfs-devel >= 2.1.0 Requires: gettext %ifnarch x86_64 aarch64 Requires: vbetest @@ -60,7 +59,7 @@ Requires(post):%{__install_info} Requires: os-prober >= 1.62-2mamba Provides: bootloader Provides: grub2 -Obsoletes: grub2 < 2:2.04-7mamba +Obsoletes: grub2 < 2:2.06 %description GNU GRUB is a Multiboot boot loader. It was derived from GRUB, GRand Unified Bootloader, which was originally designed and implemented by Erich Stefan Boleyn. @@ -81,7 +80,7 @@ Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} Requires: efibootmgr %endif Provides: grub2-efi -Obsoletes: grub2-efi < 2:2.04-7mamba +Obsoletes: grub2-efi < 2:2.06 %description efi GNU GRUB is a Multiboot boot loader. It was derived from GRUB, GRand Unified Bootloader, which was originally designed and implemented by Erich Stefan Boleyn. @@ -110,10 +109,9 @@ This package contains the efi boot files needed to boot according to EFI standar %patch9 -p1 %patch12 -p1 %patch13 -p1 -%patch14 -p1 -%patch15 -p1 -b .custom-boot-message -%patch16 -p1 -b .binutils-2.36 -%patch17 -p1 -b .e2fsprogs-1.47 +#%patch14 -p1 +%patch15 -p1 +%patch16 -p1 gunzip -c %{SOURCE1} > unifont.bdf @@ -237,15 +235,23 @@ install -d -m0755 %{buildroot}/boot/efi #rm -f %{buildroot}%{_sysconfdir}/grub.d/30_os-prober %post -%install_info %{name}.info +%install_info %{name}.info-1 +%install_info %{name}.info-2 +%install_info %{name}-dev.info : %preun -%uninstall_info %{name}.info +%uninstall_info %{name}.info-1 +%uninstall_info %{name}.info-2 +%uninstall_info %{name}-dev.info : %posttrans if [ $1 -ge 1 ]; then + grep GRUB_DISABLE_OS_PROBER /etc/default/grub || \ + cat >> /etc/default/grub << ___EOF +GRUB_DISABLE_OS_PROBER=false +___EOF if [ -e /etc/sysconfig/grub ]; then . /etc/sysconfig/grub fi @@ -256,7 +262,6 @@ if [ $1 -ge 1 ]; then fi : - %posttrans efi if [ $1 -ge 1 ]; then if [ -e /etc/sysconfig/grub ]; then @@ -301,6 +306,7 @@ fi %{_sysconfdir}/grub.d/10_linux %{_sysconfdir}/grub.d/20_linux_xen #%{_sysconfdir}/grub.d/20_other +%{_sysconfdir}/grub.d/30_uefi-firmware #%{_sysconfdir}/grub.d/30_other_linux %{_sysconfdir}/grub.d/30_os-prober %{_sysconfdir}/grub.d/40_custom @@ -344,15 +350,16 @@ fi %{_datadir}/grub/grub-mkconfig_lib %{_datadir}/grub/unicode.pf2 %{_datadir}/grub/widthspec.h -%dir %{_datadir}/grub/themes %{_infodir}/grub-dev.info.gz +%{_infodir}/grub.info-1.gz +%{_infodir}/grub.info-2.gz %dir %{_prefix}/lib/grub %ifarch x86_64 %{ix86} %dir %{_prefix}/lib/grub/i386-pc %{_prefix}/lib/grub/i386-pc/* %endif -%{_mandir}/man1/grub*.1* -%{_mandir}/man8/grub*.8* +%{_mandir}/man1/grub*.1.gz +%{_mandir}/man8/grub*.8.gz %{_datadir}/info/grub.info.gz %doc AUTHORS COPYING #% doc ChangeLog NEWS README THANKS TODO @@ -385,22 +392,26 @@ fi %endif %changelog -* Sat Mar 04 2023 Silvan Calarco 2.04-7mamba -- added upstream patch for ext2 fix following e2fsprogs 1.47 - -* Mon Aug 01 2022 Silvan Calarco 2.04-6mamba -- add required quotes to fix custom boot message in related patch - -* Sat Jul 09 2022 Silvan Calarco 2.04-5mamba +* Thu Apr 20 2023 Silvan Calarco 2.06-6mamba +- merge specfile changes from 2.04: - updated patch to customize boot message - posttrans: use OS name from /etc/os-release when building EFI loaders - add -theme-starfield subpackage -* Sun Jul 03 2022 Silvan Calarco 2.04-4mamba -- patched to fix modules sizes with binutils >= 2.36 (see also https://bugs.funtoo.org/browse/FL-8245 ) +* Sat Mar 04 2023 Silvan Calarco 2.06-5mamba +- added upstream patch for ext2 fix following e2fsprogs 1.47 -* Sat Jul 02 2022 Silvan Calarco 2.04-3mamba -- patched to silence loading linux and initrd messages +* Sat Jul 02 2022 Silvan Calarco 2.06-4mamba +- path conf.d/10_linux.in to remove linux and initrd loading messages + +* Mon Sep 06 2021 Silvan Calarco 2.06-3mamba +- fix openmamba-default-nomodeset path; set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub + +* Sat Sep 04 2021 Silvan Calarco 2.06-2mamba +- rebuilt with zfs 2.1.0 + +* Thu Sep 02 2021 Silvan Calarco 2.06-1mamba +- update to 2.06 * Sun Dec 22 2019 Silvan Calarco 2.04-2mamba - patched to fix installation of locales in /boot/grub/locale directory diff --git a/grub2-default b/grub2-default index a9f7974..a601d69 100644 --- a/grub2-default +++ b/grub2-default @@ -10,3 +10,4 @@ GRUB_SAVEDEFAULT=true #GRUB_SERIAL_COMMAND= GRUB_GFXPAYLOAD_LINUX=keep GRUB_DISABLE_RECOVERY=true +GRUB_DISABLE_OS_PROBER=false