Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 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 | " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 10 | DEPENDS = "libbsd libpcre openssl zlib libcap" |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 11 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 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 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 19 | # matches with android-5.1.1_r37 |
| 20 | SRCREV_core = "2314b110bdebdbfd2d94c502282f9e57c849897e" |
| 21 | SRCREV_extras = "3ecbe8d841df96127d7855661293e5ab6ba6c205" |
| 22 | SRCREV_libhardware = "be55eb1f4d840c82ffaf7c47460df17ff5bc4d9b" |
| 23 | SRCREV_libselinux = "07e9e1339ad1ba608acfba9dce2d0f474b252feb" |
| 24 | SRCREV_build = "16e987def3d7d8f7d30805eb95cef69e52a87dbc" |
| 25 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 26 | SRC_URI = " \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 27 | git://${CORE_REPO};name=core;protocol=https;nobranch=1;destsuffix=git/system/core \ |
| 28 | git://${EXTRAS_REPO};name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras \ |
| 29 | git://${LIBHARDWARE_REPO};name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware \ |
| 30 | git://${LIBSELINUX_REPO};name=libselinux;protocol=https;nobranch=1;destsuffix=git/external/libselinux \ |
| 31 | git://${BUILD_REPO};name=build;protocol=https;nobranch=1;destsuffix=git/build \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 32 | file://remove-selinux-android.patch \ |
| 33 | file://use-capability.patch \ |
| 34 | file://use-local-socket.patch \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 35 | file://preserve-ownership.patch;patchdir=system/extras \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 36 | file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch \ |
| 37 | file://remove-bionic-android.patch \ |
| 38 | file://define-shell-command.patch \ |
| 39 | file://implicit-declaration-function-strlcat-strlcopy.patch \ |
| 40 | file://fix-big-endian-build.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 41 | file://0001-add-base64-implementation.patch \ |
| 42 | file://0002-adb-Musl-fixes.patch \ |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 43 | file://android-tools-adbd.service \ |
| 44 | file://.gitignore;subdir=git \ |
| 45 | file://adb.mk;subdir=${BPN} \ |
| 46 | file://adbd.mk;subdir=${BPN} \ |
| 47 | file://ext4_utils.mk;subdir=${BPN} \ |
| 48 | file://fastboot.mk;subdir=${BPN} \ |
| 49 | file://mkbootimg.mk;subdir=${BPN} \ |
| 50 | " |
| 51 | |
| 52 | S = "${WORKDIR}/git" |
| 53 | B = "${WORKDIR}/${BPN}" |
| 54 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 55 | # http://errors.yoctoproject.org/Errors/Details/133881/ |
| 56 | ARM_INSTRUCTION_SET_armv4 = "arm" |
| 57 | ARM_INSTRUCTION_SET_armv5 = "arm" |
| 58 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 59 | inherit systemd |
| 60 | |
| 61 | SYSTEMD_SERVICE_${PN} = "android-tools-adbd.service" |
| 62 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 63 | # Find libbsd headers during native builds |
| 64 | CC_append_class-native = " -I${STAGING_INCDIR}" |
| 65 | CC_append_class-nativesdk = " -I${STAGING_INCDIR}" |
| 66 | |
| 67 | TOOLS = "adb fastboot ext4_utils mkbootimg adbd" |
| 68 | |
| 69 | # Adb needs sys/capability.h, which is not available for native* |
| 70 | TOOLS_class-native = "fastboot ext4_utils mkbootimg" |
| 71 | TOOLS_class-nativesdk = "fastboot ext4_utils mkbootimg" |
| 72 | |
| 73 | do_compile() { |
| 74 | # Setting both variables below causing our makefiles to not work with |
| 75 | # implicit make rules |
| 76 | unset CFLAGS |
| 77 | unset CPPFLAGS |
| 78 | |
| 79 | export SRCDIR=${S} |
| 80 | |
| 81 | case "${HOST_ARCH}" in |
| 82 | arm) |
| 83 | export android_arch=linux-arm |
| 84 | ;; |
| 85 | aarch64) |
| 86 | export android_arch=linux-arm64 |
| 87 | ;; |
| 88 | mips|mipsel) |
| 89 | export android_arch=linux-mips |
| 90 | ;; |
| 91 | powerpc|powerpc64) |
| 92 | export android_arch=linux-ppc |
| 93 | ;; |
| 94 | i586|x86_64) |
| 95 | export android_arch=linux-x86 |
| 96 | ;; |
| 97 | esac |
| 98 | |
| 99 | for tool in ${TOOLS}; do |
| 100 | mkdir -p ${B}/${tool} |
| 101 | oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool} |
| 102 | done |
| 103 | } |
| 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 | |
| 110 | install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir} |
| 111 | install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir} |
| 112 | install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir} |
| 113 | install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir} |
| 114 | install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir} |
| 115 | install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir} |
| 116 | fi |
| 117 | |
| 118 | if echo ${TOOLS} | grep -q "adb " ; then |
| 119 | install -d ${D}${bindir} |
| 120 | install -m0755 ${B}/adb/adb ${D}${bindir} |
| 121 | fi |
| 122 | |
| 123 | if echo ${TOOLS} | grep -q "adbd" ; then |
| 124 | install -d ${D}${bindir} |
| 125 | install -m0755 ${B}/adbd/adbd ${D}${bindir} |
| 126 | fi |
| 127 | |
| 128 | # Outside the if statement to avoid errors during do_package |
| 129 | install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ |
| 130 | ${D}${systemd_unitdir}/system/android-tools-adbd.service |
| 131 | |
| 132 | if echo ${TOOLS} | grep -q "fastboot" ; then |
| 133 | install -d ${D}${bindir} |
| 134 | install -m0755 ${B}/fastboot/fastboot ${D}${bindir} |
| 135 | fi |
| 136 | |
| 137 | if echo ${TOOLS} | grep -q "mkbootimg" ; then |
| 138 | install -d ${D}${bindir} |
| 139 | install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir} |
| 140 | fi |
| 141 | } |
| 142 | |
| 143 | PACKAGES += "${PN}-fstools" |
| 144 | |
| 145 | RDEPENDS_${BPN} = "${BPN}-conf bash" |
| 146 | |
| 147 | FILES_${PN}-fstools = "\ |
| 148 | ${bindir}/ext2simg \ |
| 149 | ${bindir}/ext4fixup \ |
| 150 | ${bindir}/img2simg \ |
| 151 | ${bindir}/make_ext4fs \ |
| 152 | ${bindir}/simg2img \ |
| 153 | ${bindir}/simg2simg \ |
| 154 | ${bindir}/simg_dump \ |
| 155 | ${bindir}/mkuserimg \ |
| 156 | " |
| 157 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 158 | BBCLASSEXTEND = "native" |