blob: 45852ab9b1cc4dcd01865e22a0bd8dcc0d0a0126 [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 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 \
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000024 file://0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025"
Andrew Geissler95ac1b82021-03-31 14:34:31 -050026
Andrew Geissler09036742021-06-25 14:25:14 -050027SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070028
29# Applies only to RHEL
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000030CVE_CHECK_IGNORE += "CVE-2019-14865"
Andrew Geissler9aee5002022-03-30 16:27:02 +000031# Applies only to SUSE
32CVE_CHECK_IGNORE += "CVE-2021-46705"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070033
Brad Bishop08902b02019-08-20 09:16:51 -040034DEPENDS = "flex-native bison-native gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035
Andrew Geissler6ce62a22020-11-30 19:58:47 -060036COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
Patrick Williams213cb262021-08-07 19:21:33 -050037COMPATIBLE_HOST:armv7a = 'null'
38COMPATIBLE_HOST:armv7ve = 'null'
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039
Brad Bishopd7bf8c12018-02-25 22:55:05 -050040# configure.ac has code to set this automagically from the target tuple
41# but the OE freeform one (core2-foo-bar-linux) don't work with that.
42
Patrick Williams213cb262021-08-07 19:21:33 -050043GRUBPLATFORM:arm = "efi"
44GRUBPLATFORM:aarch64 = "efi"
45GRUBPLATFORM:riscv32 = "efi"
46GRUBPLATFORM:riscv64 = "efi"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050047GRUBPLATFORM ??= "pc"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048
Andrew Geissler82c905d2020-04-13 13:39:40 -050049inherit autotools gettext texinfo pkgconfig
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
Patrick Williams213cb262021-08-07 19:21:33 -050051CFLAGS:remove = "-O2"
William A. Kennington IIIac69b482021-06-02 12:28:27 -070052
Brad Bishopd7bf8c12018-02-25 22:55:05 -050053EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
54 --disable-grub-mkfont \
55 --program-prefix="" \
56 --enable-liblzma=no \
57 --enable-libzfs=no \
58 --enable-largefile \
Brad Bishop08902b02019-08-20 09:16:51 -040059 --disable-werror \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050060"
61
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062PACKAGECONFIG ??= ""
63PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
Brad Bishop316dfdd2018-06-25 12:45:53 -040064PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050066# grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
67# OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
68# with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
69# builds, it's safe to clear them unconditionally for both target and native.
70BUILD_CPPFLAGS = ""
71BUILD_CFLAGS = ""
72BUILD_CXXFLAGS = ""
73BUILD_LDFLAGS = ""
74
Brad Bishop96ff1982019-08-19 13:50:42 -040075export PYTHON = "python3"
76
Patrick Williams213cb262021-08-07 19:21:33 -050077do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050078 cd ${S}
79 FROM_BOOTSTRAP=1 ${S}/autogen.sh
80 cd ${B}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050081}