android-tools_5.1.1.r37.bb 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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=8bef8e6712b1be5aa76af1ebde9d6378 \
  8. file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
  9. "
  10. DEPENDS = "libbsd libpcre openssl zlib libcap"
  11. ANDROID_TAG = "android-5.1.1_r37"
  12. ANDROID_MIRROR = "android.googlesource.com"
  13. CORE_REPO = "${ANDROID_MIRROR}/platform/system/core"
  14. EXTRAS_REPO = "${ANDROID_MIRROR}/platform/system/extras"
  15. LIBHARDWARE_REPO = "${ANDROID_MIRROR}/platform/hardware/libhardware"
  16. LIBSELINUX_REPO = "${ANDROID_MIRROR}/platform/external/libselinux"
  17. BUILD_REPO = "${ANDROID_MIRROR}/platform/build"
  18. SRC_URI = " \
  19. git://${CORE_REPO};name=core;protocol=https;nobranch=1;destsuffix=git/system/core;tag=${ANDROID_TAG} \
  20. git://${EXTRAS_REPO};name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras;tag=${ANDROID_TAG} \
  21. git://${LIBHARDWARE_REPO};name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware;tag=${ANDROID_TAG} \
  22. git://${LIBSELINUX_REPO};name=libselinux;protocol=https;nobranch=1;destsuffix=git/external/libselinux;tag=${ANDROID_TAG} \
  23. git://${BUILD_REPO};name=build;protocol=https;nobranch=1;destsuffix=git/build;tag=${ANDROID_TAG} \
  24. file://remove-selinux-android.patch \
  25. file://use-capability.patch \
  26. file://use-local-socket.patch \
  27. file://preserve-ownership.patch \
  28. file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch \
  29. file://remove-bionic-android.patch \
  30. file://define-shell-command.patch \
  31. file://implicit-declaration-function-strlcat-strlcopy.patch \
  32. file://fix-big-endian-build.patch \
  33. file://android-tools-adbd.service \
  34. file://.gitignore;subdir=git \
  35. file://adb.mk;subdir=${BPN} \
  36. file://adbd.mk;subdir=${BPN} \
  37. file://ext4_utils.mk;subdir=${BPN} \
  38. file://fastboot.mk;subdir=${BPN} \
  39. file://mkbootimg.mk;subdir=${BPN} \
  40. "
  41. S = "${WORKDIR}/git"
  42. B = "${WORKDIR}/${BPN}"
  43. # http://errors.yoctoproject.org/Errors/Details/133881/
  44. ARM_INSTRUCTION_SET_armv4 = "arm"
  45. ARM_INSTRUCTION_SET_armv5 = "arm"
  46. inherit systemd
  47. SYSTEMD_SERVICE_${PN} = "android-tools-adbd.service"
  48. # Get rid of files uneeded to build Android tools
  49. do_unpack_extra() {
  50. cd ${S}
  51. rm -rf \
  52. system/core/.git \
  53. system/extras/.git \
  54. hardware/libhardware/.git \
  55. external/libselinux/.git \
  56. build/.git
  57. git init
  58. git add .
  59. git commit -m \
  60. "Initial import - committed ${ANDROID_TAG}"
  61. git clean -fdx
  62. }
  63. addtask unpack_extra after do_unpack before do_patch
  64. # Find libbsd headers during native builds
  65. CC_append_class-native = " -I${STAGING_INCDIR}"
  66. CC_append_class-nativesdk = " -I${STAGING_INCDIR}"
  67. TOOLS = "adb fastboot ext4_utils mkbootimg adbd"
  68. # Adb needs sys/capability.h, which is not available for native*
  69. TOOLS_class-native = "fastboot ext4_utils mkbootimg"
  70. TOOLS_class-nativesdk = "fastboot ext4_utils mkbootimg"
  71. do_compile() {
  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. mips|mipsel)
  85. export android_arch=linux-mips
  86. ;;
  87. powerpc|powerpc64)
  88. export android_arch=linux-ppc
  89. ;;
  90. i586|x86_64)
  91. export android_arch=linux-x86
  92. ;;
  93. esac
  94. for tool in ${TOOLS}; do
  95. mkdir -p ${B}/${tool}
  96. oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
  97. done
  98. }
  99. do_install() {
  100. if echo ${TOOLS} | grep -q "ext4_utils" ; then
  101. install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
  102. install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
  103. install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
  104. install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
  105. install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
  106. install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
  107. install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
  108. install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
  109. fi
  110. if echo ${TOOLS} | grep -q "adb " ; then
  111. install -d ${D}${bindir}
  112. install -m0755 ${B}/adb/adb ${D}${bindir}
  113. fi
  114. if echo ${TOOLS} | grep -q "adbd" ; then
  115. install -d ${D}${bindir}
  116. install -m0755 ${B}/adbd/adbd ${D}${bindir}
  117. fi
  118. # Outside the if statement to avoid errors during do_package
  119. install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
  120. ${D}${systemd_unitdir}/system/android-tools-adbd.service
  121. if echo ${TOOLS} | grep -q "fastboot" ; then
  122. install -d ${D}${bindir}
  123. install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
  124. fi
  125. if echo ${TOOLS} | grep -q "mkbootimg" ; then
  126. install -d ${D}${bindir}
  127. install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
  128. fi
  129. }
  130. PACKAGES += "${PN}-fstools"
  131. RDEPENDS_${BPN} = "${BPN}-conf bash"
  132. FILES_${PN}-fstools = "\
  133. ${bindir}/ext2simg \
  134. ${bindir}/ext4fixup \
  135. ${bindir}/img2simg \
  136. ${bindir}/make_ext4fs \
  137. ${bindir}/simg2img \
  138. ${bindir}/simg2simg \
  139. ${bindir}/simg_dump \
  140. ${bindir}/mkuserimg \
  141. "
  142. BBCLASSEXTEND = "native"