Merge "adb: Add USB vendor ID for Lenovo"
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 90c017b..f6e0196 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -166,6 +166,11 @@
     chown system system /data/dalvik-cache
     chmod 0771 /data/dalvik-cache
 
+    # create resource-cache and double-check the perms
+    mkdir /data/resource-cache 0771 system system
+    chown system system /data/resource-cache
+    chmod 0771 /data/resource-cache
+
     # create the lost+found directories, so as to enforce our permissions
     mkdir /data/lost+found 0770
     mkdir /cache/lost+found 0770
diff --git a/toolbox/ls.c b/toolbox/ls.c
index 962bf47..59ba35e 100644
--- a/toolbox/ls.c
+++ b/toolbox/ls.c
@@ -144,6 +144,7 @@
 #define LIST_RECURSIVE      (1 << 2)
 #define LIST_DIRECTORIES    (1 << 3)
 #define LIST_SIZE           (1 << 4)
+#define LIST_CLASSIFY       (1 << 6)
 
 // fwd
 static int listpath(const char *name, int flags);
@@ -253,7 +254,27 @@
     }
 
     /* blocks are 512 bytes, we want output to be KB */
-    printf("%lld %s\n", s.st_blocks / 2, filename);
+    if ((flags & LIST_SIZE) != 0) {
+        printf("%lld ", s.st_blocks / 2);
+    }
+
+    if ((flags & LIST_CLASSIFY) != 0) {
+        char filetype = mode2kind(s.st_mode);
+        if (filetype != 'l') {
+            printf("%c ", filetype);
+        } else {
+            struct stat link_dest;
+            if (!stat(path, &link_dest)) {
+                printf("l%c ", mode2kind(link_dest.st_mode));
+            } else {
+                fprintf(stderr, "stat '%s' failed: %s\n", path, strerror(errno));
+                printf("l? ");
+            }
+        }
+    }
+
+    printf("%s\n", filename);
+
     return 0;
 }
 
@@ -330,7 +351,7 @@
 
 static int listfile(const char *dirname, const char *filename, int flags)
 {
-    if ((flags & (LIST_LONG | LIST_SIZE)) == 0) {
+    if ((flags & (LIST_LONG | LIST_SIZE | LIST_CLASSIFY)) == 0) {
         printf("%s\n", filename);
         return 0;
     }
@@ -480,6 +501,7 @@
                     case 'R': flags |= LIST_RECURSIVE; break;
                     case 'd': flags |= LIST_DIRECTORIES; break;
                     case 'a': flags |= LIST_ALL; break;
+                    case 'F': flags |= LIST_CLASSIFY; break;
                     default:
                         fprintf(stderr, "%s: Unknown option '-%c'. Aborting.\n", "ls", arg[0]);
                         exit(1);