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
This commit is contained in:
Sujeet Kumar 2014-03-27 18:29:32 +05:30 committed by Guoping Yu
parent b65e15fd8a
commit 0b5ff3a972
2 changed files with 10 additions and 32 deletions

View File

@ -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_serial/transports smd,tty
write /sys/class/android_usb/android0/f_rmnet/transports smd,bam 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/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 write /sys/class/android_usb/android0/enable 1
start adbd start adbd
setprop sys.usb.state ${sys.usb.config} 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_serial/transports smd,tty
write /sys/class/android_usb/android0/f_rmnet/transports smd,bam 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/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 write /sys/class/android_usb/android0/enable 1
setprop sys.usb.state ${sys.usb.config} 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_diag/clients diag
write /sys/class/android_usb/android0/f_serial/transports tty,tty 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/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 write /sys/class/android_usb/android0/enable 1
start adbd start adbd
start port-bridge 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_diag/clients diag
write /sys/class/android_usb/android0/f_serial/transports tty,tty 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/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 write /sys/class/android_usb/android0/enable 1
start port-bridge start port-bridge
setprop sys.usb.state ${sys.usb.config} setprop sys.usb.state ${sys.usb.config}

View File

@ -99,21 +99,6 @@ done
fi fi
target=`getprop ro.product.device` 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 # 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 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 echo $target
case "$target" in case "$target" in
"msm8916_32") "msm8916_32")
@ -247,19 +231,17 @@ esac
# Add support for exposing lun0 as cdrom in mass-storage # Add support for exposing lun0 as cdrom in mass-storage
# #
cdromname="/system/etc/cdrom_install.iso" cdromname="/system/etc/cdrom_install.iso"
platformver=`cat /sys/devices/soc0/hw_platform`
case "$target" in case "$target" in
"msm8226" | "msm8610") "msm8226" | "msm8610" | "msm8916" | "msm8916_32" | "msm8916_64")
case "$cdromenable" in case $platformver in
1) "QRD")
echo "mounting usbcdrom lun" echo "mounting usbcdrom lun"
if [ ! -f /sys/class/android_usb/android0/f_mass_storage/lun0/file ]; then echo $cdromname > /sys/class/android_usb/android0/f_mass_storage/rom/file
sleep 2 # cdrom lun still not created. give some time. chmod 0444 /sys/class/android_usb/android0/f_mass_storage/rom/file
fi ;;
echo $cdromname > /sys/class/android_usb/android0/f_mass_storage/lun0/file esac
chmod 0444 /sys/class/android_usb/android0/f_mass_storage/lun0/file ;;
;;
esac
;;
esac esac
# #