mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
devel/android-tools-{adb,fastboot}: update to 7.0.0.r1 (nougat)
Changes: https://android.googlesource.com/platform/system/core/+log/android-6.0.1_r24..android-7.0.0_r1/adb Changes: https://android.googlesource.com/platform/system/core/+log/android-6.0.0_r26..android-7.0.0_r1/fastboot
This commit is contained in:
parent
1bea43a3af
commit
e7c25f9f24
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=420787
30 changed files with 133 additions and 226 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
PORTNAME= android-tools-adb
|
||||
DISTVERSIONPREFIX= android-
|
||||
DISTVERSION?= 6.0.1_r24
|
||||
DISTVERSION?= 7.0.0_r1
|
||||
PORTREVISION?= 0
|
||||
CATEGORIES= devel
|
||||
|
||||
|
@ -19,19 +19,11 @@ GH_PROJECT= platform_system_core
|
|||
.ifdef DISTVERSIONSUFFIX
|
||||
GH_REVISION= ${DISTVERSIONSUFFIX:S/-g//} # snapshot
|
||||
.else
|
||||
GH_REVISION= 2a288d0f331c # generated by: make update-revision
|
||||
GH_REVISION= 88f64719d756 # generated by: make update-revision
|
||||
.endif
|
||||
|
||||
CONFLICTS_INSTALL?= ${PORTNAME}-devel-*
|
||||
|
||||
.ifndef EXTRA_PATCHES
|
||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_include_base_logging.h
|
||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file.cpp
|
||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file__test.cpp
|
||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_logging.cpp
|
||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-liblog_logd__write.c
|
||||
.endif
|
||||
|
||||
USES= compiler:c++11-lib uidfix
|
||||
USE_OPENSSL= yes
|
||||
BUILD_WRKSRC= ${WRKSRC}/adb
|
||||
|
@ -55,7 +47,7 @@ OPTIONS_SUB= yes
|
|||
|
||||
BASH_GH_ACCOUNT= mbrubeck:bashcomp
|
||||
BASH_GH_PROJECT= android-completion:bashcomp
|
||||
BASH_GH_TAGNAME= 3b0fabe:bashcomp
|
||||
BASH_GH_TAGNAME= c1b0656:bashcomp
|
||||
BASH_PLIST_FILES= etc/bash_completion.d/adb
|
||||
BASH_VARS= LICENSE+=MIT LICENSE_COMB=multi
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
SHA256 (android-platform_system_core-android-6.0.1_r24_GH0.tar.gz) = f335756cc7f2ad3b6870dee7fb4641fd97df0a4d51c89bd508dce34802815b1e
|
||||
SIZE (android-platform_system_core-android-6.0.1_r24_GH0.tar.gz) = 1184987
|
||||
SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc
|
||||
SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948
|
||||
TIMESTAMP = 1472009581
|
||||
SHA256 (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = faa44f626dfab9e604f509cc541a8e491e7e46a9de42df3a9c1e24c36fd9f8c4
|
||||
SIZE (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = 1570346
|
||||
SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c
|
||||
SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967
|
||||
|
|
|
@ -13,23 +13,33 @@ SRCS+= adb_auth_host.cpp
|
|||
SRCS+= adb_client.cpp
|
||||
SRCS+= adb_io.cpp
|
||||
SRCS+= adb_listeners.cpp
|
||||
SRCS+= adb_main.cpp
|
||||
SRCS+= adb_trace.cpp
|
||||
SRCS+= adb_utils.cpp
|
||||
SRCS+= commandline.cpp
|
||||
SRCS+= console.cpp
|
||||
SRCS+= diagnose_usb.cpp
|
||||
SRCS+= fdevent.cpp
|
||||
SRCS+= file_sync_client.cpp
|
||||
SRCS+= line_printer.cpp
|
||||
SRCS+= services.cpp
|
||||
# XXX SuffFindDeps may fail to restore suffix lost in transformation
|
||||
SRCS+= shell_service_protocol.cpp
|
||||
SRCS+= ../adb/sockets.cpp
|
||||
SRCS+= sysdeps_unix.cpp
|
||||
SRCS+= transport.cpp
|
||||
SRCS+= transport_local.cpp
|
||||
SRCS+= transport_usb.cpp
|
||||
|
||||
TEST_SRCS+= adb_io_test.cpp
|
||||
TEST_SRCS+= adb_utils_test.cpp
|
||||
TEST_SRCS+= fdevent_test.cpp
|
||||
TEST_SRCS+= shell_service_protocol_test.cpp
|
||||
TEST_SRCS+= socket_test.cpp
|
||||
TEST_SRCS+= sysdeps_test.cpp
|
||||
TEST_SRCS+= transport_test.cpp
|
||||
|
||||
.PATH: ${.CURDIR}/client
|
||||
SRCS+= main.cpp
|
||||
|
||||
.PATH: ${EXTRADIR}
|
||||
SRCS+= get_my_path_freebsd.cpp
|
||||
SRCS+= usb_libusb.cpp
|
||||
|
@ -37,30 +47,39 @@ SRCS+= usb_libusb.cpp
|
|||
.PATH: ${.CURDIR}/../base
|
||||
SRCS+= file.cpp
|
||||
SRCS+= logging.cpp
|
||||
SRCS+= strings.cpp
|
||||
SRCS+= parsenetaddress.cpp
|
||||
SRCS+= stringprintf.cpp
|
||||
SRCS+= strings.cpp
|
||||
TEST_SRCS+= file_test.cpp
|
||||
TEST_SRCS+= logging_test.cpp
|
||||
TEST_SRCS+= parsenetaddress_test.cpp
|
||||
TEST_SRCS+= stringprintf_test.cpp
|
||||
TEST_SRCS+= strings_test.cpp
|
||||
TEST_SRCS+= test_main.cpp
|
||||
TEST_SRCS+= test_utils.cpp
|
||||
|
||||
.PATH: ${.CURDIR}/../libcutils
|
||||
SRCS+= socket_inaddr_any_server.c
|
||||
SRCS+= socket_local_client.c
|
||||
SRCS+= socket_local_server.c
|
||||
SRCS+= socket_loopback_client.c
|
||||
SRCS+= socket_loopback_server.c
|
||||
SRCS+= socket_network_client.c
|
||||
SRCS+= socket_inaddr_any_server_unix.c
|
||||
SRCS+= socket_local_client_unix.c
|
||||
SRCS+= socket_local_server_unix.c
|
||||
SRCS+= socket_loopback_client_unix.c
|
||||
SRCS+= socket_loopback_server_unix.c
|
||||
SRCS+= socket_network_client_unix.c
|
||||
SRCS+= ../libcutils/sockets.cpp
|
||||
SRCS+= load_file.c
|
||||
SRCS+= threads.c
|
||||
# XXX Obsolete after 10.2 or r279980/r280329
|
||||
CPPFLAGS.sockets.cpp+= -o ${.TARGET}
|
||||
|
||||
# required by base/file.cpp
|
||||
.PATH: ${.CURDIR}/../liblog
|
||||
SRCS+= config_write.c
|
||||
SRCS+= fake_log_device.c
|
||||
SRCS+= logd_write.c
|
||||
CPPFLAGS.logd_write.c+= -DFAKE_LOG_DEVICE=1
|
||||
SRCS+= fake_writer.c
|
||||
SRCS+= logger_lock.c
|
||||
SRCS+= logger_name.c
|
||||
SRCS+= logger_write.c
|
||||
CPPFLAGS.config_write.c+= -DFAKE_LOG_DEVICE=1
|
||||
|
||||
REVISION?= $$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
|
||||
|
||||
|
@ -110,5 +129,5 @@ beforeinstall:
|
|||
test: ${PROG}_test
|
||||
@for f in ${.ALLSRC}; do ./$$f; done
|
||||
|
||||
${PROG}_test: ${OBJS:Nadb_main.o:Ncommandline.o} ${TEST_OBJS}
|
||||
${PROG}_test: ${OBJS:Nmain.o:Ncommandline.o} ${TEST_OBJS}
|
||||
${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
--- base/file.cpp.orig 2015-05-27 20:24:08 UTC
|
||||
+++ base/file.cpp
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
+#include <cstring> // strerror
|
||||
#include <string>
|
||||
|
||||
#include "base/macros.h" // For TEMP_FAILURE_RETRY on Darwin.
|
|
@ -1,68 +0,0 @@
|
|||
commit cf168a8 + cbf26b7
|
||||
Author: Spencer Low <CompareAndSwap@gmail.com>
|
||||
Date: Mon Aug 3 20:43:24 2015 -0700
|
||||
|
||||
libbase_test: win32: get some tests working
|
||||
[...]
|
||||
- enh's edit to my previous change deleted a test that used
|
||||
/proc/version, but I think another test was missed. Merge that test into
|
||||
another.
|
||||
|
||||
--- base/file_test.cpp.orig 2015-08-27 08:07:53 UTC
|
||||
+++ base/file_test.cpp
|
||||
@@ -34,16 +34,7 @@ TEST(file, ReadFileToString_ENOENT) {
|
||||
EXPECT_EQ("", s); // s was cleared.
|
||||
}
|
||||
|
||||
-TEST(file, ReadFileToString_success) {
|
||||
- std::string s("hello");
|
||||
- ASSERT_TRUE(android::base::ReadFileToString("/proc/version", &s)) << errno;
|
||||
- EXPECT_GT(s.length(), 6U);
|
||||
- EXPECT_EQ('\n', s[s.length() - 1]);
|
||||
- s[5] = 0;
|
||||
- EXPECT_STREQ("Linux", s.c_str());
|
||||
-}
|
||||
-
|
||||
-TEST(file, WriteStringToFile) {
|
||||
+TEST(file, ReadFileToString_WriteStringToFile) {
|
||||
TemporaryFile tf;
|
||||
ASSERT_TRUE(tf.fd != -1);
|
||||
ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.filename)) << errno;
|
||||
@@ -80,27 +71,20 @@ TEST(file, WriteStringToFd) {
|
||||
EXPECT_EQ("abc", s);
|
||||
}
|
||||
|
||||
-TEST(file, ReadFully) {
|
||||
- int fd = open("/proc/version", O_RDONLY);
|
||||
- ASSERT_NE(-1, fd) << strerror(errno);
|
||||
-
|
||||
- char buf[1024];
|
||||
- memset(buf, 0, sizeof(buf));
|
||||
- ASSERT_TRUE(android::base::ReadFully(fd, buf, 5));
|
||||
- ASSERT_STREQ("Linux", buf);
|
||||
-
|
||||
- ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno);
|
||||
-
|
||||
- ASSERT_FALSE(android::base::ReadFully(fd, buf, sizeof(buf)));
|
||||
-
|
||||
- close(fd);
|
||||
-}
|
||||
-
|
||||
TEST(file, WriteFully) {
|
||||
TemporaryFile tf;
|
||||
ASSERT_TRUE(tf.fd != -1);
|
||||
ASSERT_TRUE(android::base::WriteFully(tf.fd, "abc", 3));
|
||||
+
|
||||
+ ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)) << errno;
|
||||
+
|
||||
std::string s;
|
||||
- ASSERT_TRUE(android::base::ReadFileToString(tf.filename, &s)) << errno;
|
||||
+ s.resize(3);
|
||||
+ ASSERT_TRUE(android::base::ReadFully(tf.fd, &s[0], s.size())) << errno;
|
||||
EXPECT_EQ("abc", s);
|
||||
+
|
||||
+ ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)) << errno;
|
||||
+
|
||||
+ s.resize(1024);
|
||||
+ ASSERT_FALSE(android::base::ReadFully(tf.fd, &s[0], s.size()));
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
--- base/include/base/logging.h.orig 2015-09-29 18:07:07 UTC
|
||||
+++ base/include/base/logging.h
|
||||
@@ -25,6 +25,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#include <errno.h>
|
||||
+
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <ostream>
|
|
@ -1,18 +0,0 @@
|
|||
--- base/logging.cpp.orig 2015-06-17 22:20:38 UTC
|
||||
+++ base/logging.cpp
|
||||
@@ -23,12 +23,14 @@
|
||||
#include <libgen.h>
|
||||
|
||||
// For getprogname(3) or program_invocation_short_name.
|
||||
-#if defined(__ANDROID__) || defined(__APPLE__)
|
||||
+#if !defined(_WIN32) && !defined(__GLIBC__)
|
||||
#include <stdlib.h>
|
||||
#elif defined(__GLIBC__)
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
+#include <cstring> // strlen
|
||||
+#include <cstdio> // fprintf
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <sstream>
|
|
@ -1,12 +0,0 @@
|
|||
--- liblog/logd_write.c.orig 2015-05-27 20:24:08 UTC
|
||||
+++ liblog/logd_write.c
|
||||
@@ -22,7 +22,9 @@
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
+#if (FAKE_LOG_DEVICE == 0)
|
||||
#include <stdatomic.h>
|
||||
+#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
9
devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h
Normal file
9
devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
--- adb/sysdeps/mutex.h.orig 2016-06-23 07:04:56 UTC
|
||||
+++ adb/sysdeps/mutex.h
|
||||
@@ -104,4 +104,6 @@
|
||||
|
||||
}
|
||||
|
||||
+#else
|
||||
+#include <mutex>
|
||||
#endif
|
|
@ -17,7 +17,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define TRACE_TAG TRACE_USB
|
||||
#define TRACE_TAG USB
|
||||
|
||||
#include "sysdeps.h"
|
||||
|
||||
|
@ -58,7 +58,7 @@ static usb_handle handle_list = {
|
|||
.next = &handle_list,
|
||||
};
|
||||
|
||||
void
|
||||
static void
|
||||
usb_cleanup()
|
||||
{
|
||||
libusb_exit(ctx);
|
||||
|
@ -600,9 +600,10 @@ scan_usb_devices()
|
|||
libusb_free_device_list(devs, 1);
|
||||
}
|
||||
|
||||
static void *
|
||||
device_poll_thread(void* unused)
|
||||
static void
|
||||
device_poll_thread(void*)
|
||||
{
|
||||
adb_thread_setname("USB scan");
|
||||
D("device_poll_thread(): Created USB scan thread");
|
||||
|
||||
for (;;) {
|
||||
|
@ -610,9 +611,6 @@ device_poll_thread(void* unused)
|
|||
kick_disconnected();
|
||||
scan_usb_devices();
|
||||
}
|
||||
|
||||
/* never reaching this point */
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -625,7 +623,6 @@ void
|
|||
usb_init()
|
||||
{
|
||||
D("usb_init(): started");
|
||||
adb_thread_t tid;
|
||||
struct sigaction actions;
|
||||
|
||||
atexit(usb_cleanup);
|
||||
|
@ -648,7 +645,7 @@ usb_init()
|
|||
scan_usb_devices();
|
||||
|
||||
/* starting USB event polling thread */
|
||||
if (adb_thread_create(&tid, device_poll_thread, nullptr)) {
|
||||
if (!adb_thread_create(device_poll_thread, nullptr)) {
|
||||
fatal_errno("cannot create USB scan thread");
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
PORTNAME= android-tools-fastboot
|
||||
DISTVERSIONPREFIX= android-
|
||||
DISTVERSION?= 6.0.0_r26
|
||||
DISTVERSION?= 7.0.0_r1
|
||||
PORTREVISION?= 0
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= https://anonscm.debian.org/cgit/android-tools/android-tools.git/plain/debian/:manpage
|
||||
|
@ -27,16 +27,11 @@ GH_PROJECT= platform_system_core platform_system_extras:extras \
|
|||
.ifdef DISTVERSIONSUFFIX
|
||||
GH_REVISION= ${DISTVERSIONSUFFIX:S/-g//} # snapshot
|
||||
.else
|
||||
GH_REVISION= f7f765fd62bf # generated by: make update-revision
|
||||
GH_REVISION= 88f64719d756 # generated by: make update-revision
|
||||
.endif
|
||||
|
||||
CONFLICTS_INSTALL?= ${PORTNAME}-devel-*
|
||||
|
||||
.ifndef EXTRA_PATCHES
|
||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file.cpp
|
||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-liblog_logd__write.c
|
||||
.endif
|
||||
|
||||
USES= compiler:c++11-lib pkgconfig uidfix
|
||||
BUILD_WRKSRC= ${WRKSRC}/fastboot
|
||||
INSTALL_WRKSRC= ${BUILD_WRKSRC}
|
||||
|
@ -59,7 +54,7 @@ OPTIONS_SUB= yes
|
|||
|
||||
BASH_GH_ACCOUNT= mbrubeck:bashcomp
|
||||
BASH_GH_PROJECT= android-completion:bashcomp
|
||||
BASH_GH_TAGNAME= 3b0fabe:bashcomp
|
||||
BASH_GH_TAGNAME= c1b0656:bashcomp
|
||||
BASH_PLIST_FILES= etc/bash_completion.d/fastboot
|
||||
BASH_VARS= LICENSE+=MIT
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
TIMESTAMP = 1472009581
|
||||
SHA256 (fastboot.1?id=706e754) = 2af01b064440952a82f1602691a0fecc030302722a71444946fb70d9c423d283
|
||||
SIZE (fastboot.1?id=706e754) = 5906
|
||||
SHA256 (android-platform_system_core-android-6.0.0_r26_GH0.tar.gz) = 75c3135b44874e1a6d6b98cf7fc2c7513f77bd41b0302cd1f8d0a5a9ade46a36
|
||||
SIZE (android-platform_system_core-android-6.0.0_r26_GH0.tar.gz) = 1182157
|
||||
SHA256 (jbeich-platform_system_extras-android-6.0.0_r26_GH0.tar.gz) = 2364ecc2c91209af7ecab294bee0a6e8e12e4faf54b33ab3559e53ad9e44634c
|
||||
SIZE (jbeich-platform_system_extras-android-6.0.0_r26_GH0.tar.gz) = 650471
|
||||
SHA256 (jbeich-platform_external_libselinux-android-6.0.0_r26_GH0.tar.gz) = 735a4be6b2c80b43ff19f7fa29c6aac7c361e4e8c0e5f65b70ec74ea5bfc3c18
|
||||
SIZE (jbeich-platform_external_libselinux-android-6.0.0_r26_GH0.tar.gz) = 50960
|
||||
SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc
|
||||
SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948
|
||||
SHA256 (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = faa44f626dfab9e604f509cc541a8e491e7e46a9de42df3a9c1e24c36fd9f8c4
|
||||
SIZE (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = 1570346
|
||||
SHA256 (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = ff2ea6db032da70374edcd6867bd11d765a475a32d732b983d0dad6ae16e209b
|
||||
SIZE (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = 79621110
|
||||
SHA256 (jbeich-platform_external_libselinux-android-7.0.0_r1_GH0.tar.gz) = bf335619fb77fc523e33d08523d20795de17a6a906b87e16fd7d79911f186a15
|
||||
SIZE (jbeich-platform_external_libselinux-android-7.0.0_r1_GH0.tar.gz) = 59544
|
||||
SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c
|
||||
SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967
|
||||
|
|
|
@ -7,19 +7,30 @@ FILESDIR?=${DOCDIR}/${PROG}
|
|||
FILES= *.[Tt][Xx][Tt]
|
||||
|
||||
SRCS+= bootimg_utils.cpp
|
||||
SRCS+= engine.c
|
||||
SRCS+= engine.cpp
|
||||
SRCS+= fastboot.cpp
|
||||
SRCS+= fs.c
|
||||
SRCS+= protocol.c
|
||||
SRCS+= util.c
|
||||
SRCS+= ../fastboot/fs.cpp
|
||||
SRCS+= protocol.cpp
|
||||
SRCS+= socket.cpp
|
||||
SRCS+= tcp.cpp
|
||||
SRCS+= udp.cpp
|
||||
SRCS+= util.cpp
|
||||
|
||||
.PATH: ${EXTRADIR}
|
||||
SRCS+= usb_freebsd.cpp
|
||||
SRCS+= util_freebsd.cpp
|
||||
|
||||
# required by libziparchive
|
||||
# required by fastboot
|
||||
.PATH: ${.CURDIR}/../adb
|
||||
SRCS+= diagnose_usb.cpp
|
||||
|
||||
# required by fastboot, diagnose_usb and libziparchive
|
||||
.PATH: ${.CURDIR}/../base
|
||||
SRCS+= errors_unix.cpp
|
||||
SRCS+= file.cpp
|
||||
SRCS+= parsenetaddress.cpp
|
||||
SRCS+= stringprintf.cpp
|
||||
SRCS+= strings.cpp
|
||||
|
||||
# required by fastboot
|
||||
.PATH: ${.CURDIR}/../ext4_utils
|
||||
|
@ -35,11 +46,23 @@ SRCS+= make_ext4fs.c
|
|||
SRCS+= sha1.c
|
||||
SRCS+= wipe.c
|
||||
|
||||
# required by fastboot
|
||||
.PATH: ${.CURDIR}/../libcutils
|
||||
SRCS+= ../libcutils/sockets.cpp
|
||||
SRCS+= socket_inaddr_any_server_unix.c
|
||||
SRCS+= socket_network_client_unix.c
|
||||
SRCS+= sockets_unix.cpp
|
||||
CPPFLAGS.sockets.cpp+= -o ${.TARGET} # XXX pre-r279980
|
||||
|
||||
# required by base and libutils
|
||||
.PATH: ${.CURDIR}/../liblog
|
||||
SRCS+= config_write.c
|
||||
SRCS+= fake_log_device.c
|
||||
SRCS+= logd_write.c
|
||||
CPPFLAGS.logd_write.c+= -DFAKE_LOG_DEVICE=1
|
||||
SRCS+= fake_writer.c
|
||||
SRCS+= logger_lock.c
|
||||
SRCS+= logger_name.c
|
||||
SRCS+= logger_write.c
|
||||
CPPFLAGS.config_write.c+= -DFAKE_LOG_DEVICE=1
|
||||
|
||||
# required by ext4_utils
|
||||
.PATH: ${.CURDIR}/../libselinux/src
|
||||
|
@ -50,6 +73,8 @@ SRCS+= init.c
|
|||
SRCS+= label.c
|
||||
SRCS+= label_android_property.c
|
||||
SRCS+= label_file.c
|
||||
SRCS+= label_support.c
|
||||
CPPFLAGS.label_file.c+= -D_WITH_GETLINE
|
||||
|
||||
# required by fastboot and ext4_utils
|
||||
.PATH: ${.CURDIR}/../libsparse
|
||||
|
@ -78,6 +103,7 @@ CPPFLAGS+= -Dmmap64=mmap
|
|||
CPPFLAGS+= -Dpread64=pread
|
||||
CPPFLAGS+= -I${.CURDIR}
|
||||
CPPFLAGS+= -I${.CURDIR}/../include
|
||||
CPPFLAGS+= -I${.CURDIR}/../adb
|
||||
CPPFLAGS+= -I${.CURDIR}/../mkbootimg
|
||||
CPPFLAGS+= -I${.CURDIR}/../base/include
|
||||
CPPFLAGS+= -I${.CURDIR}/../ext4_utils
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
--- base/file.cpp.orig 2015-05-27 20:24:08 UTC
|
||||
+++ base/file.cpp
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
+#include <cstring> // strerror
|
||||
#include <string>
|
||||
|
||||
#include "base/macros.h" // For TEMP_FAILURE_RETRY on Darwin.
|
|
@ -1,12 +0,0 @@
|
|||
--- liblog/logd_write.c.orig 2015-05-27 20:24:08 UTC
|
||||
+++ liblog/logd_write.c
|
||||
@@ -22,7 +22,9 @@
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
+#if (FAKE_LOG_DEVICE == 0)
|
||||
#include <stdatomic.h>
|
||||
+#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
|
@ -30,6 +30,8 @@
|
|||
#include <string.h>
|
||||
#include <libusb.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "usb.h"
|
||||
|
||||
struct usb_handle {
|
||||
|
@ -40,8 +42,24 @@ struct usb_handle {
|
|||
unsigned char iface;
|
||||
};
|
||||
|
||||
class LibusbUsbTransport : public Transport {
|
||||
public:
|
||||
explicit LibusbUsbTransport(std::unique_ptr<usb_handle> handle):
|
||||
h(std::move(handle)) {}
|
||||
~LibusbUsbTransport() override = default;
|
||||
|
||||
ssize_t Read(void *_data, size_t len) override;
|
||||
ssize_t Write(const void *_data, size_t len) override;
|
||||
int Close() override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<usb_handle> h;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(LibusbUsbTransport);
|
||||
};
|
||||
|
||||
static int
|
||||
probe(usb_handle *h, ifc_match_func callback)
|
||||
probe(std::unique_ptr<usb_handle> &h, ifc_match_func callback)
|
||||
{
|
||||
usb_ifc_info info;
|
||||
libusb_device_descriptor ddesc;
|
||||
|
@ -120,26 +138,22 @@ probe(usb_handle *h, ifc_match_func callback)
|
|||
return (-1);
|
||||
}
|
||||
|
||||
static usb_handle *
|
||||
static std::unique_ptr<usb_handle>
|
||||
enumerate(ifc_match_func callback)
|
||||
{
|
||||
static libusb_context *ctx = NULL;
|
||||
usb_handle *h;
|
||||
std::unique_ptr<usb_handle> h;
|
||||
libusb_device **ppdev;
|
||||
ssize_t ndev;
|
||||
ssize_t x;
|
||||
|
||||
h = reinterpret_cast<usb_handle*>(malloc(sizeof(*h)));
|
||||
if (h == NULL)
|
||||
return (h);
|
||||
|
||||
if (ctx == NULL)
|
||||
libusb_init(&ctx);
|
||||
|
||||
ndev = libusb_get_device_list(ctx, &ppdev);
|
||||
for (x = 0; x < ndev; x++) {
|
||||
|
||||
memset(h, 0, sizeof(*h));
|
||||
h.reset(new usb_handle);
|
||||
|
||||
h->dev = ppdev[x];
|
||||
|
||||
|
@ -149,13 +163,13 @@ enumerate(ifc_match_func callback)
|
|||
return (h);
|
||||
}
|
||||
}
|
||||
free(h);
|
||||
h.reset();
|
||||
libusb_free_device_list(ppdev, 1);
|
||||
return (NULL);
|
||||
return (nullptr);
|
||||
}
|
||||
|
||||
int
|
||||
usb_write(usb_handle * h, const void *_data, int len)
|
||||
ssize_t
|
||||
LibusbUsbTransport::Write(const void *_data, size_t len)
|
||||
{
|
||||
int actlen;
|
||||
|
||||
|
@ -165,8 +179,8 @@ usb_write(usb_handle * h, const void *_data, int len)
|
|||
return (actlen);
|
||||
}
|
||||
|
||||
int
|
||||
usb_read(usb_handle * h, void *_data, int len)
|
||||
ssize_t
|
||||
LibusbUsbTransport::Read(void *_data, size_t len)
|
||||
{
|
||||
int actlen;
|
||||
|
||||
|
@ -176,25 +190,19 @@ usb_read(usb_handle * h, void *_data, int len)
|
|||
return (actlen);
|
||||
}
|
||||
|
||||
int
|
||||
usb_close(usb_handle * h)
|
||||
int
|
||||
LibusbUsbTransport::Close()
|
||||
{
|
||||
libusb_close(h->handle);
|
||||
h->handle = NULL;
|
||||
libusb_unref_device(h->dev);
|
||||
free(h);
|
||||
h.reset();
|
||||
return (0);
|
||||
}
|
||||
|
||||
usb_handle *
|
||||
Transport *
|
||||
usb_open(ifc_match_func callback)
|
||||
{
|
||||
return (enumerate(callback));
|
||||
}
|
||||
|
||||
int
|
||||
usb_wait_for_disconnect(usb_handle * h)
|
||||
{
|
||||
/* TODO: Punt for now */
|
||||
return 0;
|
||||
std::unique_ptr<usb_handle> h = enumerate(callback);
|
||||
return (h ? new LibusbUsbTransport(std::move(h)) : nullptr);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue