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