sanders: init: read hardware revision from ro.boot.hwrev
This commit is contained in:
@@ -5,33 +5,9 @@ export PATH
|
|||||||
|
|
||||||
scriptname=${0##*/}
|
scriptname=${0##*/}
|
||||||
|
|
||||||
notice()
|
# We take this from cpuinfo because hex "letters" are lowercase there - (lolwhat)
|
||||||
{
|
cinfo=`getprop ro.boot.hwrev`
|
||||||
echo "$*"
|
hw=${cinfo#???}
|
||||||
echo "$scriptname: $*" > /dev/kmsg
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
start_copying_prebuilt_qcril_db()
|
|
||||||
{
|
|
||||||
if [ -f /system/vendor/qcril.db -a ! -f /data/misc/radio/qcril.db ]; then
|
|
||||||
cp /system/vendor/qcril.db /data/misc/radio/qcril.db
|
|
||||||
chown -h radio.radio /data/misc/radio/qcril.db
|
|
||||||
else
|
|
||||||
# [MOTO] if qcril.db's owner is not radio (e.g. root),
|
|
||||||
# reset it for the recovery
|
|
||||||
qcril_db_owner=`stat -c %U /data/misc/radio/qcril.db`
|
|
||||||
echo "qcril.db's owner is $qcril_db_owner"
|
|
||||||
if [ $qcril_db_owner != "radio" ]; then
|
|
||||||
echo "reset owner to radio for qcril.db"
|
|
||||||
chown -h radio.radio /data/misc/radio/qcril.db
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# We take this from cpuinfo because hex "letters" are lowercase there
|
|
||||||
set -A cinfo `cat /proc/cpuinfo | /system/bin/grep Revision`
|
|
||||||
hw=${cinfo[2]#?}
|
|
||||||
|
|
||||||
# Now "cook" the value so it can be matched against devtree names
|
# Now "cook" the value so it can be matched against devtree names
|
||||||
m2=${hw%?}
|
m2=${hw%?}
|
||||||
@@ -44,7 +20,12 @@ if [ "$minor2" == "0" ]; then
|
|||||||
minor1=""
|
minor1=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
setprop ro.boot.hardware.revision p${hw%??}$minor1$minor2
|
|
||||||
|
rev="p${hw%??}$minor1$minor2"
|
||||||
|
rev2=`echo $rev | tr '[:upper:]' '[:lower:]'`
|
||||||
|
|
||||||
|
setprop ro.boot.hardware.revision $rev2
|
||||||
|
setprop ro.hw.revision $rev2
|
||||||
unset hw cinfo m1 m2 minor1 minor2
|
unset hw cinfo m1 m2 minor1 minor2
|
||||||
|
|
||||||
# Let kernel know our image version/variant/crm_version
|
# Let kernel know our image version/variant/crm_version
|
||||||
@@ -63,9 +44,4 @@ if [ -f /sys/devices/soc0/select_image ]; then
|
|||||||
echo $oem_version > /sys/devices/soc0/image_crm_version
|
echo $oem_version > /sys/devices/soc0/image_crm_version
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# Copy qcril.db if needed for RIL
|
|
||||||
#
|
|
||||||
start_copying_prebuilt_qcril_db
|
|
||||||
echo 1 > /data/misc/radio/db_check_done
|
|
||||||
|
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ on property:ro.boot.dualsim=false
|
|||||||
setprop persist.radio.multisim.config ""
|
setprop persist.radio.multisim.config ""
|
||||||
setprop ro.telephony.default_network 10
|
setprop ro.telephony.default_network 10
|
||||||
|
|
||||||
|
on property:ro.boot.hwrev=*
|
||||||
|
start mmi-boot-sh
|
||||||
|
|
||||||
service adspd /system/vendor/bin/adspd
|
service adspd /system/vendor/bin/adspd
|
||||||
class main
|
class main
|
||||||
socket adspdsock stream 0660 system audio
|
socket adspdsock stream 0660 system audio
|
||||||
@@ -263,16 +266,7 @@ service mmi-boot-sh /system/vendor/bin/init.mmi.boot.sh
|
|||||||
class core
|
class core
|
||||||
user root
|
user root
|
||||||
oneshot
|
oneshot
|
||||||
|
disabled
|
||||||
service mmi-touch-sh /system/vendor/bin/init.mmi.touch.sh
|
|
||||||
class core
|
|
||||||
user root
|
|
||||||
oneshot
|
|
||||||
|
|
||||||
service oem-hw-sh /system/vendor/bin/init.oem.hw.sh
|
|
||||||
class core
|
|
||||||
user root
|
|
||||||
oneshot
|
|
||||||
|
|
||||||
# Sanders uses qcom sensor service
|
# Sanders uses qcom sensor service
|
||||||
service sensors /system/vendor/bin/sensors.qcom
|
service sensors /system/vendor/bin/sensors.qcom
|
||||||
|
|||||||
Reference in New Issue
Block a user