u-boot-tools.inc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. SUMMARY = "U-Boot bootloader tools"
  2. DEPENDS += "openssl"
  3. PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage"
  4. PROVIDES_class-native = "u-boot-mkimage-native u-boot-mkenvimage-native"
  5. PACKAGES += "${PN}-mkimage ${PN}-mkenvimage"
  6. # Required for backward compatibility with "u-boot-mkimage-xxx.bb"
  7. RPROVIDES_${PN}-mkimage = "u-boot-mkimage"
  8. RREPLACES_${PN}-mkimage = "u-boot-mkimage"
  9. RCONFLICTS_${PN}-mkimage = "u-boot-mkimage"
  10. EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
  11. EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
  12. EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
  13. SED_CONFIG_EFI = '-e "s/CONFIG_EFI_LOADER=.*/# CONFIG_EFI_LOADER is not set/"'
  14. SED_CONFIG_EFI_x86 = ''
  15. SED_CONFIG_EFI_x86-64 = ''
  16. SED_CONFIG_EFI_arm = ''
  17. SED_CONFIG_EFI_armeb = ''
  18. SED_CONFIG_EFI_aarch64 = ''
  19. do_compile () {
  20. oe_runmake -C ${S} sandbox_defconfig O=${B}
  21. # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
  22. # generating it requires bin2header tool, which for target build
  23. # is built with target tools and thus cannot be executed on host.
  24. sed -i -e "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" ${SED_CONFIG_EFI} ${B}/.config
  25. oe_runmake -C ${S} cross_tools NO_SDL=1 O=${B}
  26. }
  27. do_install () {
  28. install -d ${D}${bindir}
  29. # mkimage
  30. install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
  31. ln -sf uboot-mkimage ${D}${bindir}/mkimage
  32. # mkenvimage
  33. install -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage
  34. ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage
  35. # dumpimage
  36. install -m 0755 tools/dumpimage ${D}${bindir}/uboot-dumpimage
  37. ln -sf uboot-dumpimage ${D}${bindir}/dumpimage
  38. # fit_check_sign
  39. install -m 0755 tools/fit_check_sign ${D}${bindir}/uboot-fit_check_sign
  40. ln -sf uboot-fit_check_sign ${D}${bindir}/fit_check_sign
  41. }
  42. ALLOW_EMPTY_${PN} = "1"
  43. FILES_${PN} = ""
  44. FILES_${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign"
  45. FILES_${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage"
  46. RDEPENDS_${PN}-mkimage += "dtc"
  47. RDEPENDS_${PN} += "${PN}-mkimage ${PN}-mkenvimage"
  48. RDEPENDS_${PN}_class-native = ""
  49. BBCLASSEXTEND = "native nativesdk"