diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd-boot_254.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd-boot_254.bb | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd-boot_254.bb b/meta/recipes-core/systemd/systemd-boot_254.bb new file mode 100644 index 0000000000..e887e636e8 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-boot_254.bb | |||
@@ -0,0 +1,70 @@ | |||
1 | require systemd.inc | ||
2 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:" | ||
3 | |||
4 | require conf/image-uefi.conf | ||
5 | |||
6 | DEPENDS = "intltool-native libcap util-linux gperf-native python3-jinja2-native python3-pyelftools-native" | ||
7 | |||
8 | inherit meson pkgconfig gettext | ||
9 | inherit deploy | ||
10 | |||
11 | LDFLAGS:prepend = "${@ " ".join(d.getVar('LD').split()[1:])} " | ||
12 | |||
13 | EFI_LD = "bfd" | ||
14 | |||
15 | do_write_config[vardeps] += "CC OBJCOPY EFI_LD" | ||
16 | do_write_config:append() { | ||
17 | cat >${WORKDIR}/meson-${PN}.cross <<EOF | ||
18 | [binaries] | ||
19 | c = ${@meson_array('CC', d)} | ||
20 | objcopy = ${@meson_array('OBJCOPY', d)} | ||
21 | c_ld = ${@meson_array('EFI_LD', d)} | ||
22 | EOF | ||
23 | } | ||
24 | |||
25 | EXTRA_OEMESON += "-Defi=true \ | ||
26 | -Dbootloader=true \ | ||
27 | -Dman=false \ | ||
28 | --cross-file ${WORKDIR}/meson-${PN}.cross \ | ||
29 | " | ||
30 | |||
31 | # install to the image as boot*.efi if its the EFI_PROVIDER, | ||
32 | # otherwise install as the full name. | ||
33 | # This allows multiple bootloaders to coexist in a single image. | ||
34 | python __anonymous () { | ||
35 | import re | ||
36 | target = d.getVar('TARGET_ARCH') | ||
37 | prefix = "" if d.getVar('EFI_PROVIDER') == "systemd-boot" else "systemd-" | ||
38 | systemdimage = prefix + d.getVar("EFI_BOOT_IMAGE") | ||
39 | d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage) | ||
40 | prefix = "systemd-" if prefix == "" else "" | ||
41 | d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix) | ||
42 | } | ||
43 | |||
44 | FILES:${PN} = "${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}" | ||
45 | |||
46 | RDEPENDS:${PN} += "virtual-systemd-bootconf" | ||
47 | |||
48 | # Imported from the old gummiboot recipe | ||
49 | TUNE_CCARGS:remove = "-mfpmath=sse" | ||
50 | |||
51 | COMPATIBLE_HOST = "(aarch64.*|arm.*|x86_64.*|i.86.*)-linux" | ||
52 | COMPATIBLE_HOST:x86-x32 = "null" | ||
53 | |||
54 | do_compile() { | ||
55 | ninja systemd-boot | ||
56 | } | ||
57 | |||
58 | do_install() { | ||
59 | install -d ${D}${EFI_FILES_PATH} | ||
60 | install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE} | ||
61 | } | ||
62 | |||
63 | do_deploy () { | ||
64 | install ${B}/src/boot/efi/systemd-boot*.efi ${DEPLOYDIR} | ||
65 | install ${B}/src/boot/efi/linux*.efi.stub ${DEPLOYDIR} | ||
66 | install ${B}/src/boot/efi/addon*.efi.stub ${DEPLOYDIR} | ||
67 | } | ||
68 | |||
69 | addtask deploy before do_build after do_compile | ||
70 | |||