diff options
author | Nisha Parrakat <nishaparrakat@gmail.com> | 2021-08-08 08:18:35 +0000 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-08-12 10:08:16 -0700 |
commit | 1f1d3812a10e5a20069545d3ec1e2ae034ab05af (patch) | |
tree | 8526dd017f373037618726fe20db169d8a561c31 /dynamic-layers/selinux/android-tools | |
parent | eb92914e31ff872c032155997c42ca8b6e6d82a3 (diff) | |
download | meta-clang-1f1d3812a10e5a20069545d3ec1e2ae034ab05af.tar.gz |
upgrade of android-tools to 10.0.0.r36
An older version is present in the meta-oe layer.
Took the old recipe and adapted it in the following way:
--Deleted all the old patches that were applicable for
old version.
--Used all the makefiles that come with the new version
directly from the source code, just modifying them
to install output to a specific folder as below
a)added rules_yocto.mk that will mimic the debian/rules
b)modified the makefiles of the components to output to
a common dir.
c)
Built boringssl crypto with the option -DOPENSSL_NO_ASM
to solve the below errors
libcrypto.so.0: undefined reference to `aes_hw_encrypt'
libcrypto.so.0: undefined reference to `aes_hw_set_encrypt_key'
libcrypto.so.0: undefined reference to `gcm_gmult_v8'
libcrypto.so.0: undefined reference to `gcm_init_v8'
libcrypto.so.0: undefined reference to `sha256_block_data_order'
libcrypto.so.0: undefined reference to `aes_hw_ctr32_encrypt_blocks'
libcrypto.so.0: undefined reference to `aes_hw_cbc_encrypt'
libcrypto.so.0: undefined reference to `vpaes_decrypt'
libcrypto.so.0: undefined reference to `vpaes_encrypt'
libcrypto.so.0: undefined reference to `gcm_gmult_neon'
libcrypto.so.0: undefined reference to `sha1_block_data_order'
libcrypto.so.0: undefined reference to `sha512_block_data_order'
libcrypto.so.0: undefined reference to `gcm_init_neon'
libcrypto.so.0: undefined reference to `aes_hw_set_decrypt_key'
libcrypto.so.0: undefined reference to `vpaes_set_decrypt_key'
libcrypto.so.0: undefined reference to `gcm_ghash_neon'
libcrypto.so.0: undefined reference to `bn_mul_mont'
libcrypto.so.0: undefined reference to `aes_hw_decrypt'
libcrypto.so.0: undefined reference to `gcm_ghash_v8'
libcrypto.so.0: undefined reference to `vpaes_cbc_encrypt'
libcrypto.so.0: undefined reference to `ChaCha20_ctr32'
libcrypto.so.0: undefined reference to `vpaes_ctr32_encrypt_blocks'
libcrypto.so.0: undefined reference to `vpaes_set_encrypt_key'
Attention : https://github.com/grpc/grpc/issues/9440
d) compiled android compatible version of libunwind to be used
to build libbacktrace
e) REQUIRES meta-selinux for libselinux, thus added it to
BBFILES_DYNAMIC of this layer.
f) checked compilation and packaging for for x86_64 and aarch64
g) UNTESTED android-tools-adbd.service , couldn't find how to build adbd
that is needed by the service with the new version of android-tools. At
present the service is still packaged but may not work.
h) tested the adb and fastboot on the core-image-minimal by including
the android-tools in the image and ran the commands with 'help'
Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com>
Signed-off-by: Nisha Parrakat <nishaparrakat@gmail.com>
Diffstat (limited to 'dynamic-layers/selinux/android-tools')
29 files changed, 1172 insertions, 0 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/10-adbd-configfs.conf b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/10-adbd-configfs.conf new file mode 100644 index 0000000..ddf155a --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/10-adbd-configfs.conf | |||
@@ -0,0 +1,4 @@ | |||
1 | [Service] | ||
2 | ExecStartPre=/usr/bin/android-gadget-setup | ||
3 | ExecStartPost=/usr/bin/android-gadget-start | ||
4 | ExecStopPost=/usr/bin/android-gadget-cleanup | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-cleanup b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-cleanup new file mode 100644 index 0000000..517227d --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-cleanup | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ -d /sys/kernel/config/usb_gadget ] || exit 0 | ||
4 | |||
5 | cd /sys/kernel/config/usb_gadget | ||
6 | |||
7 | cd adb | ||
8 | |||
9 | echo "" > UDC || true | ||
10 | |||
11 | killall adbd || true | ||
12 | |||
13 | umount /dev/usb-ffs/adb | ||
14 | |||
15 | rm configs/c.1/ffs.usb0 | ||
16 | |||
17 | rmdir configs/c.1/strings/0x409 | ||
18 | rmdir configs/c.1 | ||
19 | |||
20 | rmdir functions/ffs.usb0 | ||
21 | rmdir strings/0x409 | ||
22 | |||
23 | cd .. | ||
24 | rmdir adb | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-setup b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-setup new file mode 100644 index 0000000..e44d1ba --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-setup | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | manufacturer=RPB | ||
6 | model="Android device" | ||
7 | serial=0123456789ABCDEF | ||
8 | |||
9 | if [ -r /etc/android-gadget-setup.machine ] ; then | ||
10 | . /etc/android-gadget-setup.machine | ||
11 | fi | ||
12 | |||
13 | [ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite | ||
14 | |||
15 | cd /sys/kernel/config/usb_gadget | ||
16 | |||
17 | [ -d adb ] && /usr/bin/android-gadget-cleanup || true | ||
18 | |||
19 | mkdir adb | ||
20 | cd adb | ||
21 | |||
22 | mkdir configs/c.1 | ||
23 | mkdir functions/ffs.usb0 | ||
24 | mkdir strings/0x409 | ||
25 | mkdir configs/c.1/strings/0x409 | ||
26 | echo 0x18d1 > idVendor | ||
27 | echo 0xd002 > idProduct | ||
28 | echo "$serial" > strings/0x409/serialnumber | ||
29 | echo "$manufacturer" > strings/0x409/manufacturer | ||
30 | echo "$model" > strings/0x409/product | ||
31 | echo "Conf 1" > configs/c.1/strings/0x409/configuration | ||
32 | ln -s functions/ffs.usb0 configs/c.1 | ||
33 | |||
34 | mkdir -p /dev/usb-ffs/adb | ||
35 | mount -t functionfs usb0 /dev/usb-ffs/adb | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-start b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-start new file mode 100644 index 0000000..ca6c3df --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-start | |||
@@ -0,0 +1,7 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | sleep 3 | ||
6 | |||
7 | ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf-configfs_1.0.bb b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs_1.0.bb new file mode 100644 index 0000000..01dc1be --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools-conf-configfs_1.0.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | DESCRIPTION = "Different utilities from Android - corressponding configuration files for using ConfigFS" | ||
2 | SECTION = "console/utils" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
5 | |||
6 | SRC_URI = " \ | ||
7 | file://android-gadget-setup \ | ||
8 | file://android-gadget-start \ | ||
9 | file://android-gadget-cleanup \ | ||
10 | file://10-adbd-configfs.conf \ | ||
11 | " | ||
12 | |||
13 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
14 | |||
15 | do_install() { | ||
16 | install -d ${D}${bindir} | ||
17 | install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir} | ||
18 | install -m 0755 ${WORKDIR}/android-gadget-start ${D}${bindir} | ||
19 | install -m 0755 ${WORKDIR}/android-gadget-cleanup ${D}${bindir} | ||
20 | |||
21 | if [ -r ${WORKDIR}/android-gadget-setup.machine ] ; then | ||
22 | install -d ${D}${sysconfdir} | ||
23 | install -m 0644 ${WORKDIR}/android-gadget-setup.machine ${D}${sysconfdir} | ||
24 | fi | ||
25 | |||
26 | install -d ${D}${systemd_unitdir}/system/android-tools-adbd.service.d | ||
27 | install -m 0644 ${WORKDIR}/10-adbd-configfs.conf ${D}${systemd_unitdir}/system/android-tools-adbd.service.d | ||
28 | } | ||
29 | |||
30 | FILES_${PN} += " \ | ||
31 | ${systemd_unitdir}/system/ \ | ||
32 | " | ||
33 | |||
34 | PROVIDES += "android-tools-conf" | ||
35 | RPROVIDES_${PN} = "android-tools-conf" | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup b/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup new file mode 100644 index 0000000..26cf30e --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ ! -e /dev/pts ] && mkdir -p /dev/pts | ||
4 | [ ! -e /dev/pts/0 ] && mount devpts /dev/pts -t devpts | ||
5 | |||
6 | # TODO enable the lines below once we have support for getprop | ||
7 | # retrieve the product info from Android | ||
8 | # manufacturer=$(getprop ro.product.manufacturer Android) | ||
9 | # model=$(getprop ro.product.model Android) | ||
10 | # serial=$(getprop ro.serialno 0123456789ABCDEF) | ||
11 | |||
12 | #below are now needed in order to use FunctionFS for ADB, tested to work with 3.4+ kernels | ||
13 | if grep -q functionfs /proc/filesystems; then | ||
14 | mkdir -p /dev/usb-ffs/adb | ||
15 | mount -t functionfs adb /dev/usb-ffs/adb | ||
16 | #android-gadget-setup doesn't provide below 2 and without them it won't work, so we provide them here. | ||
17 | echo adb > /sys/class/android_usb/android0/f_ffs/aliases | ||
18 | echo ffs > /sys/class/android_usb/android0/functions | ||
19 | fi | ||
20 | |||
21 | manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)" | ||
22 | model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)" | ||
23 | # get the device serial number from /proc/cmdline directly(since we have no getprop on | ||
24 | # GNU/Linux) | ||
25 | serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')" | ||
26 | |||
27 | echo $serial > /sys/class/android_usb/android0/iSerial | ||
28 | echo $manufacturer > /sys/class/android_usb/android0/iManufacturer | ||
29 | echo $model > /sys/class/android_usb/android0/iProduct | ||
30 | |||
31 | echo "0" > /sys/class/android_usb/android0/enable | ||
32 | echo "18d1" > /sys/class/android_usb/android0/idVendor | ||
33 | echo "D002" > /sys/class/android_usb/android0/idProduct | ||
34 | echo "adb" > /sys/class/android_usb/android0/functions | ||
35 | echo "1" > /sys/class/android_usb/android0/enable | ||
36 | |||
37 | sleep 4 | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools-conf_1.0.bb b/dynamic-layers/selinux/android-tools/android-tools-conf_1.0.bb new file mode 100644 index 0000000..34b1a9b --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools-conf_1.0.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | DESCRIPTION = "Different utilities from Android - corressponding configuration files" | ||
2 | SECTION = "console/utils" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
5 | |||
6 | SRC_URI = "file://android-gadget-setup" | ||
7 | |||
8 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
9 | |||
10 | do_install() { | ||
11 | install -d ${D}${bindir} | ||
12 | install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir} | ||
13 | } | ||
14 | |||
15 | python () { | ||
16 | pn = d.getVar('PN') | ||
17 | profprov = d.getVar("PREFERRED_PROVIDER_" + pn) | ||
18 | if profprov and pn != profprov: | ||
19 | raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (pn, profprov, pn)) | ||
20 | } | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch new file mode 100644 index 0000000..8c07e13 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | patching adb.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | --- git/system/core/debian/adb.mk 2021-04-29 21:11:00.617892503 +0200 | ||
20 | +++ git/system/core/debian/adb.mk 2021-04-29 21:17:33.256016600 +0200 | ||
21 | @@ -1,3 +1,4 @@ | ||
22 | +include ../../rules_yocto.mk | ||
23 | NAME = adb | ||
24 | |||
25 | SOURCES = client/adb_client.cpp \ | ||
26 | @@ -12,10 +13,10 @@ | ||
27 | |||
28 | SOURCES := $(foreach source, $(SOURCES), adb/$(source)) | ||
29 | CXXFLAGS += -std=gnu++2a | ||
30 | -CPPFLAGS += -Iinclude -Iadb -Ibase/include \ | ||
31 | +CPPFLAGS += -Iinclude -Iadb -Ibase/include -I$(OUT_DIR)/usr/include/ \ | ||
32 | -DADB_VERSION='"$(DEB_VERSION)"' -DADB_HOST=1 -D_GNU_SOURCE | ||
33 | -LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=. \ | ||
34 | - -lpthread -L. -ladb -lbase | ||
35 | +LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
36 | + -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -ladb -lbase | ||
37 | |||
38 | # -latomic should be the last library specified | ||
39 | # https://github.com/android/ndk/issues/589 | ||
40 | @@ -24,7 +25,8 @@ | ||
41 | endif | ||
42 | |||
43 | build: $(SOURCES) | ||
44 | - $(CXX) $^ -o adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
45 | + mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb | ||
46 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
47 | |||
48 | clean: | ||
49 | - $(RM) adb/$(NAME) | ||
50 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/android-tools-adbd.service b/dynamic-layers/selinux/android-tools/android-tools/android-tools-adbd.service new file mode 100644 index 0000000..ddf8d7f --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/android-tools-adbd.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=Android Debug Bridge | ||
3 | ConditionPathExists=/var/usb-debugging-enabled | ||
4 | Before=android-system.service | ||
5 | |||
6 | [Service] | ||
7 | Type=simple | ||
8 | Restart=on-failure | ||
9 | ExecStartPre=-/usr/bin/android-gadget-setup adb | ||
10 | ExecStart=/usr/bin/adbd | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=basic.target | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch b/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch new file mode 100644 index 0000000..a04f27f --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | socket.h: removing dependency of gtest | ||
2 | |||
3 | Removed the dependency of gtest on the build of fastboot binary. | ||
4 | Fixes below error | ||
5 | |||
6 | In file included from fastboot/fastboot.cpp:70: | ||
7 | | In file included from fastboot/tcp.h:36: | ||
8 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
9 | | #include <gtest/gtest_prod.h> | ||
10 | | ^~~~~~~~~~~~~~~~~~~~ | ||
11 | | 1 error generated. | ||
12 | | In file included from fastboot/socket.cpp:29: | ||
13 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
14 | | #include <gtest/gtest_prod.h> | ||
15 | | ^~~~~~~~~~~~~~~~~~~~ | ||
16 | | 1 error generated. | ||
17 | | In file included from fastboot/tcp.cpp:29: | ||
18 | | In file included from fastboot/tcp.h:36: | ||
19 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
20 | | #include <gtest/gtest_prod.h> | ||
21 | | ^~~~~~~~~~~~~~~~~~~~ | ||
22 | | 1 error generated. | ||
23 | | In file included from fastboot/udp.cpp:31: | ||
24 | | In file included from fastboot/udp.h:34: | ||
25 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
26 | | #include <gtest/gtest_prod.h> | ||
27 | | ^~~~~~~~~~~~~~~~~~~~ | ||
28 | | 1 error generated. | ||
29 | |||
30 | |||
31 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
32 | |||
33 | --- a/system/core/fastboot/socket.h 2021-04-14 21:14:00.355973915 +0000 | ||
34 | +++ b/system/core/fastboot/socket.h 2021-04-14 21:14:21.879680699 +0000 | ||
35 | @@ -40,7 +40,6 @@ | ||
36 | |||
37 | #include <android-base/macros.h> | ||
38 | #include <cutils/sockets.h> | ||
39 | -#include <gtest/gtest_prod.h> | ||
40 | |||
41 | // Socket interface to be implemented for each platform. | ||
42 | class Socket { | ||
43 | @@ -119,8 +118,6 @@ | ||
44 | socket_send_buffers_function_ = &socket_send_buffers; | ||
45 | |||
46 | private: | ||
47 | - FRIEND_TEST(SocketTest, TestTcpSendBuffers); | ||
48 | - FRIEND_TEST(SocketTest, TestUdpSendBuffers); | ||
49 | |||
50 | DISALLOW_COPY_AND_ASSIGN(Socket); | ||
51 | }; | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch b/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch new file mode 100644 index 0000000..d8c74be --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | upstream commit taken as below | ||
2 | Original Issue link | ||
3 | https://android-review.googlesource.com/c/platform/system/core/+/1123485 | ||
4 | |||
5 | Commit taken below: | ||
6 | |||
7 | fastboot: don't use sparse_file_import_auto() in load_buf_fd() | ||
8 | |||
9 | load_buf_fd() attempts to find the size of the file that it is about | ||
10 | to load by first calling sparse_file_import_auto() then using | ||
11 | sparse_file_len() upon success or falling back to the file size on the | ||
12 | filesystem on failure. | ||
13 | |||
14 | This is problematic however as sparse_file_import_auto() creates a | ||
15 | sparse_file out of the normal file, but does not resparse it, so an | ||
16 | assertion fails during the sparse_file_len() call. | ||
17 | |||
18 | This is fixed by using sparse_file_import() instead. This will fail | ||
19 | in the case that the file is not sparse and the call to | ||
20 | sparse_file_len() will be properly skipped. | ||
21 | |||
22 | Bug: 140538105 | ||
23 | Test: flash blueline factory image with assertions enabled in | ||
24 | libsparse/sparse.cpp | ||
25 | |||
26 | Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c | ||
27 | |||
28 | https://android.googlesource.com/platform/system/core/+/fbb9535aaea5ae4011f3c3edf4c00b27452f57ec | ||
29 | Upstream-Status: Backport(commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec) | ||
30 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
31 | |||
32 | --- git/system/core/fastboot/fastboot.cpp 2021-05-28 09:24:15.583963227 +0000 | ||
33 | +++ git/system/core/fastboot/fastboot.cpp 2021-05-28 09:25:09.948974990 +0000 | ||
34 | @@ -869,7 +869,7 @@ | ||
35 | return false; | ||
36 | } | ||
37 | |||
38 | - if (sparse_file* s = sparse_file_import_auto(fd, false, false)) { | ||
39 | + if (sparse_file* s = sparse_file_import(fd, false, false)) { | ||
40 | buf->image_size = sparse_file_len(s, false, false); | ||
41 | sparse_file_destroy(s); | ||
42 | } else { | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch new file mode 100644 index 0000000..c8904f0 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | patching fastboot.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- git/system/core/debian/fastboot.mk 2021-05-17 07:47:56.800224043 +0000 | ||
21 | +++ git/system/core/debian/fastboot.mk 2021-05-17 07:49:40.130383096 +0000 | ||
22 | @@ -1,3 +1,4 @@ | ||
23 | +include ../../rules_yocto.mk | ||
24 | NAME = fastboot | ||
25 | fastboot_SOURCES = \ | ||
26 | bootimg_utils.cpp \ | ||
27 | @@ -38,11 +39,11 @@ | ||
28 | -Ifs_mgr/liblp/include \ | ||
29 | -I/usr/include/android/openssl \ | ||
30 | -Ilibsparse/include \ | ||
31 | - -Ilibziparchive/include | ||
32 | + -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ | ||
33 | LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
34 | -fuse-ld=gold \ | ||
35 | - -Wl,-rpath-link=. \ | ||
36 | - -L. -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ | ||
37 | + -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
38 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ | ||
39 | -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
40 | -l7z \ | ||
41 | |||
42 | @@ -53,7 +54,8 @@ | ||
43 | endif | ||
44 | |||
45 | build: $(SOURCES) | ||
46 | - $(CXX) $^ -o fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
47 | + mkdir --parents $(OUT_DIR)/usr/bin/fastboot | ||
48 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
49 | |||
50 | clean: | ||
51 | - $(RM) fastboot/$(NAME) | ||
52 | + $(RM) $(OUT_DIR)/usr/bin/fastboot/$(NAME) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch new file mode 100644 index 0000000..6913c4b --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | patching img2simg.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- git/system/core/debian/img2simg.mk 2021-05-12 09:05:38.580607289 +0000 | ||
21 | +++ git/system/core/debian/img2simg.mk 2021-05-12 09:09:04.331908253 +0000 | ||
22 | @@ -1,13 +1,14 @@ | ||
23 | +include ../../rules_yocto.mk | ||
24 | NAME = img2simg | ||
25 | SOURCES = img2simg.cpp | ||
26 | SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) | ||
27 | CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 | ||
28 | -LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
29 | - -Wl,-rpath-link=. \ | ||
30 | - -L. -lsparse | ||
31 | +LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
32 | + -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
33 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -lsparse | ||
34 | |||
35 | build: $(SOURCES) | ||
36 | - $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
37 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
38 | |||
39 | clean: | ||
40 | - $(RM) libsparse/$(NAME) | ||
41 | + $(RM) $(OUT_DIR)/usr/bin/$(NAME) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch new file mode 100644 index 0000000..7094cca --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | libadb.mk: modifications to make it build in yocto environment | ||
2 | |||
3 | Adding an include file that is setting the common flags. | ||
4 | Changed the cppflag to include the headers from other components | ||
5 | of android-tools | ||
6 | |||
7 | Modified LDflags so that the libraries that are coming from other android-tools | ||
8 | are searched in the output folder. | ||
9 | |||
10 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
11 | |||
12 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
13 | |||
14 | --- git/system/core/debian/libadb.mk 2021-04-30 16:29:34.596618862 +0200 | ||
15 | +++ git/system/core/debian/libadb.mk 2021-04-30 16:36:53.932837490 +0200 | ||
16 | @@ -1,3 +1,4 @@ | ||
17 | +include ../../rules_yocto.mk | ||
18 | NAME := libadb | ||
19 | |||
20 | LIBADB_SRC_FILES := \ | ||
21 | @@ -43,18 +44,18 @@ | ||
22 | -Ibase/include \ | ||
23 | -Idiagnose_usb/include \ | ||
24 | -Ilibcrypto_utils/include \ | ||
25 | - -Iinclude \ | ||
26 | + -Iinclude -I$(OUT_DIR)/usr/include \ | ||
27 | -DPLATFORM_TOOLS_VERSION='"$(PLATFORM_TOOLS_VERSION)"' \ | ||
28 | -DADB_HOST=1 -DADB_VERSION='"$(DEB_VERSION)"' | ||
29 | |||
30 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
31 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
32 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ | ||
33 | - -lpthread -L. -lbase -lcutils -lcrypto_utils -lusb-1.0 | ||
34 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ | ||
35 | + -lpthread -lbase -lcutils -lcrypto_utils -lusb-1.0 | ||
36 | |||
37 | $(NAME).so: $(SOURCES) | ||
38 | - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
39 | - ln -s $(NAME).so.0 $(NAME).so | ||
40 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
41 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
42 | |||
43 | transport_mdns_unsupported.cpp: | ||
44 | echo 'void init_mdns_transport_discovery(void) {}' > transport_mdns_unsupported.cpp | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch new file mode 100644 index 0000000..464b63d --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | patching libbacktrace.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- git/system/core/debian/libbacktrace.mk 2021-05-21 23:51:55.022408433 +0000 | ||
21 | +++ git/system/core/debian/libbacktrace.mk 2021-05-21 23:53:07.487543521 +0000 | ||
22 | @@ -1,5 +1,6 @@ | ||
23 | - | ||
24 | -include /usr/share/dpkg/architecture.mk | ||
25 | +include ../../rules_yocto.mk | ||
26 | +#pass architecture specific info to makefile | ||
27 | +DEB_HOST_ARCH=${deb_host_arch} | ||
28 | |||
29 | NAME = libbacktrace | ||
30 | |||
31 | @@ -88,11 +89,11 @@ | ||
32 | -Ilibprocinfo/include \ | ||
33 | -Ilibunwindstack/include \ | ||
34 | -I/usr/include/android/lzma \ | ||
35 | - -I/usr/include/android/unwind | ||
36 | + -I$(OUT_DIR)/usr/include/android/libunwind | ||
37 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
38 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
39 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ | ||
40 | - -L. -lbase -llog -lpthread -l7z | ||
41 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ | ||
42 | + -lbase -llog -lpthread -l7z | ||
43 | |||
44 | # -latomic should be the last library specified | ||
45 | # https://github.com/android/ndk/issues/589 | ||
46 | @@ -104,11 +105,11 @@ | ||
47 | endif | ||
48 | |||
49 | build: $(COBJECTS) $(CXXOBJECTS) $(OBJECTS_ASSEMBLY) | ||
50 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
51 | - ln -s $(NAME).so.0 $(NAME).so | ||
52 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
53 | + ln -s $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(NAME).so | ||
54 | |||
55 | clean: | ||
56 | - $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* | ||
57 | + $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
58 | |||
59 | $(CXXOBJECTS): %.o: %.cpp | ||
60 | $(CXX) $< -o $@ $(CXXFLAGS) $(CPPFLAGS) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch new file mode 100644 index 0000000..37c93d6 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | libbase.mk: modifications to make it build in yocto environment | ||
2 | |||
3 | Adding an include file that is setting the common flags. | ||
4 | Changed the cppflag to include the headers from other components | ||
5 | of android-tools | ||
6 | |||
7 | Modified LDflags so that the libraries that are coming from other android-tools | ||
8 | are searched in the output folder. | ||
9 | |||
10 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
11 | |||
12 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
13 | |||
14 | --- git/system/core/debian/libbase.mk 2021-04-29 22:01:13.664181133 +0200 | ||
15 | +++ git/system/core/debian/libbase.mk 2021-04-29 22:04:52.328123833 +0200 | ||
16 | @@ -1,3 +1,4 @@ | ||
17 | +include ../../rules_yocto.mk | ||
18 | NAME = libbase | ||
19 | SOURCES = \ | ||
20 | chrono_utils.cpp \ | ||
21 | @@ -20,8 +21,9 @@ | ||
22 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 | ||
23 | |||
24 | build: $(SOURCES) | ||
25 | - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
26 | - ln -s $(NAME).so.0 $(NAME).so | ||
27 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
28 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
29 | + cp -r base/include/* $(OUT_DIR)/usr/include/ | ||
30 | |||
31 | clean: | ||
32 | - $(RM) $(NAME).so* | ||
33 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch new file mode 100644 index 0000000..f705909 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | libcrypto.mk: modifications to make it build in yocto environment | ||
2 | |||
3 | Adding an include file that is setting the common flags. | ||
4 | |||
5 | Modified the build rule so that it outputs the binary and include | ||
6 | to the OUT_DIR | ||
7 | |||
8 | |||
9 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
10 | |||
11 | --- git/external/boringssl/debian/libcrypto.mk 2021-04-30 11:32:40.610312307 +0000 | ||
12 | +++ git/external/boringssl/debian/libcrypto.mk 2021-04-30 11:36:47.738318880 +0000 | ||
13 | @@ -1,3 +1,4 @@ | ||
14 | +include ../../rules_yocto.mk | ||
15 | include sources.mk | ||
16 | |||
17 | NAME = libcrypto | ||
18 | @@ -26,6 +27,8 @@ | ||
19 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread | ||
20 | |||
21 | build: $(SOURCES) | ||
22 | - mkdir --parents debian/out | ||
23 | - $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
24 | - ln -s $(NAME).so.0 debian/out/$(NAME).so | ||
25 | \ No newline at end of file | ||
26 | + mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ | ||
27 | + mkdir --parents $(OUT_DIR)/usr/include | ||
28 | + $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DOPENSSL_NO_ASM | ||
29 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
30 | + cp -r include/openssl $(OUT_DIR)/usr/include | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch new file mode 100644 index 0000000..a0dd348 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | libcrypto_utils.mk: modifications to make it build in yocto environment | ||
2 | |||
3 | Adding an include file that is setting the common flags. | ||
4 | Changed the cppflag to include the headers from other components | ||
5 | of android-tools | ||
6 | |||
7 | Modified LDflags so that the libraries that are coming from other android-tools | ||
8 | are searched in the output folder. | ||
9 | |||
10 | Modified the build rule so that it outputs the binary and header to the OUT_DIR | ||
11 | |||
12 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
13 | |||
14 | --- git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:18:54.071379767 +0200 | ||
15 | +++ git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:22:46.179047308 +0200 | ||
16 | @@ -1,15 +1,17 @@ | ||
17 | +include ../../rules_yocto.mk | ||
18 | NAME:= libcrypto_utils | ||
19 | SOURCES := android_pubkey.c | ||
20 | SOURCES := $(foreach source, $(SOURCES), libcrypto_utils/$(source)) | ||
21 | -CPPFLAGS += -Ilibcrypto_utils/include -Iinclude | ||
22 | +CPPFLAGS += -Ilibcrypto_utils/include -Iinclude -I$(OUT_DIR)/usr/include | ||
23 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
24 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
25 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
26 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
27 | -lcrypto -Wl,-z,defs | ||
28 | |||
29 | build: $(SOURCES) | ||
30 | - $(CC) $^ -o $(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) | ||
31 | - ln -s $(NAME).so.0 $(NAME).so | ||
32 | + $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) | ||
33 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
34 | + cp -r libcrypto_utils/include/* $(OUT_DIR)/usr/include/ | ||
35 | |||
36 | clean: | ||
37 | - $(RM) $(NAME).so* | ||
38 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch new file mode 100644 index 0000000..5539eb9 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | --- git/system/core/debian/libcutils.mk 2021-05-17 06:38:40.105161629 +0000 | ||
2 | +++ git/system/core/debian/libcutils.mk 2021-05-17 06:42:37.141912366 +0000 | ||
3 | @@ -1,3 +1,4 @@ | ||
4 | +include ../../rules_yocto.mk | ||
5 | NAME = libcutils | ||
6 | |||
7 | # copied from libcutils/Android.bp | ||
8 | @@ -50,14 +51,15 @@ | ||
9 | -Iinclude \ | ||
10 | |||
11 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
12 | - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L. -llog -lbase | ||
13 | + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -llog -lbase | ||
14 | |||
15 | build: $(COBJECTS) $(CXXOBJECTS) | ||
16 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
17 | - ln -s $(NAME).so.0 $(NAME).so | ||
18 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
19 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
20 | + cp -r libcutils/include/cutils $(OUT_DIR)/usr/include/ | ||
21 | |||
22 | clean: | ||
23 | - $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* | ||
24 | + $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
25 | |||
26 | $(COBJECTS): %.o: %.c | ||
27 | $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch new file mode 100644 index 0000000..efccfab --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | libext4_utils.mk: modifications to make it build in yocto environment | ||
2 | |||
3 | Adding an include file that is setting the common flags. | ||
4 | Changed the cppflag to include the headers from other components | ||
5 | of android-tools | ||
6 | |||
7 | Modified LDflags so that the libraries that are coming from other android-tools | ||
8 | are searched in the output folder. | ||
9 | |||
10 | Modified the build rule so that it outputs the binary and header to the OUT_DIR | ||
11 | |||
12 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
13 | |||
14 | --- git/system/extras/debian/libext4_utils.mk 2021-04-29 21:46:39.384394114 +0000 | ||
15 | +++ git/system/extras/debian/libext4_utils.mk 2021-04-29 21:49:53.808605543 +0000 | ||
16 | @@ -1,3 +1,4 @@ | ||
17 | +include ../../rules_yocto.mk | ||
18 | NAME = libext4_utils | ||
19 | |||
20 | ext4_utils_SOURCES := \ | ||
21 | @@ -17,14 +18,16 @@ | ||
22 | -Iext4_utils/include \ | ||
23 | -Ilibfec/include \ | ||
24 | -Isquashfs_utils \ | ||
25 | - -I/usr/include/android \ | ||
26 | + -I/usr/include/android -I$(OUT_DIR)/usr/include \ | ||
27 | -D_GNU_SOURCE -DFEC_NO_KLOG -DSQUASHFS_NO_KLOG -D_LARGEFILE64_SOURCE | ||
28 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
29 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
30 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
31 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
32 | -lbase -lsparse -lselinux | ||
33 | |||
34 | build: $(SOURCES) | ||
35 | - mkdir --parents $(OUT_DIR) | ||
36 | - $(CC) $^ -o $(OUT_DIR)/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
37 | - ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so | ||
38 | + mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ | ||
39 | + $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
40 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
41 | + cp -r ext4_utils/include/* $(OUT_DIR)/usr/include/ | ||
42 | + | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch new file mode 100644 index 0000000..0f8184d --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | --- git/system/extras/debian/libfec.mk 2021-05-17 06:55:51.973044031 +0000 | ||
2 | +++ git/system/extras/debian/libfec.mk 2021-05-17 06:56:41.940185413 +0000 | ||
3 | @@ -1,3 +1,4 @@ | ||
4 | +include ../../rules_yocto.mk | ||
5 | NAME = libfec | ||
6 | |||
7 | # copied from libfec/Android.bp | ||
8 | @@ -12,20 +13,21 @@ | ||
9 | CXXFLAGS += -fno-strict-aliasing -std=g++17 | ||
10 | CPPFLAGS += \ | ||
11 | -Iext4_utils/include \ | ||
12 | - -Ilibfec/include \ | ||
13 | + -Ilibfec/include -I $(OUT_DIR)/usr/include \ | ||
14 | -D_GNU_SOURCE -DFEC_NO_KLOG -D_LARGEFILE64_SOURCE | ||
15 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
16 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
17 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
18 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
19 | -lbase -lsparse -lselinux | ||
20 | |||
21 | build: $(COBJECTS) $(CXXOBJECTS) | ||
22 | - mkdir -p $(OUT_DIR) | ||
23 | - $(CXX) $^ -o $(OUT_DIR)/$(NAME).so.0 $(LDFLAGS) | ||
24 | - ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so | ||
25 | + mkdir -p $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android | ||
26 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
27 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
28 | + cp -r libfec/include/* $(OUT_DIR)/usr/include/ | ||
29 | |||
30 | clean: | ||
31 | - $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* | ||
32 | + $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
33 | |||
34 | $(COBJECTS): %.o: %.c | ||
35 | $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch new file mode 100644 index 0000000..09ef187 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | patching liblog.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- git/system/core/debian/liblog.mk 2021-05-17 08:13:28.304700936 +0000 | ||
21 | +++ git/system/core/debian/liblog.mk 2021-05-17 08:15:59.590064282 +0000 | ||
22 | @@ -1,3 +1,4 @@ | ||
23 | +include ../../rules_yocto.mk | ||
24 | NAME = liblog | ||
25 | |||
26 | # copied from liblog/Android.bp | ||
27 | @@ -39,11 +40,12 @@ | ||
28 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread | ||
29 | |||
30 | build: $(COBJECTS) $(CXXOBJECTS) | ||
31 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
32 | - ln -s $(NAME).so.0 $(NAME).so | ||
33 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
34 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
35 | + cp -r liblog/include/* $(OUT_DIR)/usr/include/ | ||
36 | |||
37 | clean: | ||
38 | - $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* | ||
39 | + $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
40 | |||
41 | $(COBJECTS): %.o: %.c | ||
42 | $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch new file mode 100644 index 0000000..4f8bb44 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | patching libsparse.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- git/system/core/debian/libsparse.mk 2021-05-17 08:13:34.764584388 +0000 | ||
21 | +++ git/system/core/debian/libsparse.mk 2021-05-17 08:15:34.850492654 +0000 | ||
22 | @@ -1,3 +1,4 @@ | ||
23 | +include ../../rules_yocto.mk | ||
24 | NAME = libsparse | ||
25 | SOURCES = \ | ||
26 | backed_block.cpp \ | ||
27 | @@ -18,16 +19,16 @@ | ||
28 | -shared -Wl,-soname,$(NAME).so.0 \ | ||
29 | -lz \ | ||
30 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
31 | - -L. \ | ||
32 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
33 | -lbase | ||
34 | |||
35 | |||
36 | build: $(COBJECTS) $(CXXOBJECTS) | ||
37 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
38 | - ln -s $(NAME).so.0 $(NAME).so | ||
39 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
40 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
41 | |||
42 | clean: | ||
43 | - $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* | ||
44 | + $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
45 | |||
46 | $(COBJECTS): %.o: %.c | ||
47 | $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch new file mode 100644 index 0000000..237d45c --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | patching libundwind to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Passing the architecture details($CPU)from the recipe. | ||
17 | |||
18 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
19 | |||
20 | Upstream-Status: Pending | ||
21 | |||
22 | --- git/external/libunwind/debian/libunwind.mk 2021-05-22 02:29:52.950324653 +0000 | ||
23 | +++ git/external/libunwind/debian/libunwind.mk 2021-05-22 02:30:48.535322846 +0000 | ||
24 | @@ -1,4 +1,4 @@ | ||
25 | -include debian/detect_arch.mk | ||
26 | +include ../../rules_yocto.mk | ||
27 | |||
28 | ARCH_SOURCES = is_fpreg.c \ | ||
29 | regname.c \ | ||
30 | @@ -131,10 +131,12 @@ | ||
31 | CPPFLAGS += -Iinclude -Isrc $($(CPU)_INCLUDES) -Idebian/include | ||
32 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
33 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
34 | - -lpthread -nostdlib -lc -lgcc -Ldebian/out -l7z | ||
35 | + -lpthread -nostdlib -lc -lgcc -l7z | ||
36 | |||
37 | build: $(SOURCES) | ||
38 | - mkdir --parents debian/out | ||
39 | - ln -s /usr/lib/p7zip/7z.so debian/out/lib7z.so | ||
40 | - $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
41 | - ln -s $(NAME).so.0 debian/out/$(NAME).so | ||
42 | + mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ | ||
43 | + mkdir --parents $(OUT_DIR)/usr/include/android/libunwind | ||
44 | + $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wno-header-guard -Wno-absolute-value | ||
45 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
46 | + cp -r include/* debian/include/* $(OUT_DIR)/usr/include/android/libunwind/ | ||
47 | + | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch new file mode 100644 index 0000000..cc9997d --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | patching libziparchive.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- git/system/core/debian/libziparchive.mk 2021-05-17 08:13:41.684459540 +0000 | ||
21 | +++ git/system/core/debian/libziparchive.mk 2021-05-17 08:16:19.293722572 +0000 | ||
22 | @@ -1,3 +1,4 @@ | ||
23 | +include ../../rules_yocto.mk | ||
24 | NAME = libziparchive | ||
25 | SOURCES = zip_archive.cc \ | ||
26 | zip_archive_stream_entry.cc\ | ||
27 | @@ -5,14 +6,15 @@ | ||
28 | SOURCES := $(foreach source, $(SOURCES), libziparchive/$(source)) | ||
29 | CXXFLAGS += -std=gnu++17 | ||
30 | CPPFLAGS += -DZLIB_CONST -D_FILE_OFFSET_BITS=64 \ | ||
31 | - -Iinclude -Ibase/include -Ilibziparchive/include | ||
32 | + -Iinclude -Ibase/include -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ | ||
33 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
34 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
35 | - -lz -L. -llog -lbase | ||
36 | + -lz -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -llog -lbase | ||
37 | |||
38 | build: $(SOURCES) | ||
39 | - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
40 | - ln -s $(NAME).so.0 $(NAME).so | ||
41 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
42 | + ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
43 | + cp -r libziparchive/include/* $(OUT_DIR)/usr/include/ | ||
44 | |||
45 | clean: | ||
46 | - $(RM) $(NAME).so* | ||
47 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/rules_yocto.mk b/dynamic-layers/selinux/android-tools/android-tools/rules_yocto.mk new file mode 100644 index 0000000..5e217f4 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/rules_yocto.mk | |||
@@ -0,0 +1,4 @@ | |||
1 | CPPFLAGS += -fPIC | ||
2 | ifndef OUT_DIR | ||
3 | OUT_DIR = ../../debian/out | ||
4 | endif | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch new file mode 100644 index 0000000..d17adff --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | patching simg2img.mk to build in yocto environment. | ||
2 | |||
3 | Changes include: | ||
4 | Introduced an output folder which will keep all the outputs from the | ||
5 | android-tools. | ||
6 | |||
7 | Adding an include file that is setting the common flags. | ||
8 | Changed the cppflag to include the headers from other components | ||
9 | of android-tools | ||
10 | |||
11 | Modified LDflags so that the libraries that are coming from other android-tools | ||
12 | are searched in the output folder. | ||
13 | |||
14 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | |||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- git/system/core/debian/simg2img.mk 2021-05-12 09:47:52.577840520 +0000 | ||
21 | +++ git/system/core/debian/simg2img.mk 2021-05-12 09:51:43.525678276 +0000 | ||
22 | @@ -1,13 +1,14 @@ | ||
23 | +include ../../rules_yocto.mk | ||
24 | NAME = simg2img | ||
25 | SOURCES = simg2img.cpp sparse_crc32.cpp | ||
26 | SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) | ||
27 | CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 | ||
28 | -LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
29 | - -Wl,-rpath-link=. \ | ||
30 | - -L. -lsparse | ||
31 | +LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
32 | + -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
33 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lsparse | ||
34 | |||
35 | build: $(SOURCES) | ||
36 | - $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
37 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
38 | |||
39 | clean: | ||
40 | - $(RM) libsparse/$(NAME) | ||
41 | + $(RM) $(OUT_DIR)/usr/bin/$(NAME) | ||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch b/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch new file mode 100644 index 0000000..079ade4 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | To Fix the below error | ||
2 | |||
3 | In file included from libunwindstack/DwarfSection.cpp:21: | ||
4 | | libunwindstack/include/unwindstack/DwarfMemory.h:32:29: error: unknown type name 'size_t'; did you mean 'std::size_t'? | ||
5 | | bool ReadBytes(void* dst, size_t num_bytes); | ||
6 | | ^~~~~~ | ||
7 | | std::size_t | ||
8 | |||
9 | --- ./system/core/libunwindstack/include/unwindstack/DwarfMemory.h 2021-05-22 00:52:15.132452862 +0000 | ||
10 | +++ ./system/core/libunwindstack/include/unwindstack/DwarfMemory.h 2021-05-22 00:53:09.793416724 +0000 | ||
11 | @@ -23,7 +23,7 @@ | ||
12 | |||
13 | // Forward declarations. | ||
14 | class Memory; | ||
15 | - | ||
16 | +using namespace std; | ||
17 | class DwarfMemory { | ||
18 | public: | ||
19 | DwarfMemory(Memory* memory) : memory_(memory) {} | ||
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" | ||