systemd-boot_246.6.bb 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. require systemd.inc
  2. FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:"
  3. require conf/image-uefi.conf
  4. DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native"
  5. inherit meson pkgconfig gettext
  6. inherit deploy
  7. LDFLAGS_prepend = "${@ " ".join(d.getVar('LD').split()[1:])} "
  8. do_write_config[vardeps] += "CC OBJCOPY"
  9. do_write_config_append() {
  10. cat >${WORKDIR}/meson-${PN}.cross <<EOF
  11. [binaries]
  12. efi_cc = ${@meson_array('CC', d)}
  13. objcopy = ${@meson_array('OBJCOPY', d)}
  14. EOF
  15. }
  16. EXTRA_OEMESON += "-Defi=true \
  17. -Dgnu-efi=true \
  18. -Defi-includedir=${STAGING_INCDIR}/efi \
  19. -Defi-libdir=${STAGING_LIBDIR} \
  20. -Defi-ld=${@ d.getVar('LD').split()[0]} \
  21. -Dman=false \
  22. --cross-file ${WORKDIR}/meson-${PN}.cross \
  23. "
  24. # install to the image as boot*.efi if its the EFI_PROVIDER,
  25. # otherwise install as the full name.
  26. # This allows multiple bootloaders to coexist in a single image.
  27. python __anonymous () {
  28. import re
  29. target = d.getVar('TARGET_ARCH')
  30. prefix = "" if d.getVar('EFI_PROVIDER') == "systemd-boot" else "systemd-"
  31. systemdimage = prefix + d.getVar("EFI_BOOT_IMAGE")
  32. d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage)
  33. prefix = "systemd-" if prefix == "" else ""
  34. d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix)
  35. }
  36. FILES_${PN} = "${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}"
  37. RDEPENDS_${PN} += "virtual/systemd-bootconf"
  38. # Imported from the old gummiboot recipe
  39. TUNE_CCARGS_remove = "-mfpmath=sse"
  40. COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
  41. COMPATIBLE_HOST_x86-x32 = "null"
  42. do_compile() {
  43. SYSTEMD_BOOT_EFI_ARCH="ia32"
  44. if [ "${TARGET_ARCH}" = "x86_64" ]; then
  45. SYSTEMD_BOOT_EFI_ARCH="x64"
  46. fi
  47. ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE}
  48. }
  49. do_install() {
  50. install -d ${D}${EFI_FILES_PATH}
  51. install ${B}/src/boot/efi/systemd-boot*.efi ${D}${EFI_FILES_PATH}/${SYSTEMD_BOOT_IMAGE}
  52. }
  53. do_deploy () {
  54. install ${B}/src/boot/efi/systemd-boot*.efi ${DEPLOYDIR}
  55. }
  56. addtask deploy before do_build after do_compile