auto import from //branches/cupcake_rel/...@138607
diff --git a/commandline.c b/commandline.c
index be596ce..7410dce 100644
--- a/commandline.c
+++ b/commandline.c
@@ -147,6 +147,7 @@
         "  adb get-serialno             - prints: <serial-number>\n"
         "  adb status-window            - continuously print device status for a specified device\n"
         "  adb remount                  - remounts the /system partition on the device read-write\n"
+        "  adb root                     - restarts adb with root permissions\n"
         "\n"
         "networking:\n"
         "  adb ppp <tty> [parameters]   - Run PPP over USB.\n"
@@ -914,6 +915,17 @@
         return 1;
     }
 
+    if(!strcmp(argv[0], "root")) {
+        int fd = adb_connect("root:");
+        if(fd >= 0) {
+            read_and_dump(fd);
+            adb_close(fd);
+            return 0;
+        }
+        fprintf(stderr,"error: %s\n", adb_error());
+        return 1;
+    }
+
     if(!strcmp(argv[0], "bugreport")) {
         if (argc != 1) {
             return 1;