blob: a72a562c5ad85446897513a3cedd318c538953ab [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
11LICENSE = "GPLv3"
12LIC_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 Geisslerd1e89492021-02-12 15:35:20 -060021 file://determinism.patch \
Andrew Geissler95ac1b82021-03-31 14:34:31 -050022 file://0001-RISC-V-Restore-the-typcast-to-long.patch \
Andrew Geissler595f6302022-01-24 19:11:47 +000023 file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024"
Andrew Geissler95ac1b82021-03-31 14:34:31 -050025
Andrew Geissler09036742021-06-25 14:25:14 -050026SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070027
28# Applies only to RHEL
29CVE_CHECK_WHITELIST += "CVE-2019-14865"
30
Brad Bishop08902b02019-08-20 09:16:51 -040031DEPENDS = "flex-native bison-native gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032
Andrew Geissler6ce62a22020-11-30 19:58:47 -060033COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
Patrick Williams213cb262021-08-07 19:21:33 -050034COMPATIBLE_HOST:armv7a = 'null'
35COMPATIBLE_HOST:armv7ve = 'null'
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
Brad Bishopd7bf8c12018-02-25 22:55:05 -050037# configure.ac has code to set this automagically from the target tuple
38# but the OE freeform one (core2-foo-bar-linux) don't work with that.
39
Patrick Williams213cb262021-08-07 19:21:33 -050040GRUBPLATFORM:arm = "efi"
41GRUBPLATFORM:aarch64 = "efi"
42GRUBPLATFORM:riscv32 = "efi"
43GRUBPLATFORM:riscv64 = "efi"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050044GRUBPLATFORM ??= "pc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045
Andrew Geissler82c905d2020-04-13 13:39:40 -050046inherit autotools gettext texinfo pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047
Patrick Williams213cb262021-08-07 19:21:33 -050048CFLAGS:remove = "-O2"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070049
Brad Bishopd7bf8c12018-02-25 22:55:05 -050050EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
51 --disable-grub-mkfont \
52 --program-prefix="" \
53 --enable-liblzma=no \
54 --enable-libzfs=no \
55 --enable-largefile \
Brad Bishop08902b02019-08-20 09:16:51 -040056 --disable-werror \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050057"
58
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059PACKAGECONFIG ??= ""
60PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
Brad Bishop316dfdd2018-06-25 12:45:53 -040061PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050063# grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
64# OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
65# with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
66# builds, it's safe to clear them unconditionally for both target and native.
67BUILD_CPPFLAGS = ""
68BUILD_CFLAGS = ""
69BUILD_CXXFLAGS = ""
70BUILD_LDFLAGS = ""
71
Brad Bishop96ff1982019-08-19 13:50:42 -040072export PYTHON = "python3"
73
Patrick Williams213cb262021-08-07 19:21:33 -050074do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050075 cd ${S}
76 FROM_BOOTSTRAP=1 ${S}/autogen.sh
77 cd ${B}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050078}