diff options
Diffstat (limited to 'dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb')
-rw-r--r-- | dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb | 205 |
1 files changed, 205 insertions, 0 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb b/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb new file mode 100644 index 0000000..aaec6b5 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb | |||
@@ -0,0 +1,205 @@ | |||
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-only;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 libusb squashfs-tools p7zip libselinux" | ||
11 | |||
12 | ANDROID_MIRROR = "android.googlesource.com" | ||
13 | |||
14 | # matches with 10.0.0+r36 | ||
15 | SRCREV_boringssl = "ae2dd49c7cb74d04bdba7c1c9bd62c1e9cdf98f6" | ||
16 | SRCREV_core = "5aa13b053182b758d7a19db0c83e1b9b5bf1ec2e" | ||
17 | SRCREV_extras = "d31740f9d0399f8b938e88e58843d966e1cccab6" | ||
18 | SRCREV_libhardware = "c6925520342a7d37758f85eb1cf3baa20a7b7a18" | ||
19 | SRCREV_build = "28768b3120f751583a2743101b892f210d4715cf" | ||
20 | SRCREV_libunwind = "03a963ecf6ea836b38b3537cbcda0ecfd7a77393" | ||
21 | |||
22 | SRC_URI = " \ | ||
23 | git://salsa.debian.org/android-tools-team/android-platform-external-boringssl;name=boringssl;protocol=https;nobranch=1;destsuffix=git/external/boringssl \ | ||
24 | git://salsa.debian.org/android-tools-team/android-platform-system-core;name=core;protocol=https;nobranch=1;destsuffix=git/system/core \ | ||
25 | git://salsa.debian.org/android-tools-team/android-platform-system-extras;name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras \ | ||
26 | git://${ANDROID_MIRROR}/platform/hardware/libhardware;name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware \ | ||
27 | git://salsa.debian.org/android-tools-team/android-platform-build.git;name=build;protocol=https;nobranch=1;destsuffix=git/build \ | ||
28 | git://salsa.debian.org/android-tools-team/android-platform-external-libunwind.git;protocol=https;name=libunwind;nobranch=1;destsuffix=git/external/libunwind \ | ||
29 | file://adb_mk_change_out_dir.patch \ | ||
30 | file://libadb_mk_change_out_dir.patch \ | ||
31 | file://fastboot_compile_remove_gtest.patch \ | ||
32 | file://fastboot_mk_change_out_dir.patch \ | ||
33 | file://fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch \ | ||
34 | file://libbase_mk_change_out_dir.patch \ | ||
35 | file://libext4_utils_mk_change_out_dir.patch \ | ||
36 | file://libcrypto_mk_change_out_dir.patch \ | ||
37 | file://libcrypto_utils_mk_change_out_dir.patch \ | ||
38 | file://libcutils_mk_change_out_dir.patch \ | ||
39 | file://libfec_mk_change_out_dir.patch \ | ||
40 | file://img2simg_change_out_dir.patch \ | ||
41 | file://simg2img_change_out_dir.patch \ | ||
42 | file://liblog_mk_change_out_dir.patch \ | ||
43 | file://libsparse_mk_change_out_dir.patch \ | ||
44 | file://libziparchive_mk_change_out_dir.patch \ | ||
45 | file://libbacktrace_mk_change_out_dir.patch \ | ||
46 | file://libunwind_mk_change_out_dir.patch \ | ||
47 | file://use_name_space_std_to_compile_libbacktrace.patch \ | ||
48 | file://rules_yocto.mk;subdir=git \ | ||
49 | file://android-tools-adbd.service \ | ||
50 | " | ||
51 | |||
52 | S = "${WORKDIR}/git" | ||
53 | B = "${WORKDIR}/${BPN}" | ||
54 | |||
55 | #apply all the patches maintained in the debian version. | ||
56 | do_unpack_and_patch_debian() { | ||
57 | cd ${S}/system/core | ||
58 | for i in `find ${S}/system/core/debian/patches -name "*.patch"`; do | ||
59 | patch -p1 < $i | ||
60 | done | ||
61 | #a patch with no .patch extention, lets apply that | ||
62 | patch -p1 < ${S}/system/core/debian/patches/Added-missing-headers | ||
63 | cd ${S}/external/libunwind | ||
64 | for i in `find ${S}/external/libunwind/debian/patches -name "*.patch"`; do | ||
65 | patch -p1 < $i | ||
66 | done | ||
67 | } | ||
68 | addtask unpack_and_patch_debian after do_unpack before do_patch | ||
69 | |||
70 | # http://errors.yoctoproject.org/Errors/Details/1debian881/ | ||
71 | ARM_INSTRUCTION_SET_armv4 = "arm" | ||
72 | ARM_INSTRUCTION_SET_armv5 = "arm" | ||
73 | |||
74 | COMPATIBLE_HOST_powerpc = "(null)" | ||
75 | COMPATIBLE_HOST_powerpc64 = "(null)" | ||
76 | COMPATIBLE_HOST_powerpc64le = "(null)" | ||
77 | |||
78 | inherit systemd clang | ||
79 | |||
80 | TOOLCHAIN = "clang" | ||
81 | DEPENDS += "\ | ||
82 | clang-cross-${TARGET_ARCH} \ | ||
83 | " | ||
84 | |||
85 | SYSTEMD_SERVICE_${PN} = "android-tools-adbd.service" | ||
86 | |||
87 | # Find libbsd headers during native builds | ||
88 | CC:append_class-native = " -I${STAGING_INCDIR}" | ||
89 | CC:append_class-nativesdk = " -I${STAGING_INCDIR}" | ||
90 | |||
91 | PREREQUISITE_core = "libbase libsparse liblog libcutils" | ||
92 | TOOLS_TO_BUILD = "libcrypto_utils libadb libziparchive fastboot adb img2simg simg2img libbacktrace" | ||
93 | |||
94 | # Adb needs sys/capability.h, which is not available for native* | ||
95 | TOOLS_class-native = "boringssl fastboot ext4_utils mkbootimg" | ||
96 | TOOLS_class-nativesdk = "boringssl fastboot ext4_utils mkbootimg" | ||
97 | |||
98 | do_compile() { | ||
99 | |||
100 | case "${HOST_ARCH}" in | ||
101 | arm) | ||
102 | export android_arch=linux-arm | ||
103 | cpu=arm | ||
104 | deb_host_arch=arm | ||
105 | ;; | ||
106 | aarch64) | ||
107 | export android_arch=linux-arm64 | ||
108 | cpu=arm64 | ||
109 | deb_host_arch=arm64 | ||
110 | ;; | ||
111 | riscv64) | ||
112 | export android_arch=linux-riscv64 | ||
113 | ;; | ||
114 | mips|mipsel) | ||
115 | export android_arch=linux-mips | ||
116 | cpu=mips | ||
117 | deb_host_arch=mips | ||
118 | ;; | ||
119 | mips64|mips64el) | ||
120 | export android_arch=linux-mips64 | ||
121 | cpu=mips64 | ||
122 | deb_host_arch=mips64 | ||
123 | ;; | ||
124 | powerpc|powerpc64) | ||
125 | export android_arch=linux-ppc | ||
126 | ;; | ||
127 | i586|i686|x86_64) | ||
128 | export android_arch=linux-x86 | ||
129 | cpu=x86_64 | ||
130 | deb_host_arch=amd64 | ||
131 | ;; | ||
132 | esac | ||
133 | |||
134 | export SRCDIR=${S} | ||
135 | |||
136 | oe_runmake -f ${S}/external/boringssl/debian/libcrypto.mk -C ${S}/external/boringssl | ||
137 | oe_runmake -f ${S}/external/libunwind/debian/libunwind.mk -C ${S}/external/libunwind CPU=${cpu} | ||
138 | |||
139 | for tool in ${PREREQUISITE_core}; do | ||
140 | oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core | ||
141 | done | ||
142 | |||
143 | for i in `find ${S}/system/extras/debian/ -name "*.mk"`; do | ||
144 | oe_runmake -f $i -C ${S}/system/extras | ||
145 | done | ||
146 | |||
147 | for tool in ${TOOLS_TO_BUILD}; do | ||
148 | if tool == "libbacktrace"; then | ||
149 | oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core DEB_HOST_ARCH=${deb_host_arch} | ||
150 | else | ||
151 | oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core | ||
152 | fi | ||
153 | done | ||
154 | |||
155 | } | ||
156 | |||
157 | do_install() { | ||
158 | if echo ${TOOLS_TO_BUILD} | grep -q "ext4_utils" ; then | ||
159 | install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump | ||
160 | fi | ||
161 | |||
162 | if echo ${TOOLS_TO_BUILD} | grep -q "adb " ; then | ||
163 | install -d ${D}${bindir} | ||
164 | install -m0755 ${S}/debian/out/usr/lib/android/adb/adb ${D}${bindir} | ||
165 | fi | ||
166 | |||
167 | if echo ${TOOLS_TO_BUILD} | grep -q "adbd" ; then | ||
168 | install -d ${D}${bindir} | ||
169 | install -m0755 ${B}/adbd/adbd ${D}${bindir} | ||
170 | fi | ||
171 | |||
172 | # Outside the if statement to avoid errors during do_package | ||
173 | install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ | ||
174 | ${D}${systemd_unitdir}/system/android-tools-adbd.service | ||
175 | |||
176 | if echo ${TOOLS_TO_BUILD} | grep -q "fastboot" ; then | ||
177 | install -d ${D}${bindir} | ||
178 | install -m0755 ${S}/debian/out/usr/bin/fastboot/fastboot ${D}${bindir} | ||
179 | fi | ||
180 | |||
181 | install -d ${D}${libdir}/android/ | ||
182 | install -m0755 ${S}/debian/out/usr/lib/android/*.so.* ${D}${libdir}/android/ | ||
183 | if echo ${TOOLS_TO_BUILD} | grep -q "mkbootimg" ; then | ||
184 | install -d ${D}${bindir} | ||
185 | install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir} | ||
186 | fi | ||
187 | } | ||
188 | |||
189 | PACKAGES += "${PN}-fstools" | ||
190 | |||
191 | RDEPENDS_${BPN} = "${BPN}-conf p7zip" | ||
192 | |||
193 | FILES_${PN}-fstools = "\ | ||
194 | ${bindir}/ext2simg \ | ||
195 | ${bindir}/ext4fixup \ | ||
196 | ${bindir}/img2simg \ | ||
197 | ${bindir}/make_ext4fs \ | ||
198 | ${bindir}/simg2img \ | ||
199 | ${bindir}/simg2simg \ | ||
200 | ${bindir}/simg_dump \ | ||
201 | ${bindir}/mkuserimg \ | ||
202 | " | ||
203 | FILES:${PN} += "${libdir}/android ${libdir}/android/*" | ||
204 | |||
205 | BBCLASSEXTEND = "native" | ||