blob: 2450d52cb90316a1417bf1fbf0bf598a6ef3b54f [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require systemd.inc
2FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:"
3
4DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native"
5
6SRC_URI += "file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
7 file://0006-remove-nobody-user-group-checking.patch \
8 file://0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch \
Brad Bishop977dc1a2019-02-06 16:01:43 -05009 file://0001-meson-rename-Ddebug-to-Ddebug-extra.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010 "
11
12inherit meson pkgconfig gettext
13inherit deploy
14
15EFI_CC ?= "${CC}"
16EXTRA_OEMESON += "-Defi=true \
17 -Dgnu-efi=true \
18 -Defi-includedir=${STAGING_INCDIR}/efi \
19 -Defi-ldsdir=${STAGING_LIBDIR} \
20 -Defi-libdir=${STAGING_LIBDIR} \
21 -Dman=false \
22 -Defi-cc='${EFI_CC}' \
23 -Defi-ld='${LD}' \
24 "
25
26# install to the image as boot*.efi if its the EFI_PROVIDER,
27# otherwise install as the full name.
28# This allows multiple bootloaders to coexist in a single image.
29python __anonymous () {
30 import re
31 target = d.getVar('TARGET_ARCH')
Brad Bishop977dc1a2019-02-06 16:01:43 -050032 prefix = "" if d.getVar('EFI_PROVIDER') == "systemd-boot" else "systemd-"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033 if target == "x86_64":
34 systemdimage = prefix + "bootx64.efi"
35 else:
36 systemdimage = prefix + "bootia32.efi"
37 d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage)
38 prefix = "systemd-" if prefix == "" else ""
39 d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix)
40}
41
42FILES_${PN} = "/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}"
43
44RDEPENDS_${PN} += "virtual/systemd-bootconf"
45
46# Imported from the old gummiboot recipe
47TUNE_CCARGS_remove = "-mfpmath=sse"
48COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
49COMPATIBLE_HOST_x86-x32 = "null"
50
51do_compile() {
52 SYSTEMD_BOOT_EFI_ARCH="ia32"
53 if [ "${TARGET_ARCH}" = "x86_64" ]; then
54 SYSTEMD_BOOT_EFI_ARCH="x64"
55 fi
56
57 ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE}
58}
59
60do_install() {
61 install -d ${D}/boot
62 install -d ${D}/boot/EFI
63 install -d ${D}/boot/EFI/BOOT
64 install ${B}/src/boot/efi/systemd-boot*.efi ${D}/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}
65}
66
67do_deploy () {
68 install ${B}/src/boot/efi/systemd-boot*.efi ${DEPLOYDIR}
69}
70addtask deploy before do_build after do_compile