blob: 5685cae0ab46a1b2b5c51e23ae4fb2a809a310f2 [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"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070028
Brad Bishop08902b02019-08-20 09:16:51 -040029DEPENDS = "flex-native bison-native gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030
Andrew Geissler87f5cff2022-09-30 13:13:31 -050031GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
32COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
33# Grub doesn't support hard float toolchain and won't be able to forcefully
34# disable it on some of the target CPUs. See 'configure.ac' for
35# supported/unsupported CPUs in hardfp.
Patrick Williams2390b1b2022-11-03 13:47:49 -050036COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
37COMPATIBLE_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 -050038
Brad Bishopd7bf8c12018-02-25 22:55:05 -050039# configure.ac has code to set this automagically from the target tuple
40# but the OE freeform one (core2-foo-bar-linux) don't work with that.
41
Patrick Williams213cb262021-08-07 19:21:33 -050042GRUBPLATFORM:arm = "efi"
43GRUBPLATFORM:aarch64 = "efi"
44GRUBPLATFORM:riscv32 = "efi"
45GRUBPLATFORM:riscv64 = "efi"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050046GRUBPLATFORM ??= "pc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047
Andrew Geissler82c905d2020-04-13 13:39:40 -050048inherit autotools gettext texinfo pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049
Patrick Williams213cb262021-08-07 19:21:33 -050050CFLAGS:remove = "-O2"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070051
Brad Bishopd7bf8c12018-02-25 22:55:05 -050052EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
53 --disable-grub-mkfont \
54 --program-prefix="" \
55 --enable-liblzma=no \
56 --enable-libzfs=no \
57 --enable-largefile \
Brad Bishop08902b02019-08-20 09:16:51 -040058 --disable-werror \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050059"
60
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061PACKAGECONFIG ??= ""
62PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
Brad Bishop316dfdd2018-06-25 12:45:53 -040063PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050064
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050065# grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
66# OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
67# with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
68# builds, it's safe to clear them unconditionally for both target and native.
69BUILD_CPPFLAGS = ""
70BUILD_CFLAGS = ""
71BUILD_CXXFLAGS = ""
72BUILD_LDFLAGS = ""
73
Brad Bishop96ff1982019-08-19 13:50:42 -040074export PYTHON = "python3"
75
Patrick Williams213cb262021-08-07 19:21:33 -050076do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050077 cd ${S}
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060078
79 # Remove in next version.
80 # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e
81 echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst
82
Andrew Geissler82c905d2020-04-13 13:39:40 -050083 FROM_BOOTSTRAP=1 ${S}/autogen.sh
84 cd ${B}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050085}