diff options
Diffstat (limited to 'meta/recipes-bsp/grub')
-rw-r--r-- | meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch | 43 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch | 10 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch | 10 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch | 10 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/files/determinism.patch | 68 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch | 9 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub-bootconf_1.00.bb | 3 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub-efi_2.12.bb (renamed from meta/recipes-bsp/grub/grub-efi_2.06.bb) | 18 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 33 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub_2.12.bb (renamed from meta/recipes-bsp/grub/grub_2.06.bb) | 0 |
10 files changed, 60 insertions, 144 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch b/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch deleted file mode 100644 index 6b73878cc0..0000000000 --- a/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 96d9aa55d29b24e2490d5647a9efc66940fc400f Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 13 Jan 2016 19:17:31 +0000 -Subject: [PATCH] Disable -mfpmath=sse as well when SSE is disabled - -Fixes - -configure:20574: i586-poky-linux-gcc -m32 -march=core2 -msse3 --mtune=generic -mfpmath=sse ---sysroot=/usr/local/dev/yocto/grubtest2/build/tmp/sysroots/emenlow -o -conftest -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow --Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g --falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse --mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector --mno-stack-arg-probe -Werror -nostdlib -Wl,--defsym,___main=0x8100 --Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include --DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -Wl,-O1 --Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5 -conftest.c:1:0: error: SSE instruction set disabled, using 387 -arithmetics [-Werror] -cc1: all warnings being treated as errors - -Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -Upstream-Status: Pending ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 7656f24..0868ea9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -824,7 +824,7 @@ fi - if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then - # Some toolchains enable these features by default, but they need - # registers that aren't set up properly in GRUB. -- TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow" -+ TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387" - fi - - # GRUB doesn't use float or doubles at all. Yet some toolchains may decide diff --git a/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch b/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch index 2f15a91f68..cafa711731 100644 --- a/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch +++ b/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch @@ -1,4 +1,4 @@ -From e4c41db74b8972285cbdfe614c95c1ffd97d70e1 Mon Sep 17 00:00:00 2001 +From b47029e8e582d17c6874d2622fe1a5b834377dbb Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 26 Mar 2021 11:59:43 -0700 Subject: [PATCH] RISC-V: Restore the typcast to 64bit type @@ -17,15 +17,16 @@ Cc: Daniel Kiper <daniel.kiper@oracle.com> Cc: Chester Lin <clin@suse.com> Cc: Nikita Ermakov <arei@altlinux.org> Cc: Alistair Francis <alistair.francis@wdc.com> + --- util/grub-mkimagexx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index 00f49ccaa..ac677d03d 100644 +index e50b295..2f09255 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c -@@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, +@@ -1310,7 +1310,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, */ sym_addr += addend; @@ -34,6 +35,3 @@ index 00f49ccaa..ac677d03d 100644 switch (ELF_R_TYPE (info)) { --- -2.31.1 - diff --git a/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch b/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch index 69b04aa56f..69dec7695a 100644 --- a/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch +++ b/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch @@ -1,4 +1,4 @@ -From 8f47ed4aaefba087b6ca76e59c9f832b6a0702bc Mon Sep 17 00:00:00 2001 +From a80592e20f6c4b928a22862f52f268ab9d9908b2 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 13 Jan 2016 19:28:00 +0000 Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name @@ -20,10 +20,10 @@ Upstream-Status: Inappropriate [OE specific] 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 4532266..cba2617 100644 +index cc393be..8545cb6 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -164,12 +164,12 @@ machine=`uname -m` +@@ -166,12 +166,12 @@ machine=`uname -m` case "x$machine" in xi?86 | xx86_64) list= @@ -40,10 +40,10 @@ index 4532266..cba2617 100644 done ;; esac diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index 96179ea..98d16ae 100644 +index 94dd8be..36cd554 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in -@@ -154,7 +154,7 @@ EOF +@@ -181,7 +181,7 @@ EOF } linux_list= diff --git a/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch b/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch index 1323a54a59..f8dfda90ab 100644 --- a/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch +++ b/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch @@ -1,4 +1,4 @@ -From 8790aa8bea736f52341a0430ff3e317d3be0f99b Mon Sep 17 00:00:00 2001 +From 14c1d0459fb3561e627d3a5f6e91a0d2f7b4aa45 Mon Sep 17 00:00:00 2001 From: Naveen Saini <naveen.kumar.saini@intel.com> Date: Mon, 15 Mar 2021 14:44:15 +0800 Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in @@ -14,15 +14,16 @@ Upstream-Status: Inappropriate [OE specific] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> + --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh -index 31b0ced7e..c63ae766c 100755 +index 195daa5..773b7b4 100755 --- a/autogen.sh +++ b/autogen.sh -@@ -13,7 +13,7 @@ fi +@@ -26,7 +26,7 @@ fi export LC_COLLATE=C unset LC_ALL @@ -31,6 +32,3 @@ index 31b0ced7e..c63ae766c 100755 find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in echo "Importing unicode..." --- -2.17.1 - diff --git a/meta/recipes-bsp/grub/files/determinism.patch b/meta/recipes-bsp/grub/files/determinism.patch deleted file mode 100644 index 2828e80975..0000000000 --- a/meta/recipes-bsp/grub/files/determinism.patch +++ /dev/null @@ -1,68 +0,0 @@ -From b6f9b3f6fa782807c4a7ec16ee8ef868cdfbf468 Mon Sep 17 00:00:00 2001 -From: Naveen Saini <naveen.kumar.saini@intel.com> -Date: Mon, 15 Mar 2021 14:56:18 +0800 -Subject: [PATCH] The output in moddep.lst generated from syminfo.lst using - genmoddep.awk is not deterministic since the order of the dependencies on - each line can vary depending on how awk sorts the values in the array. - -Be deterministic in the output by sorting the dependencies on each line. - -Also, the output of the SOURCES lines in grub-core/Makefile.core.am, generated -from grub-core/Makefile.core.def with gentpl.py is not deterministic due to -missing sorting of the list used to generate it. Add such a sort. - -Also ensure the generated unidata.c file is deterministic by sorting the -keys of the dict. - -Upstream-Status: Pending -Richard Purdie <richard.purdie@linuxfoundation.org> -Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> ---- - gentpl.py | 1 + - grub-core/genmoddep.awk | 4 +++- - util/import_unicode.py | 2 +- - 3 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/gentpl.py b/gentpl.py -index c86550d4f..589285192 100644 ---- a/gentpl.py -+++ b/gentpl.py -@@ -568,6 +568,7 @@ def foreach_platform_value(defn, platform, suffix, closure): - for group in RMAP[platform]: - for value in defn.find_all(group + suffix): - r.append(closure(value)) -+ r.sort() - return ''.join(r) - - def platform_conditional(platform, closure): -diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk -index 04c2863e5..247436392 100644 ---- a/grub-core/genmoddep.awk -+++ b/grub-core/genmoddep.awk -@@ -59,7 +59,9 @@ END { - } - modlist = "" - depcount[mod] = 0 -- for (depmod in uniqmods) { -+ n = asorti(uniqmods, w) -+ for (i = 1; i <= n; i++) { -+ depmod = w[i] - modlist = modlist " " depmod; - inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod - depcount[mod]++ -diff --git a/util/import_unicode.py b/util/import_unicode.py -index 08f80591e..1f434a069 100644 ---- a/util/import_unicode.py -+++ b/util/import_unicode.py -@@ -174,7 +174,7 @@ infile.close () - - outfile.write ("struct grub_unicode_arabic_shape grub_unicode_arabic_shapes[] = {\n ") - --for x in arabicsubst: -+for x in sorted(arabicsubst): - try: - if arabicsubst[x]['join'] == "DUAL": - outfile.write ("{0x%x, 0x%x, 0x%x, 0x%x, 0x%x},\n " % (arabicsubst[x][0], arabicsubst[x][1], arabicsubst[x][2], arabicsubst[x][3], arabicsubst[x][4])) --- -2.17.1 - diff --git a/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch b/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch index 26890261b7..7c8770ce8b 100644 --- a/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch +++ b/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch @@ -1,4 +1,4 @@ -From 917133acc701dbc4636165d3b08d15dc5829a06f Mon Sep 17 00:00:00 2001 +From b316ed326bd492106006d78f5bfcd767b49a4f2e Mon Sep 17 00:00:00 2001 From: Hongxu Jia <hongxu.jia@windriver.com> Date: Wed, 17 Aug 2016 04:06:34 -0400 Subject: [PATCH] grub module explicitly keeps symbole .module_license @@ -8,7 +8,7 @@ it stripped symbol table: --------------- root@localhost:~# objdump -t all_video.mod - + all_video.mod: file format elf64-x86-64 SYMBOL TABLE: @@ -37,15 +37,16 @@ SYMBOL TABLE: 0000000000000000 l d .modname 0000000000000000 .modname -------------- -Upstream-Status: Pending +Upstream-Status: Inappropriate [workaround that needs investigation into @TARGET_STRIP@ behaviour in oe-core vs toolchain used by upstream] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + --- grub-core/genmod.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index 1250589..dd14308 100644 +index e57c4d9..42bb1ba 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then diff --git a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb index 783e30bf38..fed3c7e9a3 100644 --- a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb +++ b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb @@ -11,7 +11,8 @@ inherit grub-efi-cfg require conf/image-uefi.conf -S = "${WORKDIR}" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" GRUB_CFG = "${S}/grub-bootconf" LABELS = "boot" diff --git a/meta/recipes-bsp/grub/grub-efi_2.06.bb b/meta/recipes-bsp/grub/grub-efi_2.12.bb index a8cc209a02..7df77deca3 100644 --- a/meta/recipes-bsp/grub/grub-efi_2.06.bb +++ b/meta/recipes-bsp/grub/grub-efi_2.12.bb @@ -46,11 +46,21 @@ EXTRA_OECONF += "--enable-efiemu=no" do_mkimage() { cd ${B} + + GRUB_MKIMAGE_MODULES="${GRUB_BUILDIN}" + + # If 'all' is included in GRUB_BUILDIN we will include all available grub2 modules + if [ "${@ bb.utils.contains('GRUB_BUILDIN', 'all', 'True', 'False', d)}" = "True" ]; then + bbdebug 1 "Including all available modules" + # Get the list of all .mod files in grub-core build directory + GRUB_MKIMAGE_MODULES=$(find ${B}/grub-core/ -type f -name "*.mod" -exec basename {} .mod \;) + fi + # Search for the grub.cfg on the local boot media by using the # built in cfg file provided via this recipe - grub-mkimage -c ../cfg -p ${EFIDIR} -d ./grub-core/ \ + grub-mkimage -v -c ${UNPACKDIR}/cfg -p ${EFIDIR} -d ./grub-core/ \ -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \ - ${GRUB_BUILDIN} + ${GRUB_MKIMAGE_MODULES} } addtask mkimage before do_install after do_compile @@ -70,9 +80,13 @@ do_install() { install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}${EFI_FILES_PATH}/${GRUB_IMAGE} } +# To include all available modules, add 'all' to GRUB_BUILDIN GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \ efi_gop iso9660 configfile search loadenv test" +# 'xen_boot' is a module valid only for aarch64 +GRUB_BUILDIN:append:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' xen_boot', '', d)}" + do_deploy() { install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR} } diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index bb791347dc..07b4000e04 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc @@ -8,30 +8,36 @@ standard, which allows for flexible loading of multiple boot images." HOMEPAGE = "http://www.gnu.org/software/grub/" SECTION = "bootloaders" -LICENSE = "GPLv3" +LICENSE = "GPL-3.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" CVE_PRODUCT = "grub2" SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ - file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \ file://autogen.sh-exclude-pc.patch \ file://grub-module-explicitly-keeps-symbole-.module_license.patch \ file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ - file://determinism.patch \ file://0001-RISC-V-Restore-the-typcast-to-long.patch \ " -SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" +SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" -# Applies only to RHEL -CVE_CHECK_WHITELIST += "CVE-2019-14865" +CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL" +CVE_STATUS[CVE-2021-46705] = "not-applicable-platform: Applies only to SUSE" +CVE_STATUS[CVE-2023-4001] = "not-applicable-platform: Applies only to RHEL/Fedora" +CVE_STATUS[CVE-2024-1048] = "not-applicable-platform: Applies only to RHEL/Fedora" +CVE_STATUS[CVE-2023-4692] = "cpe-incorrect: Fixed in version 2.12 already" +CVE_STATUS[CVE-2023-4693] = "cpe-incorrect: Fixed in version 2.12 already" DEPENDS = "flex-native bison-native gettext-native" -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' -COMPATIBLE_HOST:armv7a = 'null' -COMPATIBLE_HOST:armv7ve = 'null' +GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' +COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}" +# Grub doesn't support hard float toolchain and won't be able to forcefully +# disable it on some of the target CPUs. See 'configure.ac' for +# supported/unsupported CPUs in hardfp. +COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}" +COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}" # configure.ac has code to set this automagically from the target tuple # but the OE freeform one (core2-foo-bar-linux) don't work with that. @@ -45,6 +51,10 @@ GRUBPLATFORM ??= "pc" inherit autotools gettext texinfo pkgconfig CFLAGS:remove = "-O2" +# It doesn't support sse, its make.defaults sets: +# CFLAGS += -mno-mmx -mno-sse +# So also remove -mfpmath=sse from TUNE_CCARGS +TUNE_CCARGS:remove = "-mfpmath=sse" EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ --disable-grub-mkfont \ @@ -72,6 +82,11 @@ export PYTHON = "python3" do_configure:prepend() { cd ${S} + + # Remove in next version. + # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e + echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst + FROM_BOOTSTRAP=1 ${S}/autogen.sh cd ${B} } diff --git a/meta/recipes-bsp/grub/grub_2.06.bb b/meta/recipes-bsp/grub/grub_2.12.bb index 05d462785c..05d462785c 100644 --- a/meta/recipes-bsp/grub/grub_2.06.bb +++ b/meta/recipes-bsp/grub/grub_2.12.bb |