grub2.inc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. file://CVE-2024-45780.patch \
  20. file://CVE-2024-45783.patch \
  21. file://CVE-2025-0624.patch \
  22. file://CVE-2024-45774.patch \
  23. file://CVE-2024-45775.patch \
  24. file://CVE-2025-0622-01.patch \
  25. file://CVE-2025-0622-02.patch \
  26. file://CVE-2025-0622-03.patch \
  27. file://CVE-2024-45776.patch \
  28. file://CVE-2024-45777.patch \
  29. file://CVE-2025-0690.patch \
  30. file://CVE-2025-1118.patch \
  31. file://CVE-2024-45778_CVE-2024-45779.patch \
  32. file://CVE-2025-0677_CVE-2025-0684_CVE-2025-0685_CVE-2025-0686_CVE-2025-0689.patch \
  33. file://CVE-2025-0678_CVE-2025-1125.patch \
  34. file://CVE-2024-56738.patch \
  35. "
  36. SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91"
  37. CVE_STATUS[CVE-2019-14865] = "not-applicable-platform: applies only to RHEL"
  38. CVE_STATUS[CVE-2023-4001] = "not-applicable-platform: Applies only to RHEL/Fedora"
  39. CVE_STATUS[CVE-2024-1048] = "not-applicable-platform: Applies only to RHEL/Fedora"
  40. DEPENDS = "flex-native bison-native gettext-native"
  41. GRUB_COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|loongarch64.*|riscv.*)-(linux.*|freebsd.*)'
  42. COMPATIBLE_HOST = "${GRUB_COMPATIBLE_HOST}"
  43. # Grub doesn't support hard float toolchain and won't be able to forcefully
  44. # disable it on some of the target CPUs. See 'configure.ac' for
  45. # supported/unsupported CPUs in hardfp.
  46. COMPATIBLE_HOST:armv7a = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
  47. COMPATIBLE_HOST:armv7ve = "${@'null' if bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', True, False, d) else d.getVar('GRUB_COMPATIBLE_HOST')}"
  48. # configure.ac has code to set this automagically from the target tuple
  49. # but the OE freeform one (core2-foo-bar-linux) don't work with that.
  50. GRUBPLATFORM:arm = "efi"
  51. GRUBPLATFORM:aarch64 = "efi"
  52. GRUBPLATFORM:loongarch64 = "efi"
  53. GRUBPLATFORM:riscv32 = "efi"
  54. GRUBPLATFORM:riscv64 = "efi"
  55. GRUBPLATFORM ??= "pc"
  56. inherit autotools gettext texinfo pkgconfig
  57. CFLAGS:remove = "-O2"
  58. # It doesn't support sse, its make.defaults sets:
  59. # CFLAGS += -mno-mmx -mno-sse
  60. # So also remove -mfpmath=sse from TUNE_CCARGS
  61. TUNE_CCARGS:remove = "-mfpmath=sse"
  62. EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
  63. --disable-grub-mkfont \
  64. --program-prefix="" \
  65. --enable-liblzma=no \
  66. --enable-libzfs=no \
  67. --enable-largefile \
  68. --disable-werror \
  69. "
  70. PACKAGECONFIG ??= ""
  71. PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
  72. PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper"
  73. # grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
  74. # OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
  75. # with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
  76. # builds, it's safe to clear them unconditionally for both target and native.
  77. BUILD_CPPFLAGS = ""
  78. BUILD_CFLAGS = ""
  79. BUILD_CXXFLAGS = ""
  80. BUILD_LDFLAGS = ""
  81. export PYTHON = "python3"
  82. do_configure:prepend() {
  83. cd ${S}
  84. # Remove in next version.
  85. # See: https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b835601c7639ed1890f2d3db91900a8506011a8e
  86. echo "depends bli part_gpt" > ${S}/grub-core/extra_deps.lst
  87. FROM_BOOTSTRAP=1 ${S}/autogen.sh
  88. cd ${B}
  89. }