diff options
Diffstat (limited to 'meta/recipes-bsp/grub')
18 files changed, 353 insertions, 391 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 index ce3238f3a1..6b73878cc0 100644 --- 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 @@ -1,4 +1,4 @@ -From fb7b827a56b1f92f882d0f5ef130acc968b23293 Mon Sep 17 00:00:00 2001 +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 @@ -22,17 +22,17 @@ 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 +Upstream-Status: Pending +--- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 26d2f33..9ce56de 100644 +index 7656f24..0868ea9 100644 --- a/configure.ac +++ b/configure.ac -@@ -783,7 +783,7 @@ fi +@@ -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. @@ -41,6 +41,3 @@ index 26d2f33..9ce56de 100644 fi # GRUB doesn't use float or doubles at all. Yet some toolchains may decide --- -2.7.0 - 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 new file mode 100644 index 0000000000..2f15a91f68 --- /dev/null +++ b/meta/recipes-bsp/grub/files/0001-RISC-V-Restore-the-typcast-to-long.patch @@ -0,0 +1,39 @@ +From e4c41db74b8972285cbdfe614c95c1ffd97d70e1 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 + +this makes the type promotions clear and explicit +It was already typecasted to long but was accidentally dropped in [1] +which stated to cause failures on riscv32 as reported in [2] + +[1] https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2bf40e9e5be9808b17852e688eead87acff14420 +[2] https://savannah.gnu.org/bugs/index.php?60283 + +Upstream-Status: Submitted +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Cc: Andreas Schwab <schwab@suse.de> +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 +--- a/util/grub-mkimagexx.c ++++ b/util/grub-mkimagexx.c +@@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, + */ + + sym_addr += addend; +- off = sym_addr - target_section_addr - offset - image_target->vaddr_offset; ++ off = (grub_int64_t)sym_addr - target_section_addr - offset - image_target->vaddr_offset; + + switch (ELF_R_TYPE (info)) + { +-- +2.31.1 + diff --git a/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch deleted file mode 100644 index 67dc115491..0000000000 --- a/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Mon, 13 Apr 2015 17:02:13 -0700 -Subject: [PATCH] Unset need_charset_alias when building for musl - -localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 -which actually shoudl be fixed in gnulib and then all downstream -projects will get it eventually. For now we apply the fix to -coreutils - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - lib/gnulib.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: grub-2.00/grub-core/gnulib/Makefile.am -=================================================================== ---- grub-2.00.orig/grub-core/gnulib/Makefile.am -+++ grub-2.00/grub-core/gnulib/Makefile.am -@@ -410,7 +410,7 @@ install-exec-localcharset: all-local - case '$(host_os)' in \ - darwin[56]*) \ - need_charset_alias=true ;; \ -- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ -+ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ - need_charset_alias=false ;; \ - *) \ - need_charset_alias=true ;; \ diff --git a/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch b/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch new file mode 100644 index 0000000000..c575a31161 --- /dev/null +++ b/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch @@ -0,0 +1,47 @@ +From f1217c803cec90813eb834dde7829f4961b2a2e4 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 17 Feb 2022 15:07:02 -0800 +Subject: [PATCH] configure.ac: Use _zicsr_zifencei extentions on riscv + +From version 2.38, binutils defaults to ISA spec version 20191213. This +means that the csr read/write (csrr*/csrw*) instructions and fence.i +instruction has separated from the `I` extension, become two standalone +extensions: Zicsr and Zifencei. + +The fix is to specify those extensions explicitely in -march. Since we +are now using binutils 2.38+ in OE this is ok, a more upstreamable fix for +grub will be to detect these extentions, however thats not easy to +implement + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + configure.ac | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c7fc55a..072f2c9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -849,14 +849,14 @@ if test x"$platform" != xemu ; then + [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], []) + fi + if test "x$target_cpu" = xriscv32; then +- CFLAGS="$TARGET_CFLAGS -march=rv32imac -mabi=ilp32 -Werror" ++ CFLAGS="$TARGET_CFLAGS -march=rv32imac_zicsr_zifencei -mabi=ilp32 -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], +- [grub_cv_target_cc_soft_float="-march=rv32imac -mabi=ilp32"], []) ++ [grub_cv_target_cc_soft_float="-march=rv32imac_zicsr_zifencei -mabi=ilp32"], []) + fi + if test "x$target_cpu" = xriscv64; then +- CFLAGS="$TARGET_CFLAGS -march=rv64imac -mabi=lp64 -Werror" ++ CFLAGS="$TARGET_CFLAGS -march=rv64imac_zicsr_zifencei -mabi=lp64 -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], +- [grub_cv_target_cc_soft_float="-march=rv64imac -mabi=lp64"], []) ++ [grub_cv_target_cc_soft_float="-march=rv64imac_zicsr_zifencei -mabi=lp64"], []) + fi + if test "x$target_cpu" = xia64; then + CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror" +-- +2.35.1 + diff --git a/meta/recipes-bsp/grub/files/0001-grub-setup-Debug-message-cleanup.patch b/meta/recipes-bsp/grub/files/0001-grub-setup-Debug-message-cleanup.patch deleted file mode 100644 index e01fcdffb0..0000000000 --- a/meta/recipes-bsp/grub/files/0001-grub-setup-Debug-message-cleanup.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 4e9d9358e0cda6d01020005eb6343e3b69f7201a Mon Sep 17 00:00:00 2001 -From: Cao jin <caoj.fnst@cn.fujitsu.com> -Date: Tue, 3 Jul 2018 18:51:13 +0800 -Subject: [PATCH] grub-setup: Debug message cleanup - -Variable "root" is initialized after root device probing and is null in -current place, so, drop it. - -Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- -Upstream-Status: Backport [http://git.savannah.gnu.org/cgit/grub.git/commit/?id=4e9d9358e0cda6d01020005eb6343e3b69f7201a] - - util/setup.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/util/setup.c b/util/setup.c -index 80363075d..9c1e1b7da 100644 ---- a/util/setup.c -+++ b/util/setup.c -@@ -305,9 +305,8 @@ SETUP (const char *dir, - bl.first_block = (struct grub_boot_blocklist *) (core_img - + GRUB_DISK_SECTOR_SIZE - - sizeof (*bl.block)); -- grub_util_info ("root is `%s', dest is `%s'", root, dest); - -- grub_util_info ("Opening dest"); -+ grub_util_info ("Opening dest `%s'", dest); - dest_dev = grub_device_open (dest); - if (! dest_dev) - grub_util_error ("%s", grub_errmsg); --- -2.17.2 (Apple Git-113) - 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 d5bfaa177a..69b04aa56f 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 b512c77222a8b133d7dd71a0dcef081a921d97d4 Mon Sep 17 00:00:00 2001 +From 8f47ed4aaefba087b6ca76e59c9f832b6a0702bc 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 @@ -11,18 +11,19 @@ to util/grub.d/20_linux_xen.in to keep compatibility. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- + Upstream-Status: Inappropriate [OE specific] +--- util/grub.d/10_linux.in | 6 +++--- util/grub.d/20_linux_xen.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 859b608..946be5d 100644 +index 4532266..cba2617 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in -@@ -148,12 +148,12 @@ machine=`uname -m` +@@ -164,12 +164,12 @@ machine=`uname -m` case "x$machine" in xi?86 | xx86_64) list= @@ -39,10 +40,10 @@ index 859b608..946be5d 100644 done ;; esac diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index f532fb9..1994244 100644 +index 96179ea..98d16ae 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in -@@ -138,7 +138,7 @@ EOF +@@ -154,7 +154,7 @@ EOF } linux_list= @@ -51,6 +52,3 @@ index f532fb9..1994244 100644 if grub_file_is_not_garbage "$i"; then basename=$(basename $i) version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") --- -2.7.0 - diff --git a/meta/recipes-bsp/grub/files/0001-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch b/meta/recipes-bsp/grub/files/0001-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch deleted file mode 100644 index 61d58c4047..0000000000 --- a/meta/recipes-bsp/grub/files/0001-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch +++ /dev/null @@ -1,76 +0,0 @@ -Upstream-Status: Backport -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From 842c390469e2c2e10b5aa36700324cd3bde25875 Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" <hjl.tools@gmail.com> -Date: Sat, 17 Feb 2018 06:47:28 -0800 -Subject: [PATCH] x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32 - -Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a: - -https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a - -x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for -32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as -R_X86_64_PC32. - -Signed-off-by: H.J. Lu <hjl.tools@gmail.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/efiemu/i386/loadcore64.c | 1 + - grub-core/kern/x86_64/dl.c | 1 + - util/grub-mkimagexx.c | 1 + - util/grub-module-verifier.c | 1 + - 4 files changed, 4 insertions(+) - -diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c -index e49d0b6ff..18facf47f 100644 ---- a/grub-core/efiemu/i386/loadcore64.c -+++ b/grub-core/efiemu/i386/loadcore64.c -@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - err = grub_efiemu_write_value (addr, - *addr32 + rel->r_addend - + sym.off -diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c -index 440690673..3a73e6e6c 100644 ---- a/grub-core/kern/x86_64/dl.c -+++ b/grub-core/kern/x86_64/dl.c -@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - { - grub_int64_t value; - value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - -diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index a2bb05439..39d7efb91 100644 ---- a/util/grub-mkimagexx.c -+++ b/util/grub-mkimagexx.c -@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - { - grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -index 9179285a5..a79271f66 100644 ---- a/util/grub-module-verifier.c -+++ b/util/grub-module-verifier.c -@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = { - -1 - }, (int[]){ - R_X86_64_PC32, -+ R_X86_64_PLT32, - -1 - } - }, --- -2.11.0 - diff --git a/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch b/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch new file mode 100644 index 0000000000..dae26fd8bb --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch @@ -0,0 +1,49 @@ +From 0adec29674561034771c13e446069b41ef41e4d4 Mon Sep 17 00:00:00 2001 +From: Michael Chang <mchang@suse.com> +Date: Fri, 3 Dec 2021 16:13:28 +0800 +Subject: [PATCH] grub-mkconfig: Restore umask for the grub.cfg + +The commit ab2e53c8a (grub-mkconfig: Honor a symlink when generating +configuration by grub-mkconfig) has inadvertently discarded umask for +creating grub.cfg in the process of running grub-mkconfig. The resulting +wrong permission (0644) would allow unprivileged users to read GRUB +configuration file content. This presents a low confidentiality risk +as grub.cfg may contain non-secured plain-text passwords. + +This patch restores the missing umask and sets the creation file mode +to 0600 preventing unprivileged access. + +Fixes: CVE-2021-3981 + +Signed-off-by: Michael Chang <mchang@suse.com> +Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> + +Upstream-Status: Backport +CVE: CVE-2021-3981 + +Reference to upstream patch: +https://git.savannah.gnu.org/cgit/grub.git/commit/?id=0adec29674561034771c13e446069b41ef41e4d4 + +Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> +--- + util/grub-mkconfig.in | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index c3ea7612e..62335d027 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -301,7 +301,10 @@ and /etc/grub.d/* files or please file a bug report with + exit 1 + else + # none of the children aborted with error, install the new grub.cfg ++ oldumask=$(umask) ++ umask 077 + cat ${grub_cfg}.new > ${grub_cfg} ++ umask $oldumask + rm -f ${grub_cfg}.new + fi + fi +-- +2.31.1 + 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 fc5aa4e313..1323a54a59 100644 --- a/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch +++ b/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch @@ -1,6 +1,6 @@ -From ff8f68cc48fd3c30d55e1d570d51f2e0952c968e Mon Sep 17 00:00:00 2001 -From: Robert Yang <liezhi.yang@windriver.com> -Date: Sat, 25 Jan 2014 23:49:44 -0500 +From 8790aa8bea736f52341a0430ff3e317d3be0f99b 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 Exclude the .pc from po/POTFILES.in since quilt uses "patch --backup", @@ -12,23 +12,25 @@ try to read it. 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 +- + autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh -index 7424428..843619e 100755 +index 31b0ced7e..c63ae766c 100755 --- a/autogen.sh +++ b/autogen.sh -@@ -5,7 +5,7 @@ set -e +@@ -13,7 +13,7 @@ fi export LC_COLLATE=C unset LC_ALL --find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in -+find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' ! -path './.pc/*' | sort > po/POTFILES.in +-find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' ! -ipath './gnulib/*' ! -ipath './grub-core/lib/gnulib/*' |sort > po/POTFILES.in ++find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' ! -ipath './gnulib/*' ! -ipath './grub-core/lib/gnulib/*' ! -path './.pc/*' |sort > po/POTFILES.in find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in echo "Importing unicode..." -- -1.7.10.4 +2.17.1 diff --git a/meta/recipes-bsp/grub/files/determinism.patch b/meta/recipes-bsp/grub/files/determinism.patch new file mode 100644 index 0000000000..2828e80975 --- /dev/null +++ b/meta/recipes-bsp/grub/files/determinism.patch @@ -0,0 +1,68 @@ +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/fix.build.with.gcc-7.patch b/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch deleted file mode 100644 index f35df97bfc..0000000000 --- a/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch +++ /dev/null @@ -1,39 +0,0 @@ -* e.g. with gentoo gcc-7.1 they define _FORTIFY_SOURCE by default with: - https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/7.1.0/gentoo/10_all_default-fortify-source.patch?view=markup - which results in following error while building grub-efi-native: - ./config-util.h:1504:48: error: this use of "defined" may not be portable [-Werror=expansion-to-defined] - || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ - ^~~~~~~~~~~~~~~ - this part comes from gnulib and it's used only for Apple and BSD, - so we can ignore it, but we cannot add -Wno-error=expansion-to-defined - because this warning was introduced only in gcc-7 and older gcc - will fail with: - cc1: error: -Werror=expansion-to-defined: no option -Wexpansion-to-defined - use #pragma to work around this - -Upstream-Status: Pending (should be fixed in gnulib which is then rarely updated in grub) - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> - -diff -uNr grub-2.02.old/m4/extern-inline.m4 grub-2.02/m4/extern-inline.m4 ---- grub-2.02.old/m4/extern-inline.m4 2016-02-28 15:22:21.000000000 +0100 -+++ grub-2.02/m4/extern-inline.m4 2017-08-22 19:26:45.213637276 +0200 -@@ -39,6 +39,10 @@ - OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and - for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. - Assume DragonFly and FreeBSD will be similar. */ -+#pragma GCC diagnostic push -+#if __GNUC__ >= 7 -+#pragma GCC diagnostic ignored "-Wexpansion-to-defined" -+#endif - #if (((defined __APPLE__ && defined __MACH__) \ - || defined __DragonFly__ || defined __FreeBSD__) \ - && (defined __header_inline \ -@@ -50,6 +52,7 @@ - && defined __GNUC__ && ! defined __cplusplus)))) - # define _GL_EXTERN_INLINE_STDHEADER_BUG - #endif -+#pragma GCC diagnostic pop - #if ((__GNUC__ \ - ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ - : (199901L <= __STDC_VERSION__ \ diff --git a/meta/recipes-bsp/grub/files/gcc8.patch b/meta/recipes-bsp/grub/files/gcc8.patch deleted file mode 100644 index fa7331f1b3..0000000000 --- a/meta/recipes-bsp/grub/files/gcc8.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 -From: Michael Chang <mchang@suse.com> -Date: Mon, 26 Mar 2018 16:52:34 +0800 -Subject: Fix packed-not-aligned error on GCC 8 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When building with GCC 8, there are several errors regarding packed-not-aligned. - -./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] - -This patch fixes the build error by cleaning up the ambiguity of placing -aligned structure in a packed one. In "struct grub_btrfs_time" and "struct -grub_gpt_part_type", the aligned attribute seems to be superfluous, and also -has to be packed, to ensure the structure is bit-to-bit mapped to the format -laid on disk. I think we could blame to copy and paste error here for the -mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as -the name suggests. :) - -Signed-off-by: Michael Chang <mchang@suse.com> -Tested-by: Michael Chang <mchang@suse.com> -Tested-by: Paul Menzel <paulepanter@users.sourceforge.net> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> - -Upstream-Status: Backport http://git.savannah.gnu.org/cgit/grub.git/commit/?id=563b1da6e6ae7af46cc8354cadb5dab416989f0a ---- - grub-core/fs/btrfs.c | 2 +- - include/grub/efiemu/runtime.h | 2 +- - include/grub/gpt_partition.h | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 4849c1c..be19544 100644 ---- a/grub-core/fs/btrfs.c -+++ b/grub-core/fs/btrfs.c -@@ -175,7 +175,7 @@ struct grub_btrfs_time - { - grub_int64_t sec; - grub_uint32_t nanosec; --} __attribute__ ((aligned (4))); -+} GRUB_PACKED; - - struct grub_btrfs_inode - { -diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h -index 9b6b729..36d2ded 100644 ---- a/include/grub/efiemu/runtime.h -+++ b/include/grub/efiemu/runtime.h -@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel - - struct efi_variable - { -- grub_efi_guid_t guid; -+ grub_efi_packed_guid_t guid; - grub_uint32_t namelen; - grub_uint32_t size; - grub_efi_uint32_t attributes; -diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h -index 1b32f67..9668a68 100644 ---- a/include/grub/gpt_partition.h -+++ b/include/grub/gpt_partition.h -@@ -28,7 +28,7 @@ struct grub_gpt_part_type - grub_uint16_t data2; - grub_uint16_t data3; - grub_uint8_t data4[8]; --} __attribute__ ((aligned(8))); -+} GRUB_PACKED; - typedef struct grub_gpt_part_type grub_gpt_part_type_t; - - #define GRUB_GPT_PARTITION_TYPE_EMPTY \ --- -cgit v1.0-41-gc330 - 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 ffc2d40d89..26890261b7 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,13 +1,14 @@ -From 7461a3de38b66edbe2f5593f9bdab9f2704d32bc Mon Sep 17 00:00:00 2001 +From 917133acc701dbc4636165d3b08d15dc5829a06f 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 While using oe-core toolchain to strip grub module 'all_video.mod', it stripped symbol table: --------------- -root@localhost:~# objdump -t all_video.mod +--------------- +root@localhost:~# objdump -t all_video.mod + all_video.mod: file format elf64-x86-64 SYMBOL TABLE: @@ -43,16 +44,16 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> grub-core/genmod.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -Index: grub-2.02/grub-core/genmod.sh.in -=================================================================== ---- grub-2.02.orig/grub-core/genmod.sh.in -+++ grub-2.02/grub-core/genmod.sh.in -@@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; th +diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in +index 1250589..dd14308 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 if test x@platform@ != xemu; then @TARGET_STRIP@ --strip-unneeded \ -K grub_mod_init -K grub_mod_fini \ - -K _grub_mod_init -K _grub_mod_fini \ + -K _grub_mod_init -K _grub_mod_fini -K .module_license \ -R .note.gnu.gold-version -R .note.GNU-stack \ - -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1 - fi + -R .gnu.build.attributes \ + -R .rel.gnu.build.attributes \ diff --git a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb index 750f8c808a..783e30bf38 100644 --- a/meta/recipes-bsp/grub/grub-bootconf_1.00.bb +++ b/meta/recipes-bsp/grub/grub-bootconf_1.00.bb @@ -1,11 +1,16 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" SUMMARY = "Basic grub.cfg for use in EFI systems" +DESCRIPTION = "Grub might require different configuration file for \ +different machines." +HOMEPAGE = "https://www.gnu.org/software/grub/manual/grub/grub.html#Configuration" -RPROVIDES_${PN} += "virtual/grub-bootconf" +RPROVIDES:${PN} += "virtual-grub-bootconf" inherit grub-efi-cfg +require conf/image-uefi.conf + S = "${WORKDIR}" GRUB_CFG = "${S}/grub-bootconf" @@ -20,10 +25,8 @@ python do_configure() { do_configure[vardeps] += "APPEND ROOT" do_install() { - install -d ${D}/boot - install -d ${D}/boot/EFI - install -d ${D}/boot/EFI/BOOT - install grub-bootconf ${D}/boot/EFI/BOOT/grub.cfg + install -d ${D}${EFI_FILES_PATH} + install grub-bootconf ${D}${EFI_FILES_PATH}/grub.cfg } -FILES_${PN} = "/boot/EFI/BOOT/grub.cfg" +FILES:${PN} = "${EFI_FILES_PATH}/grub.cfg" diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb b/meta/recipes-bsp/grub/grub-efi_2.06.bb index 14fce97ff0..9857e8e036 100644 --- a/meta/recipes-bsp/grub/grub-efi_2.02.bb +++ b/meta/recipes-bsp/grub/grub-efi_2.06.bb @@ -1,9 +1,11 @@ require grub2.inc +require conf/image-uefi.conf + GRUBPLATFORM = "efi" -DEPENDS_append_class-target = " grub-efi-native" -RDEPENDS_${PN}_class-target = "diffutils freetype grub-common virtual/grub-bootconf" +DEPENDS:append = " grub-native" +RDEPENDS:${PN} = "grub-common virtual-grub-bootconf" SRC_URI += " \ file://cfg \ @@ -18,18 +20,19 @@ python __anonymous () { prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-" if target == "x86_64": grubtarget = 'x86_64' - grubimage = prefix + "bootx64.efi" elif re.match('i.86', target): grubtarget = 'i386' - grubimage = prefix + "bootia32.efi" elif re.match('aarch64', target): grubtarget = 'arm64' - grubimage = prefix + "bootaa64.efi" elif re.match('arm', target): grubtarget = 'arm' - grubimage = prefix + "bootarm.efi" + elif re.match('riscv64', target): + grubtarget = 'riscv64' + elif re.match('riscv32', target): + grubtarget = 'riscv32' else: raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target) + grubimage = prefix + d.getVar("EFI_BOOT_IMAGE") d.setVar("GRUB_TARGET", grubtarget) d.setVar("GRUB_IMAGE", grubimage) prefix = "grub-efi-" if prefix == "" else "" @@ -41,38 +44,28 @@ inherit deploy CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN=" EXTRA_OECONF += "--enable-efiemu=no" -# ldm.c:114:7: error: trampoline generated for nested function 'hook' [-Werror=trampolines] -# and many other places in the grub code when compiled with some native gcc compilers (specifically, gentoo) -CFLAGS_append_class-native = " -Wno-error=trampolines" - 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 /EFI/BOOT -d ./grub-core/ \ + grub-mkimage -v -c ../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 -do_mkimage_class-native() { - : -} - -do_install_append_class-target() { - install -d ${D}/boot - install -d ${D}/boot/EFI - install -d ${D}/boot/EFI/BOOT - install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}/boot/EFI/BOOT/${GRUB_IMAGE} -} - -do_install_class-native() { - install -d ${D}${bindir} - install -m 755 grub-mkimage ${D}${bindir} -} - -do_install_class-target() { +do_install() { oe_runmake 'DESTDIR=${D}' -C grub-core install # Remove build host references... @@ -82,31 +75,31 @@ do_install_class-target() { -e 's|${DEBUG_PREFIX_MAP}||g' \ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ {} + + + install -d ${D}${EFI_FILES_PATH} + 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} } -do_deploy_class-native() { - : -} - addtask deploy after do_install before do_build -FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \ +FILES:${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \ ${datadir}/grub \ - /boot/EFI/BOOT/${GRUB_IMAGE} \ + ${EFI_FILES_PATH}/${GRUB_IMAGE} \ " - # 64-bit binaries are expected for the bootloader with an x32 userland -INSANE_SKIP_${PN}_append_linux-gnux32 = " arch" -INSANE_SKIP_${PN}-dbg_append_linux-gnux32 = " arch" -INSANE_SKIP_${PN}_append_linux-muslx32 = " arch" -INSANE_SKIP_${PN}-dbg_append_linux-muslx32 = " arch" - -BBCLASSEXTEND = "native" +INSANE_SKIP:${PN}:append:linux-gnux32 = " arch" +INSANE_SKIP:${PN}-dbg:append:linux-gnux32 = " arch" +INSANE_SKIP:${PN}:append:linux-muslx32 = " arch" +INSANE_SKIP:${PN}-dbg:append:linux-muslx32 = " arch" diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 8e0f86217c..ba0596c938 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc @@ -8,37 +8,45 @@ 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" -SRC_URI = "https://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ +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://0001-Unset-need_charset_alias-when-building-for-musl.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://fix.build.with.gcc-7.patch \ - file://gcc8.patch \ - file://0001-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch \ - file://0001-grub-setup-Debug-message-cleanup.patch \ + file://determinism.patch \ + file://0001-RISC-V-Restore-the-typcast-to-long.patch \ + file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \ + file://0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch \ " -SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d" -SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d" -DEPENDS = "flex-native bison-native" +SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" + +# Applies only to RHEL +CVE_CHECK_IGNORE += "CVE-2019-14865" + +DEPENDS = "flex-native bison-native gettext-native" -COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)' -COMPATIBLE_HOST_armv7a = 'null' -COMPATIBLE_HOST_armv7ve = 'null' +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' +COMPATIBLE_HOST:armv7a = 'null' +COMPATIBLE_HOST:armv7ve = 'null' # 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. -GRUBPLATFORM_arm = "efi" -GRUBPLATFORM_aarch64 = "efi" +GRUBPLATFORM:arm = "efi" +GRUBPLATFORM:aarch64 = "efi" +GRUBPLATFORM:riscv32 = "efi" +GRUBPLATFORM:riscv64 = "efi" GRUBPLATFORM ??= "pc" -inherit autotools gettext texinfo +inherit autotools gettext texinfo pkgconfig + +CFLAGS:remove = "-O2" EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ --disable-grub-mkfont \ @@ -46,6 +54,7 @@ EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ --enable-liblzma=no \ --enable-libzfs=no \ --enable-largefile \ + --disable-werror \ " PACKAGECONFIG ??= "" @@ -61,13 +70,10 @@ BUILD_CFLAGS = "" BUILD_CXXFLAGS = "" BUILD_LDFLAGS = "" -do_configure_prepend() { - # The grub2 configure script uses variables such as TARGET_CFLAGS etc - # for its own purposes. Remove the OE versions from the environment to - # avoid conflicts. - unset TARGET_CPPFLAGS TARGET_CFLAGS TARGET_CXXFLAGS TARGET_LDFLAGS - ( cd ${S} - ${S}/autogen.sh ) -} +export PYTHON = "python3" -RDEPENDS_${PN}_class-native = "" +do_configure:prepend() { + cd ${S} + FROM_BOOTSTRAP=1 ${S}/autogen.sh + cd ${B} +} diff --git a/meta/recipes-bsp/grub/grub_2.02.bb b/meta/recipes-bsp/grub/grub_2.02.bb deleted file mode 100644 index e0973759fb..0000000000 --- a/meta/recipes-bsp/grub/grub_2.02.bb +++ /dev/null @@ -1,29 +0,0 @@ -require grub2.inc - -RDEPENDS_${PN}-common += "${PN}-editenv" -RDEPENDS_${PN} += "diffutils freetype ${PN}-common" - -RPROVIDES_${PN}-editenv += "${PN}-efi-editenv" - -PACKAGES =+ "${PN}-editenv ${PN}-common" -FILES_${PN}-editenv = "${bindir}/grub-editenv" -FILES_${PN}-common = " \ - ${bindir} \ - ${sysconfdir} \ - ${sbindir} \ - ${datadir}/grub \ -" - -do_install_append () { - install -d ${D}${sysconfdir}/grub.d - # Remove build host references... - find "${D}" -name modinfo.sh -type f -exec \ - sed -i \ - -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ - {} + -} - -INSANE_SKIP_${PN} = "arch" -INSANE_SKIP_${PN}-dbg = "arch" diff --git a/meta/recipes-bsp/grub/grub_2.06.bb b/meta/recipes-bsp/grub/grub_2.06.bb new file mode 100644 index 0000000000..05d462785c --- /dev/null +++ b/meta/recipes-bsp/grub/grub_2.06.bb @@ -0,0 +1,41 @@ +require grub2.inc + +RDEPENDS:${PN}-common += "${PN}-editenv" +RDEPENDS:${PN} += "${PN}-common" +RDEPENDS:${PN}:class-native = "" + +RPROVIDES:${PN}-editenv += "${PN}-efi-editenv" + +PROVIDES:append:class-native = " grub-efi-native" + +PACKAGES =+ "${PN}-editenv ${PN}-common" +FILES:${PN}-editenv = "${bindir}/grub-editenv" +FILES:${PN}-common = " \ + ${bindir} \ + ${sysconfdir} \ + ${sbindir} \ + ${datadir}/grub \ +" +ALLOW_EMPTY:${PN} = "1" + +do_install:append () { + # Avoid conflicts with the EFI package for systems such as arm64 where we + # need to build grub and grub-efi but only EFI is supported by removing EFI + # from this package. + rm -rf ${D}${libdir}/grub/*-efi/ + rmdir --ignore-fail-on-non-empty ${D}${libdir}/grub ${D}${libdir} + + install -d ${D}${sysconfdir}/grub.d + # Remove build host references... + find "${D}" -name modinfo.sh -type f -exec \ + sed -i \ + -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ + {} + +} + +INSANE_SKIP:${PN} = "arch" +INSANE_SKIP:${PN}-dbg = "arch" + +BBCLASSEXTEND = "native nativesdk" |