diff options
Diffstat (limited to 'dynamic-layers/selinux/android-tools/android-tools/core')
16 files changed, 0 insertions, 971 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch deleted file mode 100644 index d2ba525..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | From d133fc2c71fb6b0358af453b03bcb6d1874e902a Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 12:25:40 +0100 | ||
4 | Subject: [PATCH 01/15] patching adb.mk to build in yocto environment. | ||
5 | |||
6 | Changes include: | ||
7 | Introduced an output folder which will keep all the outputs from the | ||
8 | android-tools. | ||
9 | |||
10 | Adding an include file that is setting the common flags. | ||
11 | Changed the cppflag to include the headers from other components | ||
12 | of android-tools | ||
13 | |||
14 | Modified LDflags so that the libraries that are coming from other android-tools | ||
15 | are searched in the output folder. | ||
16 | |||
17 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
18 | |||
19 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | --- | ||
23 | debian/adb.mk | 12 +++++++----- | ||
24 | 1 file changed, 7 insertions(+), 5 deletions(-) | ||
25 | |||
26 | diff --git a/debian/adb.mk b/debian/adb.mk | ||
27 | index 8dbacf9a..97c9d6ca 100644 | ||
28 | --- a/debian/adb.mk | ||
29 | +++ b/debian/adb.mk | ||
30 | @@ -1,3 +1,4 @@ | ||
31 | +include ../../rules_yocto.mk | ||
32 | NAME = adb | ||
33 | |||
34 | SOURCES = client/adb_client.cpp \ | ||
35 | @@ -12,10 +13,10 @@ SOURCES = client/adb_client.cpp \ | ||
36 | |||
37 | SOURCES := $(foreach source, $(SOURCES), adb/$(source)) | ||
38 | CXXFLAGS += -std=gnu++2a | ||
39 | -CPPFLAGS += -Iinclude -Iadb -Ibase/include \ | ||
40 | +CPPFLAGS += -Iinclude -Iadb -Ibase/include -I$(OUT_DIR)/usr/include/ \ | ||
41 | -DADB_VERSION='"$(DEB_VERSION)"' -DADB_HOST=1 -D_GNU_SOURCE | ||
42 | -LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=. \ | ||
43 | - -lpthread -L. -ladb -lbase | ||
44 | +LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
45 | + -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -ladb -lbase | ||
46 | |||
47 | # -latomic should be the last library specified | ||
48 | # https://github.com/android/ndk/issues/589 | ||
49 | @@ -24,7 +25,8 @@ ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),) | ||
50 | endif | ||
51 | |||
52 | build: $(SOURCES) | ||
53 | - $(CXX) $^ -o adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
54 | + mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb | ||
55 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
56 | |||
57 | clean: | ||
58 | - $(RM) adb/$(NAME) | ||
59 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) | ||
60 | -- | ||
61 | 2.36.1.vfs.0.0 | ||
62 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch deleted file mode 100644 index 1281caa..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | From f802e7685cfbdd66d74da2975b3a1c6d77f1a2de Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 12:28:10 +0100 | ||
4 | Subject: [PATCH 02/15] libadb.mk: modifications to make it build in yocto | ||
5 | environment | ||
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 | debian/libadb.mk | 11 ++++++----- | ||
19 | 1 file changed, 6 insertions(+), 5 deletions(-) | ||
20 | |||
21 | diff --git a/debian/libadb.mk b/debian/libadb.mk | ||
22 | index ae240c98..db5da353 100644 | ||
23 | --- a/debian/libadb.mk | ||
24 | +++ b/debian/libadb.mk | ||
25 | @@ -1,3 +1,4 @@ | ||
26 | +include ../../rules_yocto.mk | ||
27 | NAME := libadb | ||
28 | |||
29 | LIBADB_SRC_FILES := \ | ||
30 | @@ -43,18 +44,18 @@ CPPFLAGS += \ | ||
31 | -Ibase/include \ | ||
32 | -Idiagnose_usb/include \ | ||
33 | -Ilibcrypto_utils/include \ | ||
34 | - -Iinclude \ | ||
35 | + -Iinclude -I$(OUT_DIR)/usr/include \ | ||
36 | -DPLATFORM_TOOLS_VERSION='"$(PLATFORM_TOOLS_VERSION)"' \ | ||
37 | -DADB_HOST=1 -DADB_VERSION='"$(DEB_VERSION)"' | ||
38 | |||
39 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
40 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
41 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ | ||
42 | - -lpthread -L. -lbase -lcutils -lcrypto_utils -lusb-1.0 | ||
43 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ | ||
44 | + -lpthread -lbase -lcutils -lcrypto_utils -lusb-1.0 | ||
45 | |||
46 | $(NAME).so: $(SOURCES) | ||
47 | - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
48 | - ln -s $(NAME).so.0 $(NAME).so | ||
49 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
50 | + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
51 | |||
52 | transport_mdns_unsupported.cpp: | ||
53 | echo 'void init_mdns_transport_discovery(void) {}' > transport_mdns_unsupported.cpp | ||
54 | -- | ||
55 | 2.36.1.vfs.0.0 | ||
56 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0003-socket.h-removing-dependency-of-gtest.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0003-socket.h-removing-dependency-of-gtest.patch deleted file mode 100644 index 56c25ea..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0003-socket.h-removing-dependency-of-gtest.patch +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | From 4fdd086c2e9c85bc5a367a861696191e190cebc9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
3 | Date: Thu, 2 Mar 2023 17:20:48 +0100 | ||
4 | Subject: [PATCH 03/15] socket.h: removing dependency of gtest | ||
5 | |||
6 | Removed the dependency of gtest on the build of fastboot binary. | ||
7 | Fixes below error | ||
8 | |||
9 | In file included from fastboot/fastboot.cpp:70: | ||
10 | | In file included from fastboot/tcp.h:36: | ||
11 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
12 | | #include <gtest/gtest_prod.h> | ||
13 | | ^~~~~~~~~~~~~~~~~~~~ | ||
14 | | 1 error generated. | ||
15 | | In file included from fastboot/socket.cpp:29: | ||
16 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
17 | | #include <gtest/gtest_prod.h> | ||
18 | | ^~~~~~~~~~~~~~~~~~~~ | ||
19 | | 1 error generated. | ||
20 | | In file included from fastboot/tcp.cpp:29: | ||
21 | | In file included from fastboot/tcp.h:36: | ||
22 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
23 | | #include <gtest/gtest_prod.h> | ||
24 | | ^~~~~~~~~~~~~~~~~~~~ | ||
25 | | 1 error generated. | ||
26 | | In file included from fastboot/udp.cpp:31: | ||
27 | | In file included from fastboot/udp.h:34: | ||
28 | | fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found | ||
29 | | #include <gtest/gtest_prod.h> | ||
30 | | ^~~~~~~~~~~~~~~~~~~~ | ||
31 | | 1 error generated. | ||
32 | |||
33 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
34 | --- | ||
35 | fastboot/socket.h | 3 --- | ||
36 | 1 file changed, 3 deletions(-) | ||
37 | |||
38 | diff --git a/fastboot/socket.h b/fastboot/socket.h | ||
39 | index e791f2c8..671fc115 100644 | ||
40 | --- a/fastboot/socket.h | ||
41 | +++ b/fastboot/socket.h | ||
42 | @@ -40,7 +40,6 @@ | ||
43 | |||
44 | #include <android-base/macros.h> | ||
45 | #include <cutils/sockets.h> | ||
46 | -#include <gtest/gtest_prod.h> | ||
47 | |||
48 | // Socket interface to be implemented for each platform. | ||
49 | class Socket { | ||
50 | @@ -119,8 +118,6 @@ class Socket { | ||
51 | socket_send_buffers_function_ = &socket_send_buffers; | ||
52 | |||
53 | private: | ||
54 | - FRIEND_TEST(SocketTest, TestTcpSendBuffers); | ||
55 | - FRIEND_TEST(SocketTest, TestUdpSendBuffers); | ||
56 | |||
57 | DISALLOW_COPY_AND_ASSIGN(Socket); | ||
58 | }; | ||
59 | -- | ||
60 | 2.36.1.vfs.0.0 | ||
61 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch deleted file mode 100644 index 82ec560..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | From e826f68c68e05b0f5cc3b3c10d7d9e4deb135114 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:14:15 +0100 | ||
4 | Subject: [PATCH 04/15] patching fastboot.mk to build in yocto environment. | ||
5 | |||
6 | Changes include: | ||
7 | Introduced an output folder which will keep all the outputs from the | ||
8 | android-tools. | ||
9 | |||
10 | Adding an include file that is setting the common flags. | ||
11 | Changed the cppflag to include the headers from other components | ||
12 | of android-tools | ||
13 | |||
14 | Modified LDflags so that the libraries that are coming from other android-tools | ||
15 | are searched in the output folder. | ||
16 | |||
17 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
18 | |||
19 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | --- | ||
23 | debian/fastboot.mk | 12 +++++++----- | ||
24 | 1 file changed, 7 insertions(+), 5 deletions(-) | ||
25 | |||
26 | diff --git a/debian/fastboot.mk b/debian/fastboot.mk | ||
27 | index d1aba626..e75fa87c 100644 | ||
28 | --- a/debian/fastboot.mk | ||
29 | +++ b/debian/fastboot.mk | ||
30 | @@ -1,3 +1,4 @@ | ||
31 | +include ../../rules_yocto.mk | ||
32 | NAME = fastboot | ||
33 | fastboot_SOURCES = \ | ||
34 | bootimg_utils.cpp \ | ||
35 | @@ -38,11 +39,11 @@ CPPFLAGS += \ | ||
36 | -Ifs_mgr/liblp/include \ | ||
37 | -I/usr/include/android/openssl \ | ||
38 | -Ilibsparse/include \ | ||
39 | - -Ilibziparchive/include | ||
40 | + -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ | ||
41 | LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
42 | -fuse-ld=gold \ | ||
43 | - -Wl,-rpath-link=. \ | ||
44 | - -L. -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ | ||
45 | + -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
46 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ | ||
47 | -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
48 | -l7z \ | ||
49 | |||
50 | @@ -53,7 +54,8 @@ ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),) | ||
51 | endif | ||
52 | |||
53 | build: $(SOURCES) | ||
54 | - $(CXX) $^ -o fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
55 | + mkdir --parents $(OUT_DIR)/usr/bin/fastboot | ||
56 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
57 | |||
58 | clean: | ||
59 | - $(RM) fastboot/$(NAME) | ||
60 | + $(RM) $(OUT_DIR)/usr/bin/fastboot/$(NAME) | ||
61 | -- | ||
62 | 2.36.1.vfs.0.0 | ||
63 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch deleted file mode 100644 index d465ad6..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | From a4839f29e1286b0c53208a45b9c237d81021f829 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:15:47 +0100 | ||
4 | Subject: [PATCH 05/15] fastboot: don't use sparse_file_import_auto() in | ||
5 | load_buf_fd() | ||
6 | |||
7 | upstream commit taken as below Original Issue link https://android-review.googlesource.com/c/platform/system/core/+/1123485 | ||
8 | |||
9 | Commit taken below: | ||
10 | |||
11 | fastboot: don't use sparse_file_import_auto() in load_buf_fd() | ||
12 | |||
13 | load_buf_fd() attempts to find the size of the file that it is about | ||
14 | to load by first calling sparse_file_import_auto() then using | ||
15 | sparse_file_len() upon success or falling back to the file size on the | ||
16 | filesystem on failure. | ||
17 | |||
18 | This is problematic however as sparse_file_import_auto() creates a | ||
19 | sparse_file out of the normal file, but does not resparse it, so an | ||
20 | assertion fails during the sparse_file_len() call. | ||
21 | |||
22 | This is fixed by using sparse_file_import() instead. This will fail | ||
23 | in the case that the file is not sparse and the call to | ||
24 | sparse_file_len() will be properly skipped. | ||
25 | |||
26 | Bug: 140538105 | ||
27 | Test: flash blueline factory image with assertions enabled in | ||
28 | libsparse/sparse.cpp | ||
29 | |||
30 | Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c | ||
31 | |||
32 | https://android.googlesource.com/platform/system/core/+/fbb9535aaea5ae4011f3c3edf4c00b27452f57ec | ||
33 | Upstream-Status: Backport [commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec] | ||
34 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
35 | --- | ||
36 | fastboot/fastboot.cpp | 2 +- | ||
37 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
38 | |||
39 | diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp | ||
40 | index 3b7b5571..0ae9402e 100644 | ||
41 | --- a/fastboot/fastboot.cpp | ||
42 | +++ b/fastboot/fastboot.cpp | ||
43 | @@ -869,7 +869,7 @@ static bool load_buf_fd(int fd, struct fastboot_buffer* buf) { | ||
44 | return false; | ||
45 | } | ||
46 | |||
47 | - if (sparse_file* s = sparse_file_import_auto(fd, false, false)) { | ||
48 | + if (sparse_file* s = sparse_file_import(fd, false, false)) { | ||
49 | buf->image_size = sparse_file_len(s, false, false); | ||
50 | sparse_file_destroy(s); | ||
51 | } else { | ||
52 | -- | ||
53 | 2.36.1.vfs.0.0 | ||
54 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch deleted file mode 100644 index 6211f04..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | From 22c7140dc170ecb26bde33fed4c9249b164f8d3c Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:19:08 +0100 | ||
4 | Subject: [PATCH 06/15] libbase.mk: modifications to make it build in yocto | ||
5 | environment | ||
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 | debian/libbase.mk | 8 +++++--- | ||
19 | 1 file changed, 5 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/debian/libbase.mk b/debian/libbase.mk | ||
22 | index 80da48f3..e6c3e365 100644 | ||
23 | --- a/debian/libbase.mk | ||
24 | +++ b/debian/libbase.mk | ||
25 | @@ -1,3 +1,4 @@ | ||
26 | +include ../../rules_yocto.mk | ||
27 | NAME = libbase | ||
28 | SOURCES = \ | ||
29 | chrono_utils.cpp \ | ||
30 | @@ -20,8 +21,9 @@ CPPFLAGS += -Iinclude -Ibase/include | ||
31 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 | ||
32 | |||
33 | build: $(SOURCES) | ||
34 | - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
35 | - ln -s $(NAME).so.0 $(NAME).so | ||
36 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
37 | + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
38 | + cp -r base/include/* $(OUT_DIR)/usr/include/ | ||
39 | |||
40 | clean: | ||
41 | - $(RM) $(NAME).so* | ||
42 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
43 | -- | ||
44 | 2.36.1.vfs.0.0 | ||
45 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch deleted file mode 100644 index af92726..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | From cae154ec12a864ada8372b393fceb1d682c78c60 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 14:38:05 +0100 | ||
4 | Subject: [PATCH 07/15] libcrypto_utils.mk: modifications to make it build in | ||
5 | yocto environment | ||
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 and header to the OUT_DIR | ||
15 | |||
16 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
17 | --- | ||
18 | debian/libcrypto_utils.mk | 14 ++++++++------ | ||
19 | 1 file changed, 8 insertions(+), 6 deletions(-) | ||
20 | |||
21 | diff --git a/debian/libcrypto_utils.mk b/debian/libcrypto_utils.mk | ||
22 | index 3afd4124..80c52f30 100644 | ||
23 | --- a/debian/libcrypto_utils.mk | ||
24 | +++ b/debian/libcrypto_utils.mk | ||
25 | @@ -1,15 +1,17 @@ | ||
26 | +include ../../rules_yocto.mk | ||
27 | NAME:= libcrypto_utils | ||
28 | SOURCES := android_pubkey.c | ||
29 | SOURCES := $(foreach source, $(SOURCES), libcrypto_utils/$(source)) | ||
30 | -CPPFLAGS += -Ilibcrypto_utils/include -Iinclude | ||
31 | +CPPFLAGS += -Ilibcrypto_utils/include -Iinclude -I$(OUT_DIR)/usr/include | ||
32 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
33 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
34 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
35 | - -lcrypto -Wl,-z,defs | ||
36 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
37 | + -l:libcrypto.so.0 -Wl,-z,defs | ||
38 | |||
39 | build: $(SOURCES) | ||
40 | - $(CC) $^ -o $(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) | ||
41 | - ln -s $(NAME).so.0 $(NAME).so | ||
42 | + $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) | ||
43 | + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
44 | + cp -r libcrypto_utils/include/* $(OUT_DIR)/usr/include/ | ||
45 | |||
46 | clean: | ||
47 | - $(RM) $(NAME).so* | ||
48 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
49 | -- | ||
50 | 2.36.1.vfs.0.0 | ||
51 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch deleted file mode 100644 index b876229..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | From 4af9cc9e93e5cb09583c0fedeccae3fa195dbe7b Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:26:08 +0100 | ||
4 | Subject: [PATCH 08/15] libcutils: modifications to make it build in yocto | ||
5 | environment | ||
6 | --- | ||
7 | debian/libcutils.mk | 10 ++++++---- | ||
8 | 1 file changed, 6 insertions(+), 4 deletions(-) | ||
9 | |||
10 | diff --git a/debian/libcutils.mk b/debian/libcutils.mk | ||
11 | index 7cd18d87..bb45fb57 100644 | ||
12 | --- a/debian/libcutils.mk | ||
13 | +++ b/debian/libcutils.mk | ||
14 | @@ -1,3 +1,4 @@ | ||
15 | +include ../../rules_yocto.mk | ||
16 | NAME = libcutils | ||
17 | |||
18 | # copied from libcutils/Android.bp | ||
19 | @@ -50,14 +51,15 @@ CPPFLAGS += \ | ||
20 | -Iinclude \ | ||
21 | |||
22 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
23 | - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L. -llog -lbase | ||
24 | + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -llog -lbase | ||
25 | |||
26 | build: $(COBJECTS) $(CXXOBJECTS) | ||
27 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
28 | - ln -s $(NAME).so.0 $(NAME).so | ||
29 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
30 | + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
31 | + cp -r libcutils/include/cutils $(OUT_DIR)/usr/include/ | ||
32 | |||
33 | clean: | ||
34 | - $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* | ||
35 | + $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
36 | |||
37 | $(COBJECTS): %.o: %.c | ||
38 | $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) | ||
39 | -- | ||
40 | 2.36.1.vfs.0.0 | ||
41 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch deleted file mode 100644 index ad9b8dd..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | From bea40821d787ca31b38d5879fbf751be1dbea622 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:33:30 +0100 | ||
4 | Subject: [PATCH 09/15] patching img2simg.mk to build in yocto environment. | ||
5 | |||
6 | Changes include: | ||
7 | Introduced an output folder which will keep all the outputs from the | ||
8 | android-tools. | ||
9 | |||
10 | Adding an include file that is setting the common flags. | ||
11 | Changed the cppflag to include the headers from other components | ||
12 | of android-tools | ||
13 | |||
14 | Modified LDflags so that the libraries that are coming from other android-tools | ||
15 | are searched in the output folder. | ||
16 | |||
17 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
18 | |||
19 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | --- | ||
23 | debian/img2simg.mk | 11 ++++++----- | ||
24 | 1 file changed, 6 insertions(+), 5 deletions(-) | ||
25 | |||
26 | diff --git a/debian/img2simg.mk b/debian/img2simg.mk | ||
27 | index f1036cef..94772381 100644 | ||
28 | --- a/debian/img2simg.mk | ||
29 | +++ b/debian/img2simg.mk | ||
30 | @@ -1,13 +1,15 @@ | ||
31 | +include ../../rules_yocto.mk | ||
32 | NAME = img2simg | ||
33 | SOURCES = img2simg.cpp | ||
34 | SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) | ||
35 | CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 | ||
36 | -LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
37 | - -Wl,-rpath-link=. \ | ||
38 | - -L. -lsparse | ||
39 | +LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
40 | + -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
41 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -lsparse | ||
42 | |||
43 | build: $(SOURCES) | ||
44 | - $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
45 | + mkdir --parents $(OUT_DIR)/usr/bin | ||
46 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
47 | |||
48 | clean: | ||
49 | - $(RM) libsparse/$(NAME) | ||
50 | + $(RM) $(OUT_DIR)/usr/bin/$(NAME) | ||
51 | -- | ||
52 | 2.36.1.vfs.0.0 | ||
53 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch deleted file mode 100644 index b7a72b8..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | From 08441cf4334b911dba8c493dca3b1e2166c7d322 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:34:34 +0100 | ||
4 | Subject: [PATCH 10/15] patching simg2img.mk to build in yocto environment. | ||
5 | |||
6 | Changes include: | ||
7 | Introduced an output folder which will keep all the outputs from the | ||
8 | android-tools. | ||
9 | |||
10 | Adding an include file that is setting the common flags. | ||
11 | Changed the cppflag to include the headers from other components | ||
12 | of android-tools | ||
13 | |||
14 | Modified LDflags so that the libraries that are coming from other android-tools | ||
15 | are searched in the output folder. | ||
16 | |||
17 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
18 | |||
19 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | --- | ||
23 | debian/simg2img.mk | 11 ++++++----- | ||
24 | 1 file changed, 6 insertions(+), 5 deletions(-) | ||
25 | |||
26 | diff --git a/debian/simg2img.mk b/debian/simg2img.mk | ||
27 | index 07fb56b4..d319c87e 100644 | ||
28 | --- a/debian/simg2img.mk | ||
29 | +++ b/debian/simg2img.mk | ||
30 | @@ -1,13 +1,15 @@ | ||
31 | +include ../../rules_yocto.mk | ||
32 | NAME = simg2img | ||
33 | SOURCES = simg2img.cpp sparse_crc32.cpp | ||
34 | SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) | ||
35 | CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 | ||
36 | -LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
37 | - -Wl,-rpath-link=. \ | ||
38 | - -L. -lsparse | ||
39 | +LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
40 | + -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
41 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lsparse | ||
42 | |||
43 | build: $(SOURCES) | ||
44 | - $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
45 | + mkdir --parents $(OUT_DIR)/usr/bin | ||
46 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) | ||
47 | |||
48 | clean: | ||
49 | - $(RM) libsparse/$(NAME) | ||
50 | + $(RM) $(OUT_DIR)/usr/bin/$(NAME) | ||
51 | -- | ||
52 | 2.36.1.vfs.0.0 | ||
53 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch deleted file mode 100644 index 7a37757..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | From 99e46ec157e6fb912258ac6506896196e53d790b Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:35:44 +0100 | ||
4 | Subject: [PATCH 11/15] patching liblog.mk to build in yocto environment. | ||
5 | |||
6 | Changes include: | ||
7 | Introduced an output folder which will keep all the outputs from the | ||
8 | android-tools. | ||
9 | |||
10 | Adding an include file that is setting the common flags. | ||
11 | Changed the cppflag to include the headers from other components | ||
12 | of android-tools | ||
13 | |||
14 | Modified LDflags so that the libraries that are coming from other android-tools | ||
15 | are searched in the output folder. | ||
16 | |||
17 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
18 | |||
19 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | --- | ||
23 | debian/liblog.mk | 8 +++++--- | ||
24 | 1 file changed, 5 insertions(+), 3 deletions(-) | ||
25 | |||
26 | diff --git a/debian/liblog.mk b/debian/liblog.mk | ||
27 | index eb1909b9..3b40d710 100644 | ||
28 | --- a/debian/liblog.mk | ||
29 | +++ b/debian/liblog.mk | ||
30 | @@ -1,3 +1,4 @@ | ||
31 | +include ../../rules_yocto.mk | ||
32 | NAME = liblog | ||
33 | |||
34 | # copied from liblog/Android.bp | ||
35 | @@ -39,11 +40,12 @@ CPPFLAGS += \ | ||
36 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread | ||
37 | |||
38 | build: $(COBJECTS) $(CXXOBJECTS) | ||
39 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
40 | - ln -s $(NAME).so.0 $(NAME).so | ||
41 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
42 | + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
43 | + cp -r liblog/include/* $(OUT_DIR)/usr/include/ | ||
44 | |||
45 | clean: | ||
46 | - $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* | ||
47 | + $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
48 | |||
49 | $(COBJECTS): %.o: %.c | ||
50 | $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) | ||
51 | -- | ||
52 | 2.36.1.vfs.0.0 | ||
53 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch deleted file mode 100644 index 029cc1c..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | From 65ddf7ea7daae721b2d331164155542820ed3e33 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:36:58 +0100 | ||
4 | Subject: [PATCH 12/15] patching libsparse.mk to build in yocto environment. | ||
5 | |||
6 | Changes include: | ||
7 | Introduced an output folder which will keep all the outputs from the | ||
8 | android-tools. | ||
9 | |||
10 | Adding an include file that is setting the common flags. | ||
11 | Changed the cppflag to include the headers from other components | ||
12 | of android-tools | ||
13 | |||
14 | Modified LDflags so that the libraries that are coming from other android-tools | ||
15 | are searched in the output folder. | ||
16 | |||
17 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
18 | |||
19 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | --- | ||
23 | debian/libsparse.mk | 9 +++++---- | ||
24 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
25 | |||
26 | diff --git a/debian/libsparse.mk b/debian/libsparse.mk | ||
27 | index de280def..64caa45f 100644 | ||
28 | --- a/debian/libsparse.mk | ||
29 | +++ b/debian/libsparse.mk | ||
30 | @@ -1,3 +1,4 @@ | ||
31 | +include ../../rules_yocto.mk | ||
32 | NAME = libsparse | ||
33 | SOURCES = \ | ||
34 | backed_block.cpp \ | ||
35 | @@ -18,16 +19,16 @@ LDFLAGS += \ | ||
36 | -shared -Wl,-soname,$(NAME).so.0 \ | ||
37 | -lz \ | ||
38 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
39 | - -L. \ | ||
40 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
41 | -lbase | ||
42 | |||
43 | |||
44 | build: $(COBJECTS) $(CXXOBJECTS) | ||
45 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
46 | - ln -s $(NAME).so.0 $(NAME).so | ||
47 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
48 | + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
49 | |||
50 | clean: | ||
51 | - $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* | ||
52 | + $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
53 | |||
54 | $(COBJECTS): %.o: %.c | ||
55 | $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) | ||
56 | -- | ||
57 | 2.36.1.vfs.0.0 | ||
58 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch deleted file mode 100644 index b49ec3b..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | From ae2bf1925fe02ea040005df27842c77c6d02b051 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:39:24 +0100 | ||
4 | Subject: [PATCH 13/15] patching libziparchive.mk to build in yocto | ||
5 | environment. | ||
6 | |||
7 | Changes include: | ||
8 | Introduced an output folder which will keep all the outputs from the | ||
9 | android-tools. | ||
10 | |||
11 | Adding an include file that is setting the common flags. | ||
12 | Changed the cppflag to include the headers from other components | ||
13 | of android-tools | ||
14 | |||
15 | Modified LDflags so that the libraries that are coming from other android-tools | ||
16 | are searched in the output folder. | ||
17 | |||
18 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
19 | |||
20 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
21 | |||
22 | Upstream-Status: Pending | ||
23 | --- | ||
24 | debian/libziparchive.mk | 12 +++++++----- | ||
25 | 1 file changed, 7 insertions(+), 5 deletions(-) | ||
26 | |||
27 | diff --git a/debian/libziparchive.mk b/debian/libziparchive.mk | ||
28 | index 803ea58e..6a697059 100644 | ||
29 | --- a/debian/libziparchive.mk | ||
30 | +++ b/debian/libziparchive.mk | ||
31 | @@ -1,3 +1,4 @@ | ||
32 | +include ../../rules_yocto.mk | ||
33 | NAME = libziparchive | ||
34 | SOURCES = zip_archive.cc \ | ||
35 | zip_archive_stream_entry.cc\ | ||
36 | @@ -5,14 +6,15 @@ SOURCES = zip_archive.cc \ | ||
37 | SOURCES := $(foreach source, $(SOURCES), libziparchive/$(source)) | ||
38 | CXXFLAGS += -std=gnu++17 | ||
39 | CPPFLAGS += -DZLIB_CONST -D_FILE_OFFSET_BITS=64 \ | ||
40 | - -Iinclude -Ibase/include -Ilibziparchive/include | ||
41 | + -Iinclude -Ibase/include -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ | ||
42 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
43 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
44 | - -lz -L. -llog -lbase | ||
45 | + -lz -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -llog -lbase | ||
46 | |||
47 | build: $(SOURCES) | ||
48 | - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
49 | - ln -s $(NAME).so.0 $(NAME).so | ||
50 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | ||
51 | + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so | ||
52 | + cp -r libziparchive/include/* $(OUT_DIR)/usr/include/ | ||
53 | |||
54 | clean: | ||
55 | - $(RM) $(NAME).so* | ||
56 | + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
57 | -- | ||
58 | 2.36.1.vfs.0.0 | ||
59 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch deleted file mode 100644 index 433caf2..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | From a99b74f25c7f786e26b5400218090d86596d4541 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:40:32 +0100 | ||
4 | Subject: [PATCH 14/15] patching libbacktrace.mk to build in yocto environment. | ||
5 | |||
6 | Changes include: | ||
7 | Introduced an output folder which will keep all the outputs from the | ||
8 | android-tools. | ||
9 | |||
10 | Adding an include file that is setting the common flags. | ||
11 | Changed the cppflag to include the headers from other components | ||
12 | of android-tools | ||
13 | |||
14 | Modified LDflags so that the libraries that are coming from other android-tools | ||
15 | are searched in the output folder. | ||
16 | |||
17 | Modified the build rule so that it outputs the binary to the OUT_DIR | ||
18 | |||
19 | Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | --- | ||
23 | debian/libbacktrace.mk | 14 +++++++------- | ||
24 | 1 file changed, 7 insertions(+), 7 deletions(-) | ||
25 | |||
26 | diff --git a/debian/libbacktrace.mk b/debian/libbacktrace.mk | ||
27 | index 330d211c..229b39d9 100644 | ||
28 | --- a/debian/libbacktrace.mk | ||
29 | +++ b/debian/libbacktrace.mk | ||
30 | @@ -1,5 +1,5 @@ | ||
31 | |||
32 | -include /usr/share/dpkg/architecture.mk | ||
33 | +include ../../rules_yocto.mk | ||
34 | |||
35 | NAME = libbacktrace | ||
36 | |||
37 | @@ -88,11 +88,11 @@ CPPFLAGS += \ | ||
38 | -Ilibprocinfo/include \ | ||
39 | -Ilibunwindstack/include \ | ||
40 | -I/usr/include/android/lzma \ | ||
41 | - -I/usr/include/android/unwind | ||
42 | + -I$(OUT_DIR)/usr/include/android/libunwind | ||
43 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | ||
44 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
45 | - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ | ||
46 | - -L. -lbase -llog -lpthread -l7z | ||
47 | + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ | ||
48 | + -lbase -llog -lpthread -l7z | ||
49 | |||
50 | # -latomic should be the last library specified | ||
51 | # https://github.com/android/ndk/issues/589 | ||
52 | @@ -104,11 +104,11 @@ ifeq ($(DEB_HOST_ARCH), mipsel) | ||
53 | endif | ||
54 | |||
55 | build: $(COBJECTS) $(CXXOBJECTS) $(OBJECTS_ASSEMBLY) | ||
56 | - $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) | ||
57 | - ln -s $(NAME).so.0 $(NAME).so | ||
58 | + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) | ||
59 | + ln -sf $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(NAME).so | ||
60 | |||
61 | clean: | ||
62 | - $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* | ||
63 | + $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* | ||
64 | |||
65 | $(CXXOBJECTS): %.o: %.cpp | ||
66 | $(CXX) $< -o $@ $(CXXFLAGS) $(CPPFLAGS) | ||
67 | -- | ||
68 | 2.36.1.vfs.0.0 | ||
69 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0015-Use-namespace-std-to-compile-libbacktrace.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0015-Use-namespace-std-to-compile-libbacktrace.patch deleted file mode 100644 index d8fee66..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0015-Use-namespace-std-to-compile-libbacktrace.patch +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | From 19a16829ef7b7ffd6466b9b90585d667a1663969 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Fri, 3 Mar 2023 13:43:50 +0100 | ||
4 | Subject: [PATCH 15/15] Use namespace std to compile libbacktrace | ||
5 | |||
6 | To Fix the below error | ||
7 | |||
8 | In file included from libunwindstack/DwarfSection.cpp:21: | ||
9 | | libunwindstack/include/unwindstack/DwarfMemory.h:32:29: error: unknown type name 'size_t'; did you mean 'std::size_t'? | ||
10 | | bool ReadBytes(void* dst, size_t num_bytes); | ||
11 | | ^~~~~~ | ||
12 | | std::size_t | ||
13 | --- | ||
14 | libunwindstack/include/unwindstack/DwarfMemory.h | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/libunwindstack/include/unwindstack/DwarfMemory.h b/libunwindstack/include/unwindstack/DwarfMemory.h | ||
18 | index 244c0e12..0a3fefeb 100644 | ||
19 | --- a/libunwindstack/include/unwindstack/DwarfMemory.h | ||
20 | +++ b/libunwindstack/include/unwindstack/DwarfMemory.h | ||
21 | @@ -23,7 +23,7 @@ namespace unwindstack { | ||
22 | |||
23 | // Forward declarations. | ||
24 | class Memory; | ||
25 | - | ||
26 | +using namespace std; | ||
27 | class DwarfMemory { | ||
28 | public: | ||
29 | DwarfMemory(Memory* memory) : memory_(memory) {} | ||
30 | -- | ||
31 | 2.36.1.vfs.0.0 | ||
32 | |||
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0016-Adapt-adbd-to-work-with-yocto.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0016-Adapt-adbd-to-work-with-yocto.patch deleted file mode 100644 index 8819431..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/core/0016-Adapt-adbd-to-work-with-yocto.patch +++ /dev/null | |||
@@ -1,161 +0,0 @@ | |||
1 | From 1c836e4402ae170b3e0bf31da9012b7a3b1c40a1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Wed, 8 Mar 2023 15:21:49 +0100 | ||
4 | Subject: [PATCH] Adapt adbd to work with yocto | ||
5 | |||
6 | Co-authored-by: JJ Robertson <jrobertson@snap.com> | ||
7 | Co-authored-by: Wejdene Smida <wsmida@snap.com> | ||
8 | Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
9 | --- | ||
10 | adb/daemon/file_sync_service.cpp | 4 ++-- | ||
11 | adb/daemon/main.cpp | 4 ++-- | ||
12 | adb/daemon/reboot_service.cpp | 5 ++++- | ||
13 | adb/daemon/set_verity_enable_state_service.cpp | 6 +++++- | ||
14 | adb/daemon/shell_service.cpp | 4 ++++ | ||
15 | adb/types.h | 1 + | ||
16 | 6 files changed, 18 insertions(+), 6 deletions(-) | ||
17 | |||
18 | diff --git a/adb/daemon/file_sync_service.cpp b/adb/daemon/file_sync_service.cpp | ||
19 | index e82a51f2..ba112cbe 100644 | ||
20 | --- a/adb/daemon/file_sync_service.cpp | ||
21 | +++ b/adb/daemon/file_sync_service.cpp | ||
22 | @@ -111,7 +111,7 @@ static bool secure_mkdirs(const std::string& path) { | ||
23 | partial_path += path_component; | ||
24 | |||
25 | if (should_use_fs_config(partial_path)) { | ||
26 | - fs_config(partial_path.c_str(), 1, nullptr, &uid, &gid, &mode, &capabilities); | ||
27 | + // fs_config(partial_path.c_str(), 1, nullptr, &uid, &gid, &mode, &capabilities); | ||
28 | } | ||
29 | if (adb_mkdir(partial_path.c_str(), mode) == -1) { | ||
30 | if (errno != EEXIST) { | ||
31 | @@ -434,7 +434,7 @@ static bool do_send(int s, const std::string& spec, std::vector<char>& buffer) { | ||
32 | uint64_t capabilities = 0; | ||
33 | if (should_use_fs_config(path)) { | ||
34 | unsigned int broken_api_hack = mode; | ||
35 | - fs_config(path.c_str(), 0, nullptr, &uid, &gid, &broken_api_hack, &capabilities); | ||
36 | + // fs_config(path.c_str(), 0, nullptr, &uid, &gid, &broken_api_hack, &capabilities); | ||
37 | mode = broken_api_hack; | ||
38 | } | ||
39 | |||
40 | diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp | ||
41 | index e5a49171..c75263c4 100644 | ||
42 | --- a/adb/daemon/main.cpp | ||
43 | +++ b/adb/daemon/main.cpp | ||
44 | @@ -191,6 +191,8 @@ int adbd_main(int server_port) { | ||
45 | umask(0); | ||
46 | |||
47 | signal(SIGPIPE, SIG_IGN); | ||
48 | + signal(SIGINT, SIG_DFL); | ||
49 | + signal(SIGQUIT, SIG_DFL); | ||
50 | |||
51 | #if defined(__BIONIC__) | ||
52 | auto fdsan_level = android_fdsan_get_error_level(); | ||
53 | @@ -232,13 +234,11 @@ int adbd_main(int server_port) { | ||
54 | |||
55 | bool is_usb = false; | ||
56 | |||
57 | -#if defined(__ANDROID__) | ||
58 | if (access(USB_FFS_ADB_EP0, F_OK) == 0) { | ||
59 | // Listen on USB. | ||
60 | usb_init(); | ||
61 | is_usb = true; | ||
62 | } | ||
63 | -#endif | ||
64 | |||
65 | // If one of these properties is set, also listen on that port. | ||
66 | // If one of the properties isn't set and we couldn't listen on usb, listen | ||
67 | diff --git a/adb/daemon/reboot_service.cpp b/adb/daemon/reboot_service.cpp | ||
68 | index a5a11b86..6bd069d4 100644 | ||
69 | --- a/adb/daemon/reboot_service.cpp | ||
70 | +++ b/adb/daemon/reboot_service.cpp | ||
71 | @@ -28,7 +28,9 @@ | ||
72 | #include <android-base/logging.h> | ||
73 | #include <android-base/properties.h> | ||
74 | #include <android-base/stringprintf.h> | ||
75 | -#include <bootloader_message/bootloader_message.h> | ||
76 | +// #include <bootloader_message/bootloader_message.h> | ||
77 | +#include <linux/reboot.h> | ||
78 | +#include <sys/signal.h> | ||
79 | #include <cutils/android_reboot.h> | ||
80 | |||
81 | #include "adb_io.h" | ||
82 | @@ -76,6 +78,7 @@ void reboot_service(unique_fd fd, const std::string& arg) { | ||
83 | return; | ||
84 | } | ||
85 | } | ||
86 | + syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, reboot_arg.c_str()); | ||
87 | // Don't return early. Give the reboot command time to take effect | ||
88 | // to avoid messing up scripts which do "adb reboot && adb wait-for-device" | ||
89 | while (true) { | ||
90 | diff --git a/adb/daemon/set_verity_enable_state_service.cpp b/adb/daemon/set_verity_enable_state_service.cpp | ||
91 | index 889229fe..51e9be93 100644 | ||
92 | --- a/adb/daemon/set_verity_enable_state_service.cpp | ||
93 | +++ b/adb/daemon/set_verity_enable_state_service.cpp | ||
94 | @@ -22,7 +22,7 @@ | ||
95 | #include <errno.h> | ||
96 | #include <fcntl.h> | ||
97 | #include <inttypes.h> | ||
98 | -#include <libavb_user/libavb_user.h> | ||
99 | +// #include <libavb_user/libavb_user.h> | ||
100 | #include <stdarg.h> | ||
101 | #include <stdio.h> | ||
102 | #include <sys/mount.h> | ||
103 | @@ -65,6 +65,7 @@ static bool make_block_device_writable(const std::string& dev) { | ||
104 | /* Turn verity on/off */ | ||
105 | static bool set_verity_enabled_state(int fd, const char* block_device, const char* mount_point, | ||
106 | bool enable) { | ||
107 | +#if defined(__ANDROID__) | ||
108 | if (!make_block_device_writable(block_device)) { | ||
109 | WriteFdFmt(fd, "Could not make block device %s writable (%s).\n", | ||
110 | block_device, strerror(errno)); | ||
111 | @@ -115,6 +116,7 @@ static bool set_verity_enabled_state(int fd, const char* block_device, const cha | ||
112 | mount_point, strerror(errno)); | ||
113 | } | ||
114 | WriteFdFmt(fd, "Verity %s on %s\n", enable ? "enabled" : "disabled", mount_point); | ||
115 | +#endif | ||
116 | return true; | ||
117 | } | ||
118 | |||
119 | @@ -126,6 +128,7 @@ static std::string get_ab_suffix() { | ||
120 | return android::base::GetProperty("ro.boot.slot_suffix", ""); | ||
121 | } | ||
122 | |||
123 | +#if defined(__ANDROID__) | ||
124 | static bool is_avb_device_locked() { | ||
125 | return android::base::GetProperty("ro.boot.vbmeta.device_state", "") == "locked"; | ||
126 | } | ||
127 | @@ -245,3 +248,4 @@ void set_verity_enabled_state_service(unique_fd fd, bool enable) { | ||
128 | WriteFdExactly(fd.get(), "Now reboot your device for settings to take effect\n"); | ||
129 | } | ||
130 | } | ||
131 | +#endif | ||
132 | diff --git a/adb/daemon/shell_service.cpp b/adb/daemon/shell_service.cpp | ||
133 | index 3c8f3939..84f4f54d 100644 | ||
134 | --- a/adb/daemon/shell_service.cpp | ||
135 | +++ b/adb/daemon/shell_service.cpp | ||
136 | @@ -264,6 +264,10 @@ bool Subprocess::ForkAndExec(std::string* error) { | ||
137 | env["TMPDIR"] = "/data/local/tmp"; | ||
138 | env["USER"] = pw->pw_name; | ||
139 | } | ||
140 | + if (env.find("PS1") == env.end()) { | ||
141 | + env["PS1"] = "\\h:\\w\\$ "; | ||
142 | + } | ||
143 | + | ||
144 | |||
145 | if (!terminal_type_.empty()) { | ||
146 | env["TERM"] = terminal_type_; | ||
147 | diff --git a/adb/types.h b/adb/types.h | ||
148 | index 6af4a150..9efe223b 100644 | ||
149 | --- a/adb/types.h | ||
150 | +++ b/adb/types.h | ||
151 | @@ -20,6 +20,7 @@ | ||
152 | #include <cstring> | ||
153 | #include <deque> | ||
154 | #include <memory> | ||
155 | +#include <string> | ||
156 | #include <type_traits> | ||
157 | #include <utility> | ||
158 | #include <vector> | ||
159 | -- | ||
160 | 2.36.1.vfs.0.0 | ||
161 | |||