From a9582846e03b7f0ef6824f2cc79a83723fd8f6ac Mon Sep 17 00:00:00 2001 From: Vijayavardhan Vennapusa Date: Wed, 7 May 2014 15:12:14 +0530 Subject: [PATCH] init.qcom.usb.rc: Set serial string on init Currently init.qcom.usb.sh is writing the serial number into android sysfs entry. But during bootup, .rc file is writing default composition before .sh gets executed. This results USB driver sending default serial string to host due to port hopping happens. Hence write ro.serialno to the sysfs entry on init once. Also remove reading persist.usb.serialno which is required only for NAND based devices as all future targets are emmc based devices. CRs-Fixed: 659235 Change-Id: Iddb0875fe0aff9aa9d53850861cc54735e5006d7 --- rootdir/etc/init.qcom.usb.rc | 1 + rootdir/etc/init.qcom.usb.sh | 20 -------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc index d1695f7f..50a8c2f2 100644 --- a/rootdir/etc/init.qcom.usb.rc +++ b/rootdir/etc/init.qcom.usb.rc @@ -27,6 +27,7 @@ on init write /sys/class/android_usb/android0/f_rndis/wceis 1 + write /sys/class/android_usb/android0/iSerial ${ro.serialno} on charger setprop sys.usb.config mass_storage diff --git a/rootdir/etc/init.qcom.usb.sh b/rootdir/etc/init.qcom.usb.sh index a2aa61b1..4de5e711 100644 --- a/rootdir/etc/init.qcom.usb.sh +++ b/rootdir/etc/init.qcom.usb.sh @@ -27,26 +27,6 @@ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # -# Update USB serial number from persist storage if present, if not update -# with value passed from kernel command line, if none of these values are -# set then use the default value. This order is needed as for devices which -# do not have unique serial number. -# User needs to set unique usb serial number to persist.usb.serialno -# -serialno=`getprop persist.usb.serialno` -case "$serialno" in - "") - serialnum=`getprop ro.serialno` - case "$serialnum" in - "");; #Do nothing, use default serial number - *) - echo "$serialnum" > /sys/class/android_usb/android0/iSerial - esac - ;; - *) - echo "$serialno" > /sys/class/android_usb/android0/iSerial -esac - chown -h root.system /sys/devices/platform/msm_hsusb/gadget/wakeup chmod -h 220 /sys/devices/platform/msm_hsusb/gadget/wakeup