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 | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 21 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 22 | " |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 23 | |
Patrick Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 24 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 25 | |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 26 | CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL" |
| 27 | CVE_STATUS[CVE-2021-46705] = "not-applicable-platform: Applies only to SUSE" |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 28 | CVE_STATUS[CVE-2023-4001] = "not-applicable-platform: Applies only to RHEL/Fedora" |
| 29 | CVE_STATUS[CVE-2024-1048] = "not-applicable-platform: Applies only to RHEL/Fedora" |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 30 | CVE_STATUS[CVE-2023-4692] = "cpe-incorrect: Fixed in version 2.12 already" |
| 31 | CVE_STATUS[CVE-2023-4693] = "cpe-incorrect: Fixed in version 2.12 already" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 32 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 33 | DEPENDS = "flex-native bison-native gettext-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 35 | GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' |
| 36 | COMPATIBLE_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 Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 40 | COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}" |
| 41 | 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] | 42 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 43 | # 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 46 | GRUBPLATFORM:arm = "efi" |
| 47 | GRUBPLATFORM:aarch64 = "efi" |
| 48 | GRUBPLATFORM:riscv32 = "efi" |
| 49 | GRUBPLATFORM:riscv64 = "efi" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 50 | GRUBPLATFORM ??= "pc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 52 | inherit autotools gettext texinfo pkgconfig |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | CFLAGS:remove = "-O2" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 55 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 56 | EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ |
| 57 | --disable-grub-mkfont \ |
| 58 | --program-prefix="" \ |
| 59 | --enable-liblzma=no \ |
| 60 | --enable-libzfs=no \ |
| 61 | --enable-largefile \ |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 62 | --disable-werror \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 63 | " |
| 64 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | PACKAGECONFIG ??= "" |
| 66 | PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 67 | PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 68 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 69 | # 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. |
| 73 | BUILD_CPPFLAGS = "" |
| 74 | BUILD_CFLAGS = "" |
| 75 | BUILD_CXXFLAGS = "" |
| 76 | BUILD_LDFLAGS = "" |
| 77 | |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 78 | export PYTHON = "python3" |
| 79 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 80 | do_configure:prepend() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 81 | cd ${S} |
Patrick Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 82 | |
| 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 87 | FROM_BOOTSTRAP=1 ${S}/autogen.sh |
| 88 | cd ${B} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 89 | } |