Merge change 6738 into donut

* changes:
  rootdir: Remove ip-up-vpn script, which is replaced by an executable.
diff --git a/adb/adb.h b/adb/adb.h
index b9ed556..95610a7 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -33,7 +33,7 @@
 #define ADB_VERSION_MAJOR 1         // Used for help/version information
 #define ADB_VERSION_MINOR 0         // Used for help/version information
 
-#define ADB_SERVER_VERSION    20    // Increment this when we want to force users to start a new adb server
+#define ADB_SERVER_VERSION    21    // Increment this when we want to force users to start a new adb server
 
 typedef struct amessage amessage;
 typedef struct apacket apacket;
diff --git a/adb/commandline.c b/adb/commandline.c
index 7410dce..548d362 100644
--- a/adb/commandline.c
+++ b/adb/commandline.c
@@ -151,7 +151,7 @@
         "\n"
         "networking:\n"
         "  adb ppp <tty> [parameters]   - Run PPP over USB.\n"
-        " Note: you should not automatically start a PDP connection.\n"
+        " Note: you should not automatically start a PPP connection.\n"
         " <tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1\n"
         " [parameters] - Eg. defaultroute debug dump local notty usepeerdns\n"
         "\n"
diff --git a/adb/usb_linux.c b/adb/usb_linux.c
index 32ce0a9..95c2ce6 100644
--- a/adb/usb_linux.c
+++ b/adb/usb_linux.c
@@ -269,26 +269,46 @@
                     if (device->iSerialNumber) {
                         struct usbdevfs_ctrltransfer  ctrl;
                         __u16 buffer[128];
-                        int result;
+                        __u16 languages[128];
+                        int i, result;
+                        int languageCount = 0;
 
-                        memset(buffer, 0, sizeof(buffer));
+                        memset(languages, 0, sizeof(languages));
                         memset(&ctrl, 0, sizeof(ctrl));
 
+                            // read list of supported languages
                         ctrl.bRequestType = USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE;
                         ctrl.bRequest = USB_REQ_GET_DESCRIPTOR;
-                        ctrl.wValue = (USB_DT_STRING << 8) | device->iSerialNumber;
+                        ctrl.wValue = (USB_DT_STRING << 8) | 0;
                         ctrl.wIndex = 0;
-                        ctrl.wLength = sizeof(buffer);
-                        ctrl.data = buffer;
+                        ctrl.wLength = sizeof(languages);
+                        ctrl.data = languages;
 
                         result = ioctl(fd, USBDEVFS_CONTROL, &ctrl);
-                        if (result > 0) {
-                            int i;
-                                // skip first word, and copy the rest to the serial string, changing shorts to bytes.
-                            result /= 2;
-                            for (i = 1; i < result; i++)
-                                serial[i - 1] = buffer[i];
-                            serial[i - 1] = 0;
+                        if (result > 0)
+                            languageCount = (result - 2) / 2;
+
+                        for (i = 1; i <= languageCount; i++) {
+                            memset(buffer, 0, sizeof(buffer));
+                            memset(&ctrl, 0, sizeof(ctrl));
+
+                            ctrl.bRequestType = USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE;
+                            ctrl.bRequest = USB_REQ_GET_DESCRIPTOR;
+                            ctrl.wValue = (USB_DT_STRING << 8) | device->iSerialNumber;
+                            ctrl.wIndex = languages[i];
+                            ctrl.wLength = sizeof(buffer);
+                            ctrl.data = buffer;
+
+                            result = ioctl(fd, USBDEVFS_CONTROL, &ctrl);
+                            if (result > 0) {
+                                int i;
+                                    // skip first word, and copy the rest to the serial string, changing shorts to bytes.
+                                result /= 2;
+                                for (i = 1; i < result; i++)
+                                    serial[i - 1] = buffer[i];
+                                serial[i - 1] = 0;
+                                break;
+                            }
                         }
                     }
 
diff --git a/rootdir/init.rc b/rootdir/init.rc
index d318aa3..dab9027 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -78,11 +78,10 @@
     mkdir /data/misc/keystore 0770 keystore keystore
     mkdir /data/misc/vpn 0770 system system
     mkdir /data/misc/vpn/profiles 0770 system system
-    mkdir /data/misc/wifi 0770 wifi system
-    chown wifi system /data/misc/wifi
-    touch /data/misc/wifi/wpa_supplicant.conf
+    # give system access to wpa_supplicant.conf for backup and restore
+    mkdir /data/misc/wifi 0770 wifi wifi
+    chmod 0770 /data/misc/wifi
     chmod 0660 /data/misc/wifi/wpa_supplicant.conf
-    chown wifi system /data/misc/wifi/wpa_supplicant.conf
     mkdir /data/local 0771 shell shell
     mkdir /data/local/tmp 0771 shell shell
     mkdir /data/data 0771 system system