diff options
Diffstat (limited to 'recipes-bsp/grub/grub2.inc')
-rw-r--r-- | recipes-bsp/grub/grub2.inc | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/recipes-bsp/grub/grub2.inc b/recipes-bsp/grub/grub2.inc new file mode 100644 index 0000000..2539a0b --- /dev/null +++ b/recipes-bsp/grub/grub2.inc | |||
@@ -0,0 +1,78 @@ | |||
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 | |||
11 | LICENSE = "GPLv3" | ||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | ||
13 | |||
14 | SRC_URI = "https://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ | ||
15 | file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \ | ||
16 | file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ | ||
17 | file://autogen.sh-exclude-pc.patch \ | ||
18 | file://grub-module-explicitly-keeps-symbole-.module_license.patch \ | ||
19 | file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ | ||
20 | file://fix.build.with.gcc-7.patch \ | ||
21 | " | ||
22 | SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d" | ||
23 | SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d" | ||
24 | |||
25 | DEPENDS = "flex-native bison-native" | ||
26 | |||
27 | # COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)' | ||
28 | # COMPATIBLE_HOST_armv7a = 'null' | ||
29 | # COMPATIBLE_HOST_armv7ve = 'null' | ||
30 | |||
31 | # configure.ac has code to set this automagically from the target tuple | ||
32 | # but the OE freeform one (core2-foo-bar-linux) don't work with that. | ||
33 | |||
34 | GRUBPLATFORM_arm = "uboot" | ||
35 | GRUBPLATFORM_aarch64 = "efi" | ||
36 | GRUBPLATFORM ??= "pc" | ||
37 | |||
38 | inherit autotools gettext texinfo | ||
39 | |||
40 | EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \ | ||
41 | --disable-grub-mkfont \ | ||
42 | --program-prefix="" \ | ||
43 | --enable-liblzma=no \ | ||
44 | --enable-libzfs=no \ | ||
45 | --enable-largefile \ | ||
46 | " | ||
47 | |||
48 | PACKAGECONFIG ??= "" | ||
49 | PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse" | ||
50 | PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,lvm2" | ||
51 | |||
52 | # grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and | ||
53 | # OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict | ||
54 | # with that. Note that since BUILD_CFLAGS etc are not used by grub2 target | ||
55 | # builds, it's safe to clear them unconditionally for both target and native. | ||
56 | BUILD_CPPFLAGS = "" | ||
57 | BUILD_CFLAGS = "" | ||
58 | BUILD_CXXFLAGS = "" | ||
59 | BUILD_LDFLAGS = "" | ||
60 | |||
61 | do_configure_prepend() { | ||
62 | # The grub2 configure script uses variables such as TARGET_CFLAGS etc | ||
63 | # for its own purposes. Remove the OE versions from the environment to | ||
64 | # avoid conflicts. | ||
65 | unset TARGET_CPPFLAGS TARGET_CFLAGS TARGET_CXXFLAGS TARGET_LDFLAGS | ||
66 | ( cd ${S} | ||
67 | ${S}/autogen.sh ) | ||
68 | } | ||
69 | |||
70 | # grub and grub-efi's sysroot/${datadir}/grub/grub-mkconfig_lib are | ||
71 | # conflicted, remove it since no one uses it. | ||
72 | SYSROOT_DIRS_BLACKLIST += "${datadir}/grub/grub-mkconfig_lib" | ||
73 | |||
74 | PACKAGES =+ "${PN}-editenv" | ||
75 | |||
76 | FILES_${PN}-editenv = "${bindir}/grub-editenv" | ||
77 | RDEPENDS_${PN} += "${PN}-editenv" | ||
78 | RDEPENDS_${PN}_class-native = "" | ||