blob: bb9aacb478aca986acb10cda9ae7f5e0e0c259a0 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
2
3DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
4intended to unify bootloading across x86 operating systems. In \
5addition to loading the Linux kernel, it implements the Multiboot \
6standard, which allows for flexible loading of multiple boot images."
7
8HOMEPAGE = "http://www.gnu.org/software/grub/"
9SECTION = "bootloaders"
10
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000011LICENSE = "GPL-3.0-only"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
13
Andrew Geissler635e0e42020-08-21 15:58:33 -050014CVE_PRODUCT = "grub2"
15
Andrew Geissler09036742021-06-25 14:25:14 -050016SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017 file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018 file://autogen.sh-exclude-pc.patch \
19 file://grub-module-explicitly-keeps-symbole-.module_license.patch \
20 file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
Andrew Geissler95ac1b82021-03-31 14:34:31 -050021 file://0001-RISC-V-Restore-the-typcast-to-long.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022"
Andrew Geissler95ac1b82021-03-31 14:34:31 -050023
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060024SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070025
Andrew Geissler8f840682023-07-21 09:09:43 -050026CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL"
27CVE_STATUS[CVE-2021-46705] = "not-applicable-platform: Applies only to SUSE"
Patrick Williams73bd93f2024-02-20 08:07:48 -060028CVE_STATUS[CVE-2023-4001] = "not-applicable-platform: Applies only to RHEL/Fedora"
29CVE_STATUS[CVE-2024-1048] = "not-applicable-platform: Applies only to RHEL/Fedora"
Patrick Williams39653562024-03-01 08:54:02 -060030CVE_STATUS[CVE-2023-4692] = "cpe-incorrect: Fixed in version 2.12 already"
31CVE_STATUS[CVE-2023-4693] = "cpe-incorrect: Fixed in version 2.12 already"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070032
Brad Bishop08902b02019-08-20 09:16:51 -040033DEPENDS = "flex-native bison-native gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
Andrew Geissler87f5cff2022-09-30 13:13:31 -050035GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
36COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
37# Grub doesn't support hard float toolchain and won't be able to forcefully
38# disable it on some of the target CPUs. See 'configure.ac' for
39# supported/unsupported CPUs in hardfp.
Patrick Williams2390b1b2022-11-03 13:47:49 -050040COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
41COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042
Brad Bishopd7bf8c12018-02-25 22:55:05 -050043# configure.ac has code to set this automagically from the target tuple
44# but the OE freeform one (core2-foo-bar-linux) don't work with that.
45
Patrick Williams213cb262021-08-07 19:21:33 -050046GRUBPLATFORM:arm = "efi"
47GRUBPLATFORM:aarch64 = "efi"
48GRUBPLATFORM:riscv32 = "efi"
49GRUBPLATFORM:riscv64 = "efi"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050050GRUBPLATFORM ??= "pc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051
Andrew Geissler82c905d2020-04-13 13:39:40 -050052inherit autotools gettext texinfo pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053
Patrick Williams213cb262021-08-07 19:21:33 -050054CFLAGS:remove = "-O2"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070055
Brad Bishopd7bf8c12018-02-25 22:55:05 -050056EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
57 --disable-grub-mkfont \
58 --program-prefix="" \
59 --enable-liblzma=no \
60 --enable-libzfs=no \
61 --enable-largefile \
Brad Bishop08902b02019-08-20 09:16:51 -040062 --disable-werror \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050063"
64
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065PACKAGECONFIG ??= ""
66PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
Brad Bishop316dfdd2018-06-25 12:45:53 -040067PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050069# grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
70# OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
71# with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
72# builds, it's safe to clear them unconditionally for both target and native.
73BUILD_CPPFLAGS = ""
74BUILD_CFLAGS = ""
75BUILD_CXXFLAGS = ""
76BUILD_LDFLAGS = ""
77
Brad Bishop96ff1982019-08-19 13:50:42 -040078export PYTHON = "python3"
79
Patrick Williams213cb262021-08-07 19:21:33 -050080do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050081 cd ${S}
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060082
83 # Remove in next version.
84 # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e
85 echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst
86
Andrew Geissler82c905d2020-04-13 13:39:40 -050087 FROM_BOOTSTRAP=1 ${S}/autogen.sh
88 cd ${B}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050089}