summaryrefslogtreecommitdiff
path: root/dev-util/android-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-17 01:53:44 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-17 01:53:44 +0100
commit9126563f8b9bef939e4df502bf0e52f19fc4f444 (patch)
tree3d13ccf0bf590cf1fe47aa2e0a63e0b6f9cda5a1 /dev-util/android-tools
parent3108ce8586e6da41676fd6bed4101da8f4af8e31 (diff)
gentoo auto-resync : 17:10:2022 - 01:53:44
Diffstat (limited to 'dev-util/android-tools')
-rw-r--r--dev-util/android-tools/Manifest3
-rw-r--r--dev-util/android-tools/android-tools-33.0.3-r1.ebuild6
-rw-r--r--dev-util/android-tools/files/android-tools-33.0.3-adb-0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch120
3 files changed, 128 insertions, 1 deletions
diff --git a/dev-util/android-tools/Manifest b/dev-util/android-tools/Manifest
index 5bf4e77e0ca2..f69933001bba 100644
--- a/dev-util/android-tools/Manifest
+++ b/dev-util/android-tools/Manifest
@@ -1,3 +1,4 @@
+AUX android-tools-33.0.3-adb-0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch 5109 BLAKE2B 4deee34669ce000050d04cf01040920a22ca0caafca006ff2651198a60936dce9e8f783263b05beb91bef8c015e14362725aa4dc23c32be30c6796ad20e69ad7 SHA512 4b8afcf5290be113d98572a9a1ad5309c8bf75f0c17aed2f698d3302f796f8fb7ead3422d649c4909019cf766ae16fc0d75401fb15eb42130e58b451d628af21
DIST android-tools-31.0.3-disable-werror-boringssl.patch 1815 BLAKE2B 63e911ba27e2995a11b27e2e1501c5e881d694c5477a216cb910bf1c9c1bf9f9fedffa864748ea4df668a1008124501f7815997304bc355e4ee105bf9b61f75f SHA512 db626d3680ec9f18be394bb2720c8bc7e380aac227ae6f1058476edb83784343f653afc583b06e7a2acd3f2ff500fa37d613d5efca4a9a24daedbf61b5b84015
DIST android-tools-31.0.3-install-e2fsdroid-ext2simg.patch 2164 BLAKE2B 7f0b43ff5ae820101628399540f3e5b87bf69224f4a61a6b76b8b6b3b06f8e7162a6c1e7ee43eee928cfa96824f5efff72317b4bbfe160d8e72d96aa84e0a1d6 SHA512 d5fd63c108ca6b880b1b79cf362468335f19fad7bf2042fb667b56e34dc95acc47e1bf9c9e72be1d2bd8252a529cd49eb030d141bf735524bdaeb85482d544a9
DIST android-tools-31.0.3-no-gtest.patch 3152 BLAKE2B da71e3cba87b21ffcb144602a06d7e269faabd173233363b757cd2191c051f8d3281f591117d4551d7acc029d6e2d421f702f9f836dfe0dec6c676aa39a2d9fe SHA512 a28d2264bf40c420a279acf1f4c3b4588d96ce2d6e2d6d322abbde62d773804bef10dc33f13dd52c7de80ace6c58f91ae28f5d4e8e97dfae4d2a8473d8537423
@@ -6,6 +7,6 @@ DIST android-tools-31.0.3p2.tar.xz 22458776 BLAKE2B a51f839ac44e6e998092d802eb18
DIST android-tools-33.0.3.tar.xz 25300756 BLAKE2B 4254f0ab8657966cf56e2a7c3e9a3d889dfa9f26e61d8b46480bb74c5a8be33494f450827e3b2db4087006b3160892e6a846ef33719870cbbd032647cfc3ce78 SHA512 78c8141f5f13f1c0e5da474e1d79760a612e911519af4e9f21c0e5005f2ce99f3aeacf16f3fcdfe1250fc795a88190fa243592e1066a2156e1fd8d2b9c3d7f71
EBUILD android-tools-31.0.3.ebuild 2207 BLAKE2B 075ba2bcbf2f30b9c3804be39c3b67397634e69baf1572096f32a3f0d927fd35526246ef2e4590dddf92f71350bc172bf58c1e70107cfbde015588ada9f90509 SHA512 57d1e597562ab7688f5715635b6c4f86e7dd5b8b00fc120793fd7a047924f647f9f4725e86b93afb0648c8c8c086cca5a7eeea56a90a2636d23fcf571daccde7
EBUILD android-tools-31.0.3_p2.ebuild 2157 BLAKE2B 3f7738ccabc27a7b54f30f533613aca897efb4a70cae04a999a586320d42711329cb4521f5da8f19a6b091c72104aace5993fe74b04057f8a00e3f8269ed9436 SHA512 4b6621928d031ee07f0517b882cdd8f37a833aa5f2b398f7a40df6e4ba13b9c030c300f620daef43143f0573aff0ba955d8f59a5ca3d8475395118592add7fbd
-EBUILD android-tools-33.0.3-r1.ebuild 2177 BLAKE2B 6e17ac3a51201acc580cc477283ee74ee7375de3318e2acf79ea2ae09aaa6b4f3b382794bc9e1f4d9bc83101949799bc6e83a5a14f2c92c6efbf1c56db133cdc SHA512 45d4291b3f1450e0ba7969b98e4fe1be6e15985f5dd2a116fdb4fc8d3691e0f265a1aec117b03f6b9b3392d1bf915465d84d7c84e78231359f04a24308f9a3b5
+EBUILD android-tools-33.0.3-r1.ebuild 2305 BLAKE2B 62efc97e5aad306b1c2b24f5a334a15a59871103718f78de2be6daaa6813c56d702ab0964d30b92a13215268e39c2f5ce1062a5027128dbd58679815d4fdbd5c SHA512 446fb7252725448f1257c7b7f920f755a4de5ae6d2b734259462df8e03811a3560f03b25ab91da242b157bb2ad3c1acd03012ea8e132fc73881e96b98ff1af0e
EBUILD android-tools-33.0.3.ebuild 2159 BLAKE2B 8adf5dfb99fd6d2c68d6073cbd8021829212540520226aa8070cbad13aa5d5ce18d1c0cd37b36b4fa835a5988800fc39c453e114cf5c73e031e2647f826edf98 SHA512 d55b55fe5b07e2b758c29d06c25236a3ef2922397ee87bd509b9ad4c5e1f7d5818ff4f2620dfd2fd095e6cf64ad2a87b763b1efa0f13e1d24f1bf0ef5b0e4914
MISC metadata.xml 724 BLAKE2B 7ef6e07d806dff51946236dfee2f5eaf207fd7c9cde6e73cb7f372fea5cd8b2b559e4f1fe81a315c41beed5beba92603cc93a16183d63953fbed4ba0d2941116 SHA512 d47cf87259ad2b2a8d6f8edf6b2c2084d0046773447ed9647cc232437ec8f3e8c452cb26ac7e0a619b220e073518903b77c55ba7c2e9f7663069fea2e7096e75
diff --git a/dev-util/android-tools/android-tools-33.0.3-r1.ebuild b/dev-util/android-tools/android-tools-33.0.3-r1.ebuild
index 5e81ccbffd54..5aaa23ae15aa 100644
--- a/dev-util/android-tools/android-tools-33.0.3-r1.ebuild
+++ b/dev-util/android-tools/android-tools-33.0.3-r1.ebuild
@@ -45,10 +45,16 @@ DOCS=()
src_prepare() {
eapply "${DISTDIR}/${PN}-31.0.3-no-gtest.patch"
+
cd "${S}/vendor/core" || die
eapply "${S}/patches/core/0011-Remove-the-useless-dependency-on-gtest.patch"
+
cd "${S}/vendor/libziparchive" || die
eapply "${S}/patches/libziparchive/0004-Remove-the-useless-dependency-on-gtest.patch"
+
+ cd "${S}/vendor/adb" || die
+ eapply "${FILESDIR}/${P}-adb-0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch"
+
cd "${S}"
rm -r patches || die
cmake_src_prepare
diff --git a/dev-util/android-tools/files/android-tools-33.0.3-adb-0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch b/dev-util/android-tools/files/android-tools-33.0.3-adb-0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch
new file mode 100644
index 000000000000..25572574d834
--- /dev/null
+++ b/dev-util/android-tools/files/android-tools-33.0.3-adb-0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch
@@ -0,0 +1,120 @@
+https://github.com/anatol/android-tools/blob/2f8405a47909861c9359fe4797e7b4a0fba4dc12/patches/adb/0023-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.patch
+https://github.com/nmeum/android-tools/issues/74
+https://bugs.gentoo.org/876328
+
+From c830c90995fc0877348e2ed9cdeccf9b739138d2 Mon Sep 17 00:00:00 2001
+From: Anatol Pomozov <anatol.pomozov@gmail.com>
+Date: Mon, 10 Oct 2022 10:47:57 -0700
+Subject: [PATCH] Update usage of usbdevfs_urb to match new kernel UAPI
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Linux kernel API has been changed by commit 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with flexible-array members")
+where zero-length array iso_frame_desc in struct usbdevfs_urb was replaced with a proper flexible-array member.
+
+Current USB API usage causes a compilation error at Linux 6.0:
+
+In file included from /home/mae/.cache/kiss/proc/121205/build/android-tools/vendor/adb/client/usb_linux.cpp:28:
+/usr/include/linux/usbdevice_fs.h:134:41: error: flexible array member ‘usbdevfs_urb::iso_frame_desc’ not at end of ‘struct usb_handle’
+ 134 | struct usbdevfs_iso_packet_desc iso_frame_desc[];
+ | ^~~~~~~~~~~~~~
+/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
+ 76 | usbdevfs_urb urb_out;
+ | ^~~~~~~
+/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’
+ 61 | struct usb_handle {
+ | ^~~~~~~~~~
+
+Fix it by using pointers to a struct with flexible-array members.
+Current fix works both with the old and the new API.
+
+See https://github.com/nmeum/android-tools/issues/74 for more context.
+
+Tested: built on Linux against kernel 5.19 and 6.0; 'adb shell' over USB
+cable
+Acked-by: Gustavo A. R. Silva gustavoars@kernel.org
+Change-Id: I7f0f7b35d9a3ab980d3520b541b60c7857a6b101
+Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
+--- a/client/usb_linux.cpp
++++ b/client/usb_linux.cpp
+@@ -71,8 +71,8 @@ struct usb_handle {
+ unsigned zero_mask;
+ unsigned writeable = 1;
+
+- usbdevfs_urb urb_in;
+- usbdevfs_urb urb_out;
++ usbdevfs_urb *urb_in;
++ usbdevfs_urb *urb_out;
+
+ bool urb_in_busy = false;
+ bool urb_out_busy = false;
+@@ -303,7 +303,7 @@ static int usb_bulk_write(usb_handle* h, const void* data, int len) {
+ std::unique_lock<std::mutex> lock(h->mutex);
+ D("++ usb_bulk_write ++");
+
+- usbdevfs_urb* urb = &h->urb_out;
++ usbdevfs_urb* urb = h->urb_out;
+ memset(urb, 0, sizeof(*urb));
+ urb->type = USBDEVFS_URB_TYPE_BULK;
+ urb->endpoint = h->ep_out;
+@@ -342,7 +342,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) {
+ std::unique_lock<std::mutex> lock(h->mutex);
+ D("++ usb_bulk_read ++");
+
+- usbdevfs_urb* urb = &h->urb_in;
++ usbdevfs_urb* urb = h->urb_in;
+ memset(urb, 0, sizeof(*urb));
+ urb->type = USBDEVFS_URB_TYPE_BULK;
+ urb->endpoint = h->ep_in;
+@@ -387,7 +387,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) {
+ }
+ D("[ urb @%p status = %d, actual = %d ]", out, out->status, out->actual_length);
+
+- if (out == &h->urb_in) {
++ if (out == h->urb_in) {
+ D("[ reap urb - IN complete ]");
+ h->urb_in_busy = false;
+ if (urb->status != 0) {
+@@ -396,7 +396,7 @@ static int usb_bulk_read(usb_handle* h, void* data, int len) {
+ }
+ return urb->actual_length;
+ }
+- if (out == &h->urb_out) {
++ if (out == h->urb_out) {
+ D("[ reap urb - OUT compelete ]");
+ h->urb_out_busy = false;
+ h->cv.notify_all();
+@@ -500,10 +500,10 @@ void usb_kick(usb_handle* h) {
+ ** but this ensures that a reader blocked on REAPURB
+ ** will get unblocked
+ */
+- ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_in);
+- ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_out);
+- h->urb_in.status = -ENODEV;
+- h->urb_out.status = -ENODEV;
++ ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_in);
++ ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_out);
++ h->urb_in->status = -ENODEV;
++ h->urb_out->status = -ENODEV;
+ h->urb_in_busy = false;
+ h->urb_out_busy = false;
+ h->cv.notify_all();
+@@ -519,6 +519,8 @@ int usb_close(usb_handle* h) {
+
+ D("-- usb close %p (fd = %d) --", h, h->fd);
+
++ delete h->urb_in;
++ delete h->urb_out;
+ delete h;
+
+ return 0;
+@@ -572,6 +574,8 @@ static void register_device(const char* dev_name, const char* dev_path, unsigned
+ usb->ep_out = ep_out;
+ usb->zero_mask = zero_mask;
+ usb->max_packet_size = max_packet_size;
++ usb->urb_in = new usbdevfs_urb;
++ usb->urb_out = new usbdevfs_urb;
+
+ // Initialize mark so we don't get garbage collected after the device scan.
+ usb->mark = true;