-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note: the adbd makefile can't be upstreamed to debian, because there is already an open PR upstream: https://salsa.debian.org/android-tools-team/android-platform-tools/-/merge_requests/4/diffs Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Loading branch information
1 parent
05f0920
commit 3add35f
Showing
75 changed files
with
2,857 additions
and
2,084 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...e/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs_1.0.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
162 changes: 162 additions & 0 deletions
162
...yers/selinux/recipes-devtool/android-tools/android-tools/0001-Fixes-for-yocto-build.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
From 5de85f8273c7284aa93e35c40f025d4d43d42df9 Mon Sep 17 00:00:00 2001 | ||
From: Etienne Cordonnier <ecordonnier@snap.com> | ||
Date: Thu, 16 Mar 2023 18:59:35 +0100 | ||
Subject: [PATCH] Fixes for yocto build | ||
|
||
Signed-off-by: JJ Robertson <jrobertson@snapchat.com> | ||
[rebased on version 29] | ||
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
|
||
--- | ||
system/core/adb/daemon/file_sync_service.cpp | 4 ++-- | ||
system/core/adb/daemon/framebuffer_service.h | 2 -- | ||
system/core/adb/daemon/main.cpp | 5 +++-- | ||
system/core/adb/daemon/restart_service.h | 2 -- | ||
system/core/adb/daemon/services.cpp | 6 ++---- | ||
system/core/adb/daemon/shell_service.cpp | 5 ++++- | ||
system/core/adb/types.h | 1 + | ||
7 files changed, 12 insertions(+), 13 deletions(-) | ||
|
||
diff --git a/system/core/adb/daemon/file_sync_service.cpp b/system/core/adb/daemon/file_sync_service.cpp | ||
index d6af7087..92e7087a 100644 | ||
--- a/system/core/adb/daemon/file_sync_service.cpp | ||
+++ b/system/core/adb/daemon/file_sync_service.cpp | ||
@@ -111,7 +111,7 @@ static bool secure_mkdirs(const std::string& path) { | ||
partial_path += path_component; | ||
|
||
if (should_use_fs_config(partial_path)) { | ||
- fs_config(partial_path.c_str(), 1, nullptr, &uid, &gid, &mode, &capabilities); | ||
+ // fs_config(partial_path.c_str(), 1, nullptr, &uid, &gid, &mode, &capabilities); | ||
} | ||
if (adb_mkdir(partial_path.c_str(), mode) == -1) { | ||
if (errno != EEXIST) { | ||
@@ -469,7 +469,7 @@ static bool do_send(int s, const std::string& spec, std::vector<char>& buffer) { | ||
uint64_t capabilities = 0; | ||
if (should_use_fs_config(path)) { | ||
unsigned int broken_api_hack = mode; | ||
- fs_config(path.c_str(), 0, nullptr, &uid, &gid, &broken_api_hack, &capabilities); | ||
+ // fs_config(path.c_str(), 0, nullptr, &uid, &gid, &broken_api_hack, &capabilities); | ||
mode = broken_api_hack; | ||
} | ||
|
||
diff --git a/system/core/adb/daemon/framebuffer_service.h b/system/core/adb/daemon/framebuffer_service.h | ||
index bab44be3..264da597 100644 | ||
--- a/system/core/adb/daemon/framebuffer_service.h | ||
+++ b/system/core/adb/daemon/framebuffer_service.h | ||
@@ -18,6 +18,4 @@ | ||
|
||
#include "adb_unique_fd.h" | ||
|
||
-#if defined(__ANDROID__) | ||
void framebuffer_service(unique_fd fd); | ||
-#endif | ||
diff --git a/system/core/adb/daemon/main.cpp b/system/core/adb/daemon/main.cpp | ||
index 3322574c..e807d13d 100644 | ||
--- a/system/core/adb/daemon/main.cpp | ||
+++ b/system/core/adb/daemon/main.cpp | ||
@@ -208,6 +208,9 @@ int adbd_main(int server_port) { | ||
umask(0); | ||
|
||
signal(SIGPIPE, SIG_IGN); | ||
+ signal(SIGINT, SIG_DFL); | ||
+ signal(SIGQUIT, SIG_DFL); | ||
+ | ||
|
||
#if defined(__BIONIC__) | ||
auto fdsan_level = android_fdsan_get_error_level(); | ||
@@ -254,13 +257,11 @@ int adbd_main(int server_port) { | ||
|
||
bool is_usb = false; | ||
|
||
-#if defined(__ANDROID__) | ||
if (access(USB_FFS_ADB_EP0, F_OK) == 0) { | ||
// Listen on USB. | ||
usb_init(); | ||
is_usb = true; | ||
} | ||
-#endif | ||
|
||
// If one of these properties is set, also listen on that port. | ||
// If one of the properties isn't set and we couldn't listen on usb, listen | ||
diff --git a/system/core/adb/daemon/restart_service.h b/system/core/adb/daemon/restart_service.h | ||
index 19840bd5..7a97614b 100644 | ||
--- a/system/core/adb/daemon/restart_service.h | ||
+++ b/system/core/adb/daemon/restart_service.h | ||
@@ -18,9 +18,7 @@ | ||
|
||
#include "adb_unique_fd.h" | ||
|
||
-#if defined(__ANDROID__) | ||
void restart_root_service(unique_fd fd); | ||
void restart_unroot_service(unique_fd fd); | ||
void restart_tcp_service(unique_fd fd, int port); | ||
void restart_usb_service(unique_fd fd); | ||
-#endif | ||
diff --git a/system/core/adb/daemon/services.cpp b/system/core/adb/daemon/services.cpp | ||
index 4ec90d27..d8541c23 100644 | ||
--- a/system/core/adb/daemon/services.cpp | ||
+++ b/system/core/adb/daemon/services.cpp | ||
@@ -156,7 +156,7 @@ static void spin_service(unique_fd fd) { | ||
} | ||
#endif | ||
// Fall through | ||
- std::string cmd = "/system/bin/reboot "; | ||
+ std::string cmd = "/sbin/reboot "; | ||
cmd += name; | ||
return StartSubprocess(cmd, nullptr, SubprocessType::kRaw, SubprocessProtocol::kNone); | ||
} | ||
@@ -265,11 +265,10 @@ unique_fd daemon_service_to_fd(std::string_view name, atransport* transport) { | ||
} | ||
#endif | ||
|
||
-#if defined(__ANDROID__) | ||
if (name.starts_with("framebuffer:")) { | ||
return create_service_thread("fb", framebuffer_service); | ||
} else if (android::base::ConsumePrefix(&name, "remount:")) { | ||
- std::string cmd = "/system/bin/remount "; | ||
+ std::string cmd = "/sbin/remount "; | ||
cmd += name; | ||
return StartSubprocess(cmd, nullptr, SubprocessType::kRaw, SubprocessProtocol::kNone); | ||
} else if (android::base::ConsumePrefix(&name, "reboot:")) { | ||
@@ -303,7 +302,6 @@ unique_fd daemon_service_to_fd(std::string_view name, atransport* transport) { | ||
} else if (name.starts_with("usb:")) { | ||
return create_service_thread("usb", restart_usb_service); | ||
} | ||
-#endif | ||
|
||
if (android::base::ConsumePrefix(&name, "dev:")) { | ||
return unique_fd{unix_open(name, O_RDWR | O_CLOEXEC)}; | ||
diff --git a/system/core/adb/daemon/shell_service.cpp b/system/core/adb/daemon/shell_service.cpp | ||
index f62032d0..ebcfe18d 100644 | ||
--- a/system/core/adb/daemon/shell_service.cpp | ||
+++ b/system/core/adb/daemon/shell_service.cpp | ||
@@ -273,13 +273,16 @@ bool Subprocess::ForkAndExec(std::string* error) { | ||
env["HOSTNAME"] = GetHostName(); | ||
env["LOGNAME"] = pw->pw_name; | ||
env["SHELL"] = pw->pw_shell; | ||
- env["TMPDIR"] = "/data/local/tmp"; | ||
env["USER"] = pw->pw_name; | ||
} | ||
|
||
if (!terminal_type_.empty()) { | ||
env["TERM"] = terminal_type_; | ||
} | ||
+ if (env.find("PS1") == env.end()) { | ||
+ env["PS1"] = "\\h:\\w\\$ "; | ||
+ } | ||
+ | ||
|
||
std::vector<std::string> joined_env; | ||
for (const auto& it : env) { | ||
diff --git a/system/core/adb/types.h b/system/core/adb/types.h | ||
index c619fffc..f8e0f521 100644 | ||
--- a/system/core/adb/types.h | ||
+++ b/system/core/adb/types.h | ||
@@ -22,6 +22,7 @@ | ||
#include <memory> | ||
#include <utility> | ||
#include <vector> | ||
+#include <string.h> | ||
|
||
#include <android-base/logging.h> | ||
|
41 changes: 0 additions & 41 deletions
41
...droid-tools/android-tools/0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
...droid-tools/android-tools/0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
.../android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.