grub2.inc 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
  2. DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
  3. intended to unify bootloading across x86 operating systems. In \
  4. addition to loading the Linux kernel, it implements the Multiboot \
  5. standard, which allows for flexible loading of multiple boot images."
  6. HOMEPAGE = "http://www.gnu.org/software/grub/"
  7. SECTION = "bootloaders"
  8. LICENSE = "GPL-3.0-only"
  9. LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
  10. CVE_PRODUCT = "grub2"
  11. SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
  12. file://autogen.sh-exclude-pc.patch \
  13. file://grub-module-explicitly-keeps-symbole-.module_license.patch \
  14. file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
  15. file://0001-RISC-V-Restore-the-typcast-to-long.patch \
  16. file://0001-misc-Implement-grub_strlcpy.patch \
  17. file://CVE-2024-45781.patch \
  18. file://CVE-2024-45782_CVE-2024-56737.patch \
  19. "
  20. SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91"
  21. CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL"
  22. CVE_STATUS[CVE-2023-4001] = "not-applicable-platform: Applies only to RHEL/Fedora"
  23. CVE_STATUS[CVE-2024-1048] = "not-applicable-platform: Applies only to RHEL/Fedora"
  24. DEPENDS = "flex-native bison-native gettext-native"
  25. GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv.*)-(linux.*|freebsd.*)'
  26. COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
  27. # Grub doesn't support hard float toolchain and won't be able to forcefully
  28. # disable it on some of the target CPUs. See 'configure.ac' for
  29. # supported/unsupported CPUs in hardfp.
  30. COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
  31. COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
  32. # configure.ac has code to set this automagically from the target tuple
  33. # but the OE freeform one (core2-foo-bar-linux) don't work with that.
  34. GRUBPLATFORM:arm = "efi"
  35. GRUBPLATFORM:aarch64 = "efi"
  36. GRUBPLATFORM:riscv32 = "efi"
  37. GRUBPLATFORM:riscv64 = "efi"
  38. GRUBPLATFORM ??= "pc"
  39. inherit autotools gettext texinfo pkgconfig
  40. CFLAGS:remove = "-O2"
  41. # It doesn't support sse, its make.defaults sets:
  42. # CFLAGS += -mno-mmx -mno-sse
  43. # So also remove -mfpmath=sse from TUNE_CCARGS
  44. TUNE_CCARGS:remove = "-mfpmath=sse"
  45. EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
  46. --disable-grub-mkfont \
  47. --program-prefix="" \
  48. --enable-liblzma=no \
  49. --enable-libzfs=no \
  50. --enable-largefile \
  51. --disable-werror \
  52. "
  53. PACKAGECONFIG ??= ""
  54. PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
  55. PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper"
  56. # grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
  57. # OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
  58. # with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
  59. # builds, it's safe to clear them unconditionally for both target and native.
  60. BUILD_CPPFLAGS = ""
  61. BUILD_CFLAGS = ""
  62. BUILD_CXXFLAGS = ""
  63. BUILD_LDFLAGS = ""
  64. export PYTHON = "python3"
  65. do_configure:prepend() {
  66. cd ${S}
  67. # Remove in next version.
  68. # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e
  69. echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst
  70. FROM_BOOTSTRAP=1 ${S}/autogen.sh
  71. cd ${B}
  72. }