diff options
author | Etienne Cordonnier <ecordonnier@snap.com> | 2023-03-14 14:05:33 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-03-14 09:39:58 -0700 |
commit | 545c524c11e36a016dc3414ed5351b3b0111709e (patch) | |
tree | 19d5e74553bc0caef5473b85583df0f81f64c715 /meta-oe | |
parent | b65453d5bc3b4826265188d67942202d8f1035e7 (diff) | |
download | meta-openembedded-545c524c11e36a016dc3414ed5351b3b0111709e.tar.gz |
android-tools 10: port some patches from version 5
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
3 files changed, 77 insertions, 0 deletions
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0020-adb-Fix-build-on-big-endian-systems.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0020-adb-Fix-build-on-big-endian-systems.patch new file mode 100644 index 000000000..a2c490bfe --- /dev/null +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0020-adb-Fix-build-on-big-endian-systems.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From f9fe8163cd759c21dd5ec0711b56dccd79ff1c4a Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Tue, 14 Mar 2023 13:39:23 +0100 | ||
4 | Subject: [PATCH] adb: Fix build on big endian systems | ||
5 | |||
6 | The usb_linux_client.c file defines cpu_to_le16/32 by using the C | ||
7 | library htole16/32 function calls. However, cpu_to_le16/32 are used | ||
8 | when initializing structures, i.e in a context where a function call | ||
9 | is not allowed. | ||
10 | |||
11 | It works fine on little endian systems because htole16/32 are defined | ||
12 | by the C library as no-ops. But on big-endian systems, they are | ||
13 | actually doing something, which might involve calling a function, | ||
14 | causing build failures. | ||
15 | |||
16 | To solve this, we simply open-code cpu_to_le16/32 in a way that allows | ||
17 | them to be used when initializing structures. | ||
18 | |||
19 | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
20 | [Forward-ported to version 10] | ||
21 | Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
22 | --- | ||
23 | adb/daemon/usb_ffs.cpp | 11 +++++++++-- | ||
24 | 1 file changed, 9 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/adb/daemon/usb_ffs.cpp b/adb/daemon/usb_ffs.cpp | ||
27 | index 07b4ba89..25f30352 100644 | ||
28 | --- a/adb/daemon/usb_ffs.cpp | ||
29 | +++ b/adb/daemon/usb_ffs.cpp | ||
30 | @@ -37,8 +37,15 @@ | ||
31 | // Number of buffers needed to fit MAX_PAYLOAD, with an extra for ZLPs. | ||
32 | #define USB_FFS_NUM_BUFS ((4 * MAX_PAYLOAD / USB_FFS_BULK_SIZE) + 1) | ||
33 | |||
34 | -#define cpu_to_le16(x) htole16(x) | ||
35 | -#define cpu_to_le32(x) htole32(x) | ||
36 | +#if __BYTE_ORDER == __LITTLE_ENDIAN | ||
37 | +# define cpu_to_le16(x) (x) | ||
38 | +# define cpu_to_le32(x) (x) | ||
39 | +#else | ||
40 | +# define cpu_to_le16(x) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)) | ||
41 | +# define cpu_to_le32(x) \ | ||
42 | + ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \ | ||
43 | + (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) | ||
44 | +#endif | ||
45 | |||
46 | struct func_desc { | ||
47 | struct usb_interface_descriptor intf; | ||
48 | -- | ||
49 | 2.36.1.vfs.0.0 | ||
50 | |||
diff --git a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0021-adb-Allow-adbd-to-be-run-as-root.patch b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0021-adb-Allow-adbd-to-be-run-as-root.patch new file mode 100644 index 000000000..dbb12849c --- /dev/null +++ b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools/core/0021-adb-Allow-adbd-to-be-run-as-root.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | From 0bc94c83b9d846416613f9c8831cae6caf1713e5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
3 | Date: Tue, 14 Mar 2023 13:53:51 +0100 | ||
4 | Subject: [PATCH] adb: Allow adbd to be run as root | ||
5 | |||
6 | Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
7 | --- | ||
8 | adb/daemon/main.cpp | 1 + | ||
9 | 1 file changed, 1 insertion(+) | ||
10 | |||
11 | diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp | ||
12 | index c75263c4..d27f6996 100644 | ||
13 | --- a/adb/daemon/main.cpp | ||
14 | +++ b/adb/daemon/main.cpp | ||
15 | @@ -72,6 +72,7 @@ static bool should_drop_capabilities_bounding_set() { | ||
16 | } | ||
17 | |||
18 | static bool should_drop_privileges() { | ||
19 | + return true; | ||
20 | // "adb root" not allowed, always drop privileges. | ||
21 | if (!ALLOW_ADBD_ROOT && !is_device_unlocked()) return true; | ||
22 | |||
23 | -- | ||
24 | 2.36.1.vfs.0.0 | ||
25 | |||
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 6fc253298..236d0c3d1 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 | |||
@@ -79,6 +79,8 @@ SRC_URI += " \ | |||
79 | file://core/0017-Update-usage-of-usbdevfs_urb-to-match-new-kernel-UAP.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 \ | 80 | file://core/0018-img2simg-Fix-wrong-rpath.patch;patchdir=system/core \ |
81 | file://core/0019-Fix-compilation-with-gcc.patch;patchdir=system/core \ | 81 | file://core/0019-Fix-compilation-with-gcc.patch;patchdir=system/core \ |
82 | file://core/0020-adb-Fix-build-on-big-endian-systems.patch;patchdir=system/core \ | ||
83 | file://core/0021-adb-Allow-adbd-to-be-run-as-root.patch;patchdir=system/core \ | ||
82 | file://0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch;patchdir=external/boringssl \ | 84 | file://0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch;patchdir=external/boringssl \ |
83 | file://0001-patching-libundwind-to-build-in-yocto-environment.patch;patchdir=external/libunwind \ | 85 | file://0001-patching-libundwind-to-build-in-yocto-environment.patch;patchdir=external/libunwind \ |
84 | file://0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch;patchdir=system/extras \ | 86 | file://0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch;patchdir=system/extras \ |