summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:08:08 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:08:08 -0800
commit35237d135807af84bf9b0e5b8d7f8633e58db6f5 (patch)
treed8bcf3ada2182d248604728285dd80abb466f22a /fastboot
parent4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53 (diff)
downloadsystem_core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.zip
system_core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.tar.gz
system_core-35237d135807af84bf9b0e5b8d7f8633e58db6f5.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'fastboot')
-rw-r--r--fastboot/Android.mk2
-rw-r--r--fastboot/fastboot.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/fastboot/Android.mk b/fastboot/Android.mk
index 5e9941d..7a9d35f 100644
--- a/fastboot/Android.mk
+++ b/fastboot/Android.mk
@@ -43,7 +43,7 @@ endif
LOCAL_STATIC_LIBRARIES := $(EXTRA_STATIC_LIBS) libzipfile libunz
include $(BUILD_HOST_EXECUTABLE)
-$(call dist-for-goals,user userdebug droid,$(LOCAL_BUILT_MODULE))
+$(call dist-for-goals,droid,$(LOCAL_BUILT_MODULE))
ifeq ($(HOST_OS),linux)
include $(CLEAR_VARS)
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c
index 64a4045..4079a38 100644
--- a/fastboot/fastboot.c
+++ b/fastboot/fastboot.c
@@ -47,6 +47,7 @@ static const char *serial = 0;
static const char *product = 0;
static const char *cmdline = 0;
static int wipe_data = 0;
+static unsigned short vendor_id = 0;
void die(const char *fmt, ...)
{
@@ -135,7 +136,8 @@ oops:
int match_fastboot(usb_ifc_info *info)
{
- if((info->dev_vendor != 0x18d1) &&
+ if(!(vendor_id && (info->dev_vendor == vendor_id)) &&
+ (info->dev_vendor != 0x18d1) &&
(info->dev_vendor != 0x0bb4)) return -1;
if(info->ifc_class != 0xff) return -1;
if(info->ifc_subclass != 0x42) return -1;
@@ -208,6 +210,7 @@ void usage(void)
" -s <serial number> specify device serial number\n"
" -p <product> specify product name\n"
" -c <cmdline> override kernel commandline\n"
+ " -i <vendor id> specify a custom USB vendor id\n"
);
exit(1);
}
@@ -553,6 +556,16 @@ int main(int argc, char **argv)
require(2);
cmdline = argv[1];
skip(2);
+ } else if(!strcmp(*argv, "-i")) {
+ char *endptr = NULL;
+ unsigned long val;
+
+ require(2);
+ val = strtoul(argv[1], &endptr, 0);
+ if (!endptr || *endptr != '\0' || (val & ~0xffff))
+ die("invalid vendor id '%s'", argv[1]);
+ vendor_id = (unsigned short)val;
+ skip(2);
} else if(!strcmp(*argv, "getvar")) {
require(2);
fb_queue_display(argv[1], argv[1]);