From 0b5ff3a9722b672bec0e5b0b682babc057ea6d08 Mon Sep 17 00:00:00 2001 From: Sujeet Kumar Date: Thu, 27 Mar 2014 18:29:32 +0530 Subject: [PATCH] USB: init.qcom.usb.sh: Mount cdrom media for msm8916 Mount cdrom media for msm8916 targets. LUNs are already created during the initialization time and hence its fine to echo the media for cdrom at this time. Change-Id: I43c5be6483c3d47559986a95c48938dad15789e7 --- rootdir/etc/init.qcom.usb.rc | 4 ---- rootdir/etc/init.qcom.usb.sh | 38 ++++++++++-------------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc index 4ce856c8..2c00e5f4 100644 --- a/rootdir/etc/init.qcom.usb.rc +++ b/rootdir/etc/init.qcom.usb.rc @@ -166,7 +166,6 @@ on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage,adb write /sys/class/android_usb/android0/f_serial/transports smd,tty write /sys/class/android_usb/android0/f_rmnet/transports smd,bam write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/f_mass_storage/luns ${persist.sys.usb.luns} write /sys/class/android_usb/android0/enable 1 start adbd setprop sys.usb.state ${sys.usb.config} @@ -192,7 +191,6 @@ on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage write /sys/class/android_usb/android0/f_serial/transports smd,tty write /sys/class/android_usb/android0/f_rmnet/transports smd,bam write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage - write /sys/class/android_usb/android0/f_mass_storage/luns ${persist.sys.usb.luns} write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} @@ -303,7 +301,6 @@ on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage,adb write /sys/class/android_usb/android0/f_diag/clients diag write /sys/class/android_usb/android0/f_serial/transports tty,tty write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/f_mass_storage/luns ${persist.sys.usb.luns} write /sys/class/android_usb/android0/enable 1 start adbd start port-bridge @@ -329,7 +326,6 @@ on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage write /sys/class/android_usb/android0/f_diag/clients diag write /sys/class/android_usb/android0/f_serial/transports tty,tty write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage - write /sys/class/android_usb/android0/f_mass_storage/luns ${persist.sys.usb.luns} write /sys/class/android_usb/android0/enable 1 start port-bridge setprop sys.usb.state ${sys.usb.config} diff --git a/rootdir/etc/init.qcom.usb.sh b/rootdir/etc/init.qcom.usb.sh index 55498127..0334a95f 100644 --- a/rootdir/etc/init.qcom.usb.sh +++ b/rootdir/etc/init.qcom.usb.sh @@ -99,21 +99,6 @@ done fi target=`getprop ro.product.device` -cdromenable=`getprop persist.service.cdrom.enable` -create_luns() { - case "$1" in - "msm8226" | "msm8610") - case "$2" in - 0) - setprop persist.sys.usb.luns "" - ;; - 1) - setprop persist.sys.usb.luns rom - ;; - esac - ;; - esac -} # # Allow USB enumeration with default PID/VID @@ -152,7 +137,6 @@ case "$usb_config" in setprop persist.sys.usb.config diag,diag_mdm,diag_mdm2,serial_hsic,serial_hsusb,rmnet_hsic,rmnet_hsusb,mass_storage,adb ;; *) - create_luns $target $cdromenable echo $target case "$target" in "msm8916_32") @@ -247,19 +231,17 @@ esac # Add support for exposing lun0 as cdrom in mass-storage # cdromname="/system/etc/cdrom_install.iso" +platformver=`cat /sys/devices/soc0/hw_platform` case "$target" in - "msm8226" | "msm8610") - case "$cdromenable" in - 1) - echo "mounting usbcdrom lun" - if [ ! -f /sys/class/android_usb/android0/f_mass_storage/lun0/file ]; then - sleep 2 # cdrom lun still not created. give some time. - fi - echo $cdromname > /sys/class/android_usb/android0/f_mass_storage/lun0/file - chmod 0444 /sys/class/android_usb/android0/f_mass_storage/lun0/file - ;; - esac - ;; + "msm8226" | "msm8610" | "msm8916" | "msm8916_32" | "msm8916_64") + case $platformver in + "QRD") + echo "mounting usbcdrom lun" + echo $cdromname > /sys/class/android_usb/android0/f_mass_storage/rom/file + chmod 0444 /sys/class/android_usb/android0/f_mass_storage/rom/file + ;; + esac + ;; esac #