Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader" |
| 2 | |
| 3 | DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \ |
| 4 | intended to unify bootloading across x86 operating systems. In \ |
| 5 | addition to loading the Linux kernel, it implements the Multiboot \ |
| 6 | standard, which allows for flexible loading of multiple boot images." |
| 7 | |
| 8 | HOMEPAGE = "http://www.gnu.org/software/grub/" |
| 9 | SECTION = "bootloaders" |
| 10 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 11 | LICENSE = "GPL-3.0-only" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
| 13 | |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 14 | CVE_PRODUCT = "grub2" |
| 15 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 16 | SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 17 | file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 18 | 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 Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 21 | file://determinism.patch \ |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 22 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 23 | file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 24 | file://0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 25 | file://video-Remove-trailing-whitespaces.patch \ |
| 26 | file://CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch \ |
| 27 | file://CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch \ |
| 28 | file://video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch \ |
| 29 | file://video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch \ |
| 30 | file://CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch \ |
| 31 | file://CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch \ |
| 32 | file://CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch \ |
| 33 | file://CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch \ |
| 34 | file://CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 35 | file://0001-configure-Remove-obsoleted-malign-jumps-loops-functi.patch \ |
| 36 | file://0002-configure-Check-for-falign-jumps-1-beside-falign-loo.patch \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 37 | file://loader-efi-chainloader-Simplify-the-loader-state.patch \ |
| 38 | file://commands-boot-Add-API-to-pass-context-to-loader.patch \ |
| 39 | file://CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch\ |
| 40 | file://0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch \ |
| 41 | file://CVE-2022-2601.patch \ |
| 42 | file://CVE-2022-3775.patch \ |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 43 | file://0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch \ |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 44 | file://0001-fs-ext2-Ignore-checksum-seed-incompat-feature.patch \ |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 45 | file://CVE-2023-4692.patch \ |
| 46 | file://CVE-2023-4693.patch \ |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 47 | file://0001-fs-fat-Don-t-error-when-mtime-is-0.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 48 | " |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 49 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 50 | SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 51 | |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 52 | CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL" |
| 53 | CVE_STATUS[CVE-2021-46705] = "not-applicable-platform: Applies only to SUSE" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 54 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 55 | DEPENDS = "flex-native bison-native gettext-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 57 | GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' |
| 58 | COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}" |
| 59 | # Grub doesn't support hard float toolchain and won't be able to forcefully |
| 60 | # disable it on some of the target CPUs. See 'configure.ac' for |
| 61 | # supported/unsupported CPUs in hardfp. |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 62 | COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}" |
| 63 | COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 64 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 65 | # configure.ac has code to set this automagically from the target tuple |
| 66 | # but the OE freeform one (core2-foo-bar-linux) don't work with that. |
| 67 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | GRUBPLATFORM:arm = "efi" |
| 69 | GRUBPLATFORM:aarch64 = "efi" |
| 70 | GRUBPLATFORM:riscv32 = "efi" |
| 71 | GRUBPLATFORM:riscv64 = "efi" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 72 | GRUBPLATFORM ??= "pc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 74 | inherit autotools gettext texinfo pkgconfig |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | CFLAGS:remove = "-O2" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 77 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 78 | EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ |
| 79 | --disable-grub-mkfont \ |
| 80 | --program-prefix="" \ |
| 81 | --enable-liblzma=no \ |
| 82 | --enable-libzfs=no \ |
| 83 | --enable-largefile \ |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 84 | --disable-werror \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 85 | " |
| 86 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 87 | PACKAGECONFIG ??= "" |
| 88 | PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 89 | PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 91 | # grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and |
| 92 | # OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict |
| 93 | # with that. Note that since BUILD_CFLAGS etc are not used by grub2 target |
| 94 | # builds, it's safe to clear them unconditionally for both target and native. |
| 95 | BUILD_CPPFLAGS = "" |
| 96 | BUILD_CFLAGS = "" |
| 97 | BUILD_CXXFLAGS = "" |
| 98 | BUILD_LDFLAGS = "" |
| 99 | |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 100 | export PYTHON = "python3" |
| 101 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 102 | do_configure:prepend() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 103 | cd ${S} |
| 104 | FROM_BOOTSTRAP=1 ${S}/autogen.sh |
| 105 | cd ${B} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 106 | } |