android-tools_5.1.1.r37.bb 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. DESCRIPTION = "Different utilities from Android"
  2. SECTION = "console/utils"
  3. LICENSE = "Apache-2.0 & GPL-2.0 & BSD-2-Clause & BSD-3-Clause"
  4. LIC_FILES_CHKSUM = " \
  5. file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10 \
  6. file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
  7. file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=cb641bc04cda31daea161b1bc15da69f \
  8. file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
  9. "
  10. DEPENDS = "libbsd libpcre zlib libcap"
  11. DEPENDS_append_class-target = " openssl"
  12. ANDROID_MIRROR = "android.googlesource.com"
  13. # matches with android-5.1.1_r37
  14. SRCREV_core = "2314b110bdebdbfd2d94c502282f9e57c849897e"
  15. SRCREV_extras = "3ecbe8d841df96127d7855661293e5ab6ba6c205"
  16. SRCREV_libhardware = "be55eb1f4d840c82ffaf7c47460df17ff5bc4d9b"
  17. SRCREV_libselinux = "07e9e1339ad1ba608acfba9dce2d0f474b252feb"
  18. SRCREV_build = "16e987def3d7d8f7d30805eb95cef69e52a87dbc"
  19. SRC_URI = " \
  20. git://${ANDROID_MIRROR}/platform/system/core;name=core;protocol=https;nobranch=1;destsuffix=git/system/core \
  21. git://${ANDROID_MIRROR}/platform/system/extras;name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras \
  22. git://${ANDROID_MIRROR}/platform/hardware/libhardware;name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware \
  23. git://${ANDROID_MIRROR}/platform/external/libselinux;name=libselinux;protocol=https;nobranch=1;destsuffix=git/external/libselinux \
  24. git://${ANDROID_MIRROR}/platform/build;name=build;protocol=https;nobranch=1;destsuffix=git/build \
  25. file://core/0001-adb-remove-selinux-extensions.patch;patchdir=system/core \
  26. file://core/0002-adb-Use-local-sockets-where-appropriate.patch;patchdir=system/core \
  27. file://core/0003-adb-define-shell-command.patch;patchdir=system/core \
  28. file://core/0004-adb-Fix-build-on-big-endian-systems.patch;patchdir=system/core \
  29. file://core/0005-adb-add-base64-implementation.patch;patchdir=system/core \
  30. file://core/0006-adb-Musl-fixes.patch;patchdir=system/core \
  31. file://core/0007-adb-usb_linux.c-fix-build-with-glibc-2.28.patch;patchdir=system/core \
  32. file://core/0008-adb-Allow-adbd-to-be-ran-as-root.patch;patchdir=system/core \
  33. file://core/0009-mkbootimg-Add-dt-parameter-to-specify-DT-image.patch;patchdir=system/core \
  34. file://core/0010-Use-linux-capability.h-on-linux-systems-too.patch;patchdir=system/core \
  35. file://core/0011-Remove-bionic-specific-calls.patch;patchdir=system/core \
  36. file://core/0012-Fix-implicit-declaration-of-stlcat-strlcopy-function.patch;patchdir=system/core \
  37. file://core/adb_libssl_11.diff;patchdir=system/core \
  38. file://core/0013-adb-Support-riscv64.patch;patchdir=system/core \
  39. file://extras/0001-ext4_utils-remove-selinux-extensions.patch;patchdir=system/extras \
  40. file://extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch;patchdir=system/extras \
  41. file://libselinux/0001-Remove-bionic-specific-calls.patch;patchdir=external/libselinux \
  42. file://libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch;patchdir=external/libselinux \
  43. file://android-tools-adbd.service \
  44. file://build/0001-Riscv-Add-risc-v-Android-config-header.patch;patchdir=build \
  45. file://gitignore \
  46. file://adb.mk;subdir=${BPN} \
  47. file://adbd.mk;subdir=${BPN} \
  48. file://ext4_utils.mk;subdir=${BPN} \
  49. file://fastboot.mk;subdir=${BPN} \
  50. file://mkbootimg.mk;subdir=${BPN} \
  51. "
  52. S = "${WORKDIR}/git"
  53. B = "${WORKDIR}/${BPN}"
  54. # http://errors.yoctoproject.org/Errors/Details/133881/
  55. ARM_INSTRUCTION_SET_armv4 = "arm"
  56. ARM_INSTRUCTION_SET_armv5 = "arm"
  57. COMPATIBLE_HOST_powerpc = "(null)"
  58. COMPATIBLE_HOST_powerpc64 = "(null)"
  59. COMPATIBLE_HOST_powerpc64le = "(null)"
  60. inherit systemd
  61. SYSTEMD_PACKAGES = "${PN}-adbd"
  62. SYSTEMD_SERVICE_${PN}-adbd = "android-tools-adbd.service"
  63. # Find libbsd headers during native builds
  64. CC_append_class-native = " -I${STAGING_INCDIR}"
  65. CC_append_class-nativesdk = " -I${STAGING_INCDIR}"
  66. TOOLS = "adb fastboot ext4_utils mkbootimg adbd"
  67. # Adb needs sys/capability.h, which is not available for native*
  68. TOOLS_class-native = "fastboot ext4_utils mkbootimg"
  69. TOOLS_class-nativesdk = "fastboot ext4_utils mkbootimg"
  70. do_compile() {
  71. cp ${WORKDIR}/gitignore ${S}/.gitignore
  72. # Setting both variables below causing our makefiles to not work with
  73. # implicit make rules
  74. unset CFLAGS
  75. unset CPPFLAGS
  76. export SRCDIR=${S}
  77. case "${HOST_ARCH}" in
  78. arm)
  79. export android_arch=linux-arm
  80. ;;
  81. aarch64)
  82. export android_arch=linux-arm64
  83. ;;
  84. riscv64)
  85. export android_arch=linux-riscv64
  86. ;;
  87. mips|mipsel)
  88. export android_arch=linux-mips
  89. ;;
  90. mips64|mips64el)
  91. export android_arch=linux-mips64
  92. ;;
  93. powerpc|powerpc64)
  94. export android_arch=linux-ppc
  95. ;;
  96. i586|i686|x86_64)
  97. export android_arch=linux-x86
  98. ;;
  99. esac
  100. for tool in ${TOOLS}; do
  101. mkdir -p ${B}/${tool}
  102. oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
  103. done
  104. }
  105. do_install() {
  106. if echo ${TOOLS} | grep -q "ext4_utils" ; then
  107. install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
  108. install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
  109. install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
  110. install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
  111. install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
  112. install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
  113. install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
  114. install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
  115. fi
  116. if echo ${TOOLS} | grep -q "adb " ; then
  117. install -d ${D}${bindir}
  118. install -m0755 ${B}/adb/adb ${D}${bindir}
  119. fi
  120. if echo ${TOOLS} | grep -q "adbd" ; then
  121. install -d ${D}${bindir}
  122. install -m0755 ${B}/adbd/adbd ${D}${bindir}
  123. fi
  124. # Outside the if statement to avoid errors during do_package
  125. install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
  126. ${D}${systemd_unitdir}/system/android-tools-adbd.service
  127. if echo ${TOOLS} | grep -q "fastboot" ; then
  128. install -d ${D}${bindir}
  129. install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
  130. fi
  131. if echo ${TOOLS} | grep -q "mkbootimg" ; then
  132. install -d ${D}${bindir}
  133. install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
  134. fi
  135. }
  136. PACKAGES =+ "${PN}-fstools ${PN}-adbd"
  137. RDEPENDS_${BPN}-adbd = "${BPN}-conf"
  138. RDEPENDS_${BPN}-fstools = "bash"
  139. FILES_${PN}-adbd = "\
  140. ${bindir}/adbd \
  141. ${systemd_unitdir}/system/android-tools-adbd.service \
  142. "
  143. FILES_${PN}-fstools = "\
  144. ${bindir}/ext2simg \
  145. ${bindir}/ext4fixup \
  146. ${bindir}/img2simg \
  147. ${bindir}/make_ext4fs \
  148. ${bindir}/simg2img \
  149. ${bindir}/simg2simg \
  150. ${bindir}/simg_dump \
  151. ${bindir}/mkuserimg \
  152. "
  153. BBCLASSEXTEND = "native"