diff options
author | Etienne Cordonnier <ecordonnier@snap.com> | 2023-03-10 16:49:28 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-03-14 09:39:58 -0700 |
commit | b65453d5bc3b4826265188d67942202d8f1035e7 (patch) | |
tree | ffc1824528db8b8190d294851406be13abf849f8 | |
parent | b85ae59968f4e7f4872e4766e49b62f191384242 (diff) | |
download | meta-openembedded-b65453d5bc3b4826265188d67942202d8f1035e7.tar.gz |
android-tools 10: various fixes
- fix img2simg which was broken in the original recipe (wrong rpath and missing linking to libbase)
- remove clang dependency and make it compile with gcc
- fix installation of img2simg and simg2img which was broken in the original recipe
- backport patch https://github.com/nmeum/android-tools/blob/master/patches/adb/0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch
The license is MIT, so it can be used.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
6 files changed, 325 insertions, 21 deletions
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch index f6bea174d8..335f8b0ac8 100644 --- a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch | |||
@@ -40,7 +40,7 @@ index 738b205..ada4ef9 100644 | |||
40 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ | 40 | LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ |
41 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | 41 | -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ |
42 | - -lpthread -nostdlib -lc -lgcc -Ldebian/out -l7z | 42 | - -lpthread -nostdlib -lc -lgcc -Ldebian/out -l7z |
43 | + -lpthread -nostdlib -lc -lgcc -l7z -Wno-error=unused-command-line-argument | 43 | + -lpthread -nostdlib -lc -lgcc -l7z |
44 | 44 | ||
45 | build: $(SOURCES) | 45 | build: $(SOURCES) |
46 | - mkdir --parents debian/out | 46 | - mkdir --parents debian/out |
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch index 82ec560a6a..367e31af22 100644 --- a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch | |||
@@ -52,12 +52,12 @@ index d1aba626..e75fa87c 100644 | |||
52 | 52 | ||
53 | build: $(SOURCES) | 53 | build: $(SOURCES) |
54 | - $(CXX) $^ -o fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | 54 | - $(CXX) $^ -o fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) |
55 | + mkdir --parents $(OUT_DIR)/usr/bin/fastboot | 55 | + mkdir --parents $(OUT_DIR)/usr/bin/ |
56 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) | 56 | + $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) |
57 | 57 | ||
58 | clean: | 58 | clean: |
59 | - $(RM) fastboot/$(NAME) | 59 | - $(RM) fastboot/$(NAME) |
60 | + $(RM) $(OUT_DIR)/usr/bin/fastboot/$(NAME) | 60 | + $(RM) $(OUT_DIR)/usr/bin/$(NAME) |
61 | -- | 61 | -- |
62 | 2.36.1.vfs.0.0 | 62 | 2.36.1.vfs.0.0 |
63 | 63 | ||
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0017-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0017-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch new file mode 100644 index 0000000000..7209e626b7 --- /dev/null +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0017-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch | |||
@@ -0,0 +1,128 @@ | |||
1 | From 0dac14385d9c79089f8026e2764b75fa111adb8a Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Tue, 14 Mar 2023 11:33:50 +0100 | ||
4 | Subject: [PATCH] Update usage of usbdevfs_urb to match new kernel UAPI | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Linux kernel API has been changed by commit 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with flexible-array members") | ||
10 | where zero-length array iso_frame_desc in struct usbdevfs_urb was replaced with a proper flexible-array member. | ||
11 | |||
12 | Current USB API usage causes a compilation error at Linux 6.0: | ||
13 | |||
14 | In file included from /home/mae/.cache/kiss/proc/121205/build/android-tools/vendor/adb/client/usb_linux.cpp:28: | ||
15 | /usr/include/linux/usbdevice_fs.h:134:41: error: flexible array member ‘usbdevfs_urb::iso_frame_desc’ not at end of ‘struct usb_handle’ | ||
16 | 134 | struct usbdevfs_iso_packet_desc iso_frame_desc[]; | ||
17 | | ^~~~~~~~~~~~~~ | ||
18 | /home/mae/.cache/kiss/proc/121205/build/android-tools/vendor/adb/client/usb_linux.cpp:76:18: note: next member ‘usbdevfs_urb usb_handle::urb_out’ declared here | ||
19 | 76 | usbdevfs_urb urb_out; | ||
20 | | ^~~~~~~ | ||
21 | /home/mae/.cache/kiss/proc/121205/build/android-tools/vendor/adb/client/usb_linux.cpp:61:8: note: in the definition of ‘struct usb_handle’ | ||
22 | 61 | struct usb_handle { | ||
23 | | ^~~~~~~~~~ | ||
24 | |||
25 | Fix it by using pointers to a struct with flexible-array members. | ||
26 | Current fix works both with the old and the new API. | ||
27 | |||
28 | See https://github.com/nmeum/android-tools/issues/74 for more context. | ||
29 | |||
30 | Tested: built on Linux against kernel 5.19 and 6.0; 'adb shell' over USB | ||
31 | cable | ||
32 | Acked-by: Gustavo A. R. Silva gustavoars@kernel.org | ||
33 | Change-Id: I7f0f7b35d9a3ab980d3520b541b60c7857a6b101 | ||
34 | Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> | ||
35 | |||
36 | [Backported on version 10] | ||
37 | Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
38 | --- | ||
39 | adb/client/usb_linux.cpp | 24 ++++++++++++++---------- | ||
40 | 1 file changed, 14 insertions(+), 10 deletions(-) | ||
41 | |||
42 | diff --git a/adb/client/usb_linux.cpp b/adb/client/usb_linux.cpp | ||
43 | index 81b83064..7d55ec5b 100644 | ||
44 | --- a/adb/client/usb_linux.cpp | ||
45 | +++ b/adb/client/usb_linux.cpp | ||
46 | @@ -71,8 +71,8 @@ struct usb_handle : public ::usb_handle { | ||
47 | unsigned zero_mask; | ||
48 | unsigned writeable = 1; | ||
49 | |||
50 | - usbdevfs_urb urb_in; | ||
51 | - usbdevfs_urb urb_out; | ||
52 | + usbdevfs_urb *urb_in; | ||
53 | + usbdevfs_urb *urb_out; | ||
54 | |||
55 | bool urb_in_busy = false; | ||
56 | bool urb_out_busy = false; | ||
57 | @@ -305,7 +305,7 @@ static int usb_bulk_write(usb_handle* h, const void* data, int len) { | ||
58 | std::unique_lock<std::mutex> lock(h->mutex); | ||
59 | D("++ usb_bulk_write ++"); | ||
60 | |||
61 | - usbdevfs_urb* urb = &h->urb_out; | ||
62 | + usbdevfs_urb* urb = h->urb_out; | ||
63 | memset(urb, 0, sizeof(*urb)); | ||
64 | urb->type = USBDEVFS_URB_TYPE_BULK; | ||
65 | urb->endpoint = h->ep_out; | ||
66 | @@ -344,7 +344,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) { | ||
67 | std::unique_lock<std::mutex> lock(h->mutex); | ||
68 | D("++ usb_bulk_read ++"); | ||
69 | |||
70 | - usbdevfs_urb* urb = &h->urb_in; | ||
71 | + usbdevfs_urb* urb = h->urb_in; | ||
72 | memset(urb, 0, sizeof(*urb)); | ||
73 | urb->type = USBDEVFS_URB_TYPE_BULK; | ||
74 | urb->endpoint = h->ep_in; | ||
75 | @@ -389,7 +389,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) { | ||
76 | } | ||
77 | D("[ urb @%p status = %d, actual = %d ]", out, out->status, out->actual_length); | ||
78 | |||
79 | - if (out == &h->urb_in) { | ||
80 | + if (out == h->urb_in) { | ||
81 | D("[ reap urb - IN complete ]"); | ||
82 | h->urb_in_busy = false; | ||
83 | if (urb->status != 0) { | ||
84 | @@ -398,7 +398,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) { | ||
85 | } | ||
86 | return urb->actual_length; | ||
87 | } | ||
88 | - if (out == &h->urb_out) { | ||
89 | + if (out == h->urb_out) { | ||
90 | D("[ reap urb - OUT compelete ]"); | ||
91 | h->urb_out_busy = false; | ||
92 | h->cv.notify_all(); | ||
93 | @@ -483,10 +483,10 @@ void usb_kick(usb_handle* h) { | ||
94 | ** but this ensures that a reader blocked on REAPURB | ||
95 | ** will get unblocked | ||
96 | */ | ||
97 | - ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_in); | ||
98 | - ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_out); | ||
99 | - h->urb_in.status = -ENODEV; | ||
100 | - h->urb_out.status = -ENODEV; | ||
101 | + ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_in); | ||
102 | + ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_out); | ||
103 | + h->urb_in->status = -ENODEV; | ||
104 | + h->urb_out->status = -ENODEV; | ||
105 | h->urb_in_busy = false; | ||
106 | h->urb_out_busy = false; | ||
107 | h->cv.notify_all(); | ||
108 | @@ -502,6 +502,8 @@ int usb_close(usb_handle* h) { | ||
109 | |||
110 | D("-- usb close %p (fd = %d) --", h, h->fd); | ||
111 | |||
112 | + delete h->urb_in; | ||
113 | + delete h->urb_out; | ||
114 | delete h; | ||
115 | |||
116 | return 0; | ||
117 | @@ -537,6 +539,8 @@ static void register_device(const char* dev_name, const char* dev_path, unsigned | ||
118 | usb->ep_out = ep_out; | ||
119 | usb->zero_mask = zero_mask; | ||
120 | usb->max_packet_size = max_packet_size; | ||
121 | + usb->urb_in = new usbdevfs_urb; | ||
122 | + usb->urb_out = new usbdevfs_urb; | ||
123 | |||
124 | // Initialize mark so we don't get garbage collected after the device scan. | ||
125 | usb->mark = true; | ||
126 | -- | ||
127 | 2.36.1.vfs.0.0 | ||
128 | |||
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0018-img2simg-Fix-wrong-rpath.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0018-img2simg-Fix-wrong-rpath.patch new file mode 100644 index 0000000000..5f28263022 --- /dev/null +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0018-img2simg-Fix-wrong-rpath.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 25bd3456dcd539b89648273152e405314287f4f8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Mon, 13 Mar 2023 13:46:14 +0100 | ||
4 | Subject: [PATCH 2/2] img2simg: Fix wrong rpath and re-add libbase | ||
5 | |||
6 | Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
7 | --- | ||
8 | debian/img2simg.mk | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/debian/img2simg.mk b/debian/img2simg.mk | ||
12 | index d1b9b927..459af454 100644 | ||
13 | --- a/debian/img2simg.mk | ||
14 | +++ b/debian/img2simg.mk | ||
15 | @@ -3,7 +3,7 @@ NAME = img2simg | ||
16 | SOURCES = img2simg.cpp | ||
17 | SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) | ||
18 | CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 | ||
19 | -LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ | ||
20 | +LDFLAGS += -Wl,-rpath='$$ORIGIN/../lib/android' -lbase \ | ||
21 | -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ | ||
22 | -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -lsparse | ||
23 | |||
24 | -- | ||
25 | 2.36.1.vfs.0.0 | ||
26 | |||
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0019-Fix-compilation-with-gcc.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0019-Fix-compilation-with-gcc.patch new file mode 100644 index 0000000000..033c5fb919 --- /dev/null +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0019-Fix-compilation-with-gcc.patch | |||
@@ -0,0 +1,157 @@ | |||
1 | From d198ecb4c36b645e5428aa5117f7673bf2f7a3e6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Tue, 14 Mar 2023 11:42:08 +0100 | ||
4 | Subject: [PATCH] Fix compilation with gcc | ||
5 | |||
6 | Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
7 | --- | ||
8 | adb/adb_listeners.cpp | 18 ++++++++++++------ | ||
9 | adb/daemon/auth.cpp | 3 ++- | ||
10 | adb/daemon/usb.cpp | 3 ++- | ||
11 | adb/fdevent.cpp | 3 ++- | ||
12 | adb/transport_fd.cpp | 3 ++- | ||
13 | adb/transport_local.cpp | 3 ++- | ||
14 | 6 files changed, 22 insertions(+), 11 deletions(-) | ||
15 | |||
16 | diff --git a/adb/adb_listeners.cpp b/adb/adb_listeners.cpp | ||
17 | index 29909a55..fbdf4487 100644 | ||
18 | --- a/adb/adb_listeners.cpp | ||
19 | +++ b/adb/adb_listeners.cpp | ||
20 | @@ -109,7 +109,8 @@ static void listener_event_func(int _fd, unsigned ev, void* _l) | ||
21 | } | ||
22 | |||
23 | // Called as a transport disconnect function. |arg| is the raw alistener*. | ||
24 | -static void listener_disconnect(void* arg, atransport*) EXCLUDES(listener_list_mutex) { | ||
25 | + EXCLUDES(listener_list_mutex) | ||
26 | +static void listener_disconnect(void* arg, atransport*) { | ||
27 | std::lock_guard<std::mutex> lock(listener_list_mutex); | ||
28 | for (auto iter = listener_list.begin(); iter != listener_list.end(); ++iter) { | ||
29 | if (iter->get() == arg) { | ||
30 | @@ -121,7 +122,8 @@ static void listener_disconnect(void* arg, atransport*) EXCLUDES(listener_list_m | ||
31 | } | ||
32 | |||
33 | // Write the list of current listeners (network redirections) into a string. | ||
34 | -std::string format_listeners() EXCLUDES(listener_list_mutex) { | ||
35 | +EXCLUDES(listener_list_mutex) | ||
36 | +std::string format_listeners() { | ||
37 | std::lock_guard<std::mutex> lock(listener_list_mutex); | ||
38 | std::string result; | ||
39 | for (auto& l : listener_list) { | ||
40 | @@ -139,8 +141,9 @@ std::string format_listeners() EXCLUDES(listener_list_mutex) { | ||
41 | return result; | ||
42 | } | ||
43 | |||
44 | +EXCLUDES(listener_list_mutex) | ||
45 | InstallStatus remove_listener(const char* local_name, atransport* transport) | ||
46 | - EXCLUDES(listener_list_mutex) { | ||
47 | +{ | ||
48 | std::lock_guard<std::mutex> lock(listener_list_mutex); | ||
49 | for (auto iter = listener_list.begin(); iter != listener_list.end(); ++iter) { | ||
50 | if (local_name == (*iter)->local_name) { | ||
51 | @@ -151,7 +154,8 @@ InstallStatus remove_listener(const char* local_name, atransport* transport) | ||
52 | return INSTALL_STATUS_LISTENER_NOT_FOUND; | ||
53 | } | ||
54 | |||
55 | -void remove_all_listeners() EXCLUDES(listener_list_mutex) { | ||
56 | +EXCLUDES(listener_list_mutex) | ||
57 | +void remove_all_listeners() { | ||
58 | std::lock_guard<std::mutex> lock(listener_list_mutex); | ||
59 | auto iter = listener_list.begin(); | ||
60 | while (iter != listener_list.end()) { | ||
61 | @@ -164,7 +168,8 @@ void remove_all_listeners() EXCLUDES(listener_list_mutex) { | ||
62 | } | ||
63 | } | ||
64 | |||
65 | -void close_smartsockets() EXCLUDES(listener_list_mutex) { | ||
66 | +EXCLUDES(listener_list_mutex) | ||
67 | +void close_smartsockets() { | ||
68 | std::lock_guard<std::mutex> lock(listener_list_mutex); | ||
69 | auto pred = [](const std::unique_ptr<alistener>& listener) { | ||
70 | return listener->local_name == "*smartsocket*"; | ||
71 | @@ -172,9 +177,10 @@ void close_smartsockets() EXCLUDES(listener_list_mutex) { | ||
72 | listener_list.remove_if(pred); | ||
73 | } | ||
74 | |||
75 | +EXCLUDES(listener_list_mutex) | ||
76 | InstallStatus install_listener(const std::string& local_name, const char* connect_to, | ||
77 | atransport* transport, int no_rebind, int* resolved_tcp_port, | ||
78 | - std::string* error) EXCLUDES(listener_list_mutex) { | ||
79 | + std::string* error) { | ||
80 | std::lock_guard<std::mutex> lock(listener_list_mutex); | ||
81 | for (auto& l : listener_list) { | ||
82 | if (local_name == l->local_name) { | ||
83 | diff --git a/adb/daemon/auth.cpp b/adb/daemon/auth.cpp | ||
84 | index a18afa4e..0fd60a1f 100644 | ||
85 | --- a/adb/daemon/auth.cpp | ||
86 | +++ b/adb/daemon/auth.cpp | ||
87 | @@ -98,8 +98,9 @@ bool adbd_auth_verify(const char* token, size_t token_size, const std::string& s | ||
88 | return false; | ||
89 | } | ||
90 | |||
91 | +REQUIRES(framework_mutex) | ||
92 | static bool adbd_send_key_message_locked(std::string_view msg_type, std::string_view key) | ||
93 | - REQUIRES(framework_mutex) { | ||
94 | +{ | ||
95 | if (framework_fd < 0) { | ||
96 | LOG(ERROR) << "Client not connected to send msg_type " << msg_type; | ||
97 | return false; | ||
98 | diff --git a/adb/daemon/usb.cpp b/adb/daemon/usb.cpp | ||
99 | index 1abae87c..3a466782 100644 | ||
100 | --- a/adb/daemon/usb.cpp | ||
101 | +++ b/adb/daemon/usb.cpp | ||
102 | @@ -628,7 +628,8 @@ struct UsbFfsConnection : public Connection { | ||
103 | return CreateWriteBlock(std::move(block), 0, len, id); | ||
104 | } | ||
105 | |||
106 | - void SubmitWrites() REQUIRES(write_mutex_) { | ||
107 | + REQUIRES(write_mutex_) | ||
108 | + void SubmitWrites() { | ||
109 | if (writes_submitted_ == kUsbWriteQueueDepth) { | ||
110 | return; | ||
111 | } | ||
112 | diff --git a/adb/fdevent.cpp b/adb/fdevent.cpp | ||
113 | index 32f90863..bff24544 100644 | ||
114 | --- a/adb/fdevent.cpp | ||
115 | +++ b/adb/fdevent.cpp | ||
116 | @@ -376,7 +376,8 @@ static void fdevent_call_fdfunc(fdevent* fde) { | ||
117 | fde->func); | ||
118 | } | ||
119 | |||
120 | -static void fdevent_run_flush() EXCLUDES(run_queue_mutex) { | ||
121 | +EXCLUDES(run_queue_mutex) | ||
122 | +static void fdevent_run_flush() { | ||
123 | // We need to be careful around reentrancy here, since a function we call can queue up another | ||
124 | // function. | ||
125 | while (true) { | ||
126 | diff --git a/adb/transport_fd.cpp b/adb/transport_fd.cpp | ||
127 | index a93e68a0..c5af09ff 100644 | ||
128 | --- a/adb/transport_fd.cpp | ||
129 | +++ b/adb/transport_fd.cpp | ||
130 | @@ -168,7 +168,8 @@ struct NonblockingFdConnection : public Connection { | ||
131 | TryAgain, | ||
132 | }; | ||
133 | |||
134 | - WriteResult DispatchWrites() REQUIRES(write_mutex_) { | ||
135 | + REQUIRES(write_mutex_) | ||
136 | + WriteResult DispatchWrites() { | ||
137 | CHECK(!write_buffer_.empty()); | ||
138 | auto iovs = write_buffer_.iovecs(); | ||
139 | ssize_t rc = adb_writev(fd_.get(), iovs.data(), iovs.size()); | ||
140 | diff --git a/adb/transport_local.cpp b/adb/transport_local.cpp | ||
141 | index b9f738df..a273e8f7 100644 | ||
142 | --- a/adb/transport_local.cpp | ||
143 | +++ b/adb/transport_local.cpp | ||
144 | @@ -345,8 +345,9 @@ struct EmulatorConnection : public FdConnection { | ||
145 | }; | ||
146 | |||
147 | /* Only call this function if you already hold local_transports_lock. */ | ||
148 | +REQUIRES(local_transports_lock) | ||
149 | static atransport* find_emulator_transport_by_adb_port_locked(int adb_port) | ||
150 | - REQUIRES(local_transports_lock) { | ||
151 | +{ | ||
152 | auto it = local_transports.find(adb_port); | ||
153 | if (it == local_transports.end()) { | ||
154 | return nullptr; | ||
155 | -- | ||
156 | 2.36.1.vfs.0.0 | ||
157 | |||
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_10.0.0.r36.bb b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_10.0.0.r36.bb index cf81afe14f..6fc2532981 100644 --- a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_10.0.0.r36.bb +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools_10.0.0.r36.bb | |||
@@ -58,7 +58,7 @@ SRC_URI += " \ | |||
58 | file://libunwind-debian/20150704-CVE-2015-3239_dwarf_i.h.patch;patchdir=external/libunwind \ | 58 | file://libunwind-debian/20150704-CVE-2015-3239_dwarf_i.h.patch;patchdir=external/libunwind \ |
59 | " | 59 | " |
60 | 60 | ||
61 | # meta-clang specific patches + files: | 61 | # meta-openembedded specific patches + files: |
62 | SRC_URI += " \ | 62 | SRC_URI += " \ |
63 | file://core/0001-patching-adb.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ | 63 | file://core/0001-patching-adb.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ |
64 | file://core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch;patchdir=system/core \ | 64 | file://core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch;patchdir=system/core \ |
@@ -76,6 +76,9 @@ SRC_URI += " \ | |||
76 | file://core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch;patchdir=system/core \ | 76 | file://core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch;patchdir=system/core \ |
77 | file://core/0015-Use-namespace-std-to-compile-libbacktrace.patch;patchdir=system/core \ | 77 | file://core/0015-Use-namespace-std-to-compile-libbacktrace.patch;patchdir=system/core \ |
78 | file://core/0016-Adapt-adbd-to-work-with-yocto.patch;patchdir=system/core \ | 78 | file://core/0016-Adapt-adbd-to-work-with-yocto.patch;patchdir=system/core \ |
79 | file://core/0017-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch;patchdir=system/core \ | ||
80 | file://core/0018-img2simg-Fix-wrong-rpath.patch;patchdir=system/core \ | ||
81 | file://core/0019-Fix-compilation-with-gcc.patch;patchdir=system/core \ | ||
79 | file://0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch;patchdir=external/boringssl \ | 82 | file://0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch;patchdir=external/boringssl \ |
80 | file://0001-patching-libundwind-to-build-in-yocto-environment.patch;patchdir=external/libunwind \ | 83 | file://0001-patching-libundwind-to-build-in-yocto-environment.patch;patchdir=external/libunwind \ |
81 | file://0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch;patchdir=system/extras \ | 84 | file://0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch;patchdir=system/extras \ |
@@ -96,14 +99,7 @@ COMPATIBLE_HOST:powerpc = "(null)" | |||
96 | COMPATIBLE_HOST:powerpc64 = "(null)" | 99 | COMPATIBLE_HOST:powerpc64 = "(null)" |
97 | COMPATIBLE_HOST:powerpc64le = "(null)" | 100 | COMPATIBLE_HOST:powerpc64le = "(null)" |
98 | 101 | ||
99 | inherit systemd clang | 102 | inherit systemd |
100 | |||
101 | TOOLCHAIN = "clang" | ||
102 | TOOLCHAIN:class-native = "clang" | ||
103 | DEPENDS:append:class-target = "\ | ||
104 | clang-cross-${TARGET_ARCH} \ | ||
105 | " | ||
106 | DEPENDS:append:class-native = " clang-native" | ||
107 | 103 | ||
108 | SYSTEMD_SERVICE:${PN} = "android-tools-adbd.service" | 104 | SYSTEMD_SERVICE:${PN} = "android-tools-adbd.service" |
109 | 105 | ||
@@ -175,9 +171,11 @@ do_compile() { | |||
175 | } | 171 | } |
176 | 172 | ||
177 | do_install() { | 173 | do_install() { |
178 | if echo ${TOOLS_TO_BUILD} | grep -q "ext4_utils" ; then | 174 | for tool in img2simg simg2img fastboot; do |
179 | install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump | 175 | if echo ${TOOLS_TO_BUILD} | grep -q "$tool" ; then |
180 | fi | 176 | install -D -p -m0755 ${S}/debian/out/usr/bin/$tool ${D}${bindir}/$tool |
177 | fi | ||
178 | done | ||
181 | 179 | ||
182 | if echo ${TOOLS_TO_BUILD} | grep -q "adb " ; then | 180 | if echo ${TOOLS_TO_BUILD} | grep -q "adb " ; then |
183 | install -d ${D}${bindir} | 181 | install -d ${D}${bindir} |
@@ -193,11 +191,6 @@ do_install() { | |||
193 | install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ | 191 | install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ |
194 | ${D}${systemd_unitdir}/system/android-tools-adbd.service | 192 | ${D}${systemd_unitdir}/system/android-tools-adbd.service |
195 | 193 | ||
196 | if echo ${TOOLS_TO_BUILD} | grep -q "fastboot" ; then | ||
197 | install -d ${D}${bindir} | ||
198 | install -m0755 ${S}/debian/out/usr/bin/fastboot/fastboot ${D}${bindir} | ||
199 | fi | ||
200 | |||
201 | install -d ${D}${libdir}/android/ | 194 | install -d ${D}${libdir}/android/ |
202 | install -m0755 ${S}/debian/out/usr/lib/android/*.so.* ${D}${libdir}/android/ | 195 | install -m0755 ${S}/debian/out/usr/lib/android/*.so.* ${D}${libdir}/android/ |
203 | if echo ${TOOLS_TO_BUILD} | grep -q "mkbootimg" ; then | 196 | if echo ${TOOLS_TO_BUILD} | grep -q "mkbootimg" ; then |