1*4882a593SmuzhiyunSUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader" 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunDESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \ 4*4882a593Smuzhiyunintended to unify bootloading across x86 operating systems. In \ 5*4882a593Smuzhiyunaddition to loading the Linux kernel, it implements the Multiboot \ 6*4882a593Smuzhiyunstandard, which allows for flexible loading of multiple boot images." 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunHOMEPAGE = "http://www.gnu.org/software/grub/" 9*4882a593SmuzhiyunSECTION = "bootloaders" 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunLICENSE = "GPL-3.0-only" 12*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunCVE_PRODUCT = "grub2" 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunSRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ 17*4882a593Smuzhiyun file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \ 18*4882a593Smuzhiyun file://autogen.sh-exclude-pc.patch \ 19*4882a593Smuzhiyun file://grub-module-explicitly-keeps-symbole-.module_license.patch \ 20*4882a593Smuzhiyun file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ 21*4882a593Smuzhiyun file://determinism.patch \ 22*4882a593Smuzhiyun file://0001-RISC-V-Restore-the-typcast-to-long.patch \ 23*4882a593Smuzhiyun file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \ 24*4882a593Smuzhiyun file://0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch \ 25*4882a593Smuzhiyun file://video-Remove-trailing-whitespaces.patch \ 26*4882a593Smuzhiyun file://CVE-2021-3695-video-readers-png-Drop-greyscale-support-to-fix-heap.patch \ 27*4882a593Smuzhiyun file://CVE-2021-3696-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff.patch \ 28*4882a593Smuzhiyun file://video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch \ 29*4882a593Smuzhiyun file://video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch \ 30*4882a593Smuzhiyun file://CVE-2021-3697-video-readers-jpeg-Block-int-underflow-wild-pointer.patch \ 31*4882a593Smuzhiyun file://CVE-2022-28733-net-ip-Do-IP-fragment-maths-safely.patch \ 32*4882a593Smuzhiyun file://CVE-2022-28734-net-http-Fix-OOB-write-for-split-http-headers.patch \ 33*4882a593Smuzhiyun file://CVE-2022-28734-net-http-Error-out-on-headers-with-LF-without-CR.patch \ 34*4882a593Smuzhiyun file://CVE-2022-28735-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch \ 35*4882a593Smuzhiyun file://0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch \ 36*4882a593Smuzhiyun file://CVE-2022-2601.patch \ 37*4882a593Smuzhiyun file://CVE-2022-3775.patch \ 38*4882a593Smuzhiyun file://loader-efi-chainloader-Simplify-the-loader-state.patch \ 39*4882a593Smuzhiyun file://commands-boot-Add-API-to-pass-context-to-loader.patch \ 40*4882a593Smuzhiyun file://CVE-2022-28736-loader-efi-chainloader-Use-grub_loader_set_ex.patch \ 41*4882a593Smuzhiyun" 42*4882a593Smuzhiyun 43*4882a593SmuzhiyunSRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun# Applies only to RHEL 46*4882a593SmuzhiyunCVE_CHECK_IGNORE += "CVE-2019-14865" 47*4882a593Smuzhiyun# Applies only to SUSE 48*4882a593SmuzhiyunCVE_CHECK_IGNORE += "CVE-2021-46705" 49*4882a593Smuzhiyun 50*4882a593SmuzhiyunDEPENDS = "flex-native bison-native gettext-native" 51*4882a593Smuzhiyun 52*4882a593SmuzhiyunCOMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)' 53*4882a593SmuzhiyunCOMPATIBLE_HOST:armv7a = 'null' 54*4882a593SmuzhiyunCOMPATIBLE_HOST:armv7ve = 'null' 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun# configure.ac has code to set this automagically from the target tuple 57*4882a593Smuzhiyun# but the OE freeform one (core2-foo-bar-linux) don't work with that. 58*4882a593Smuzhiyun 59*4882a593SmuzhiyunGRUBPLATFORM:arm = "efi" 60*4882a593SmuzhiyunGRUBPLATFORM:aarch64 = "efi" 61*4882a593SmuzhiyunGRUBPLATFORM:riscv32 = "efi" 62*4882a593SmuzhiyunGRUBPLATFORM:riscv64 = "efi" 63*4882a593SmuzhiyunGRUBPLATFORM ??= "pc" 64*4882a593Smuzhiyun 65*4882a593Smuzhiyuninherit autotools gettext texinfo pkgconfig 66*4882a593Smuzhiyun 67*4882a593SmuzhiyunCFLAGS:remove = "-O2" 68*4882a593Smuzhiyun 69*4882a593SmuzhiyunEXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ 70*4882a593Smuzhiyun --disable-grub-mkfont \ 71*4882a593Smuzhiyun --program-prefix="" \ 72*4882a593Smuzhiyun --enable-liblzma=no \ 73*4882a593Smuzhiyun --enable-libzfs=no \ 74*4882a593Smuzhiyun --enable-largefile \ 75*4882a593Smuzhiyun --disable-werror \ 76*4882a593Smuzhiyun" 77*4882a593Smuzhiyun 78*4882a593SmuzhiyunPACKAGECONFIG ??= "" 79*4882a593SmuzhiyunPACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse" 80*4882a593SmuzhiyunPACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper" 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun# grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and 83*4882a593Smuzhiyun# OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict 84*4882a593Smuzhiyun# with that. Note that since BUILD_CFLAGS etc are not used by grub2 target 85*4882a593Smuzhiyun# builds, it's safe to clear them unconditionally for both target and native. 86*4882a593SmuzhiyunBUILD_CPPFLAGS = "" 87*4882a593SmuzhiyunBUILD_CFLAGS = "" 88*4882a593SmuzhiyunBUILD_CXXFLAGS = "" 89*4882a593SmuzhiyunBUILD_LDFLAGS = "" 90*4882a593Smuzhiyun 91*4882a593Smuzhiyunexport PYTHON = "python3" 92*4882a593Smuzhiyun 93*4882a593Smuzhiyundo_configure:prepend() { 94*4882a593Smuzhiyun cd ${S} 95*4882a593Smuzhiyun FROM_BOOTSTRAP=1 ${S}/autogen.sh 96*4882a593Smuzhiyun cd ${B} 97*4882a593Smuzhiyun} 98