sanders: init: read hardware revision from ro.boot.hwrev

This commit is contained in:
Vachounet
2018-01-08 15:44:27 +01:00
committed by therootlord
parent 9d679e3f8d
commit 27a5f54f17
2 changed files with 13 additions and 43 deletions

View File

@@ -5,33 +5,9 @@ export PATH
scriptname=${0##*/}
notice()
{
echo "$*"
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]#?}
# We take this from cpuinfo because hex "letters" are lowercase there - (lolwhat)
cinfo=`getprop ro.boot.hwrev`
hw=${cinfo#???}
# Now "cook" the value so it can be matched against devtree names
m2=${hw%?}
@@ -44,7 +20,12 @@ if [ "$minor2" == "0" ]; then
minor1=""
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
# 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
fi
#
# Copy qcril.db if needed for RIL
#
start_copying_prebuilt_qcril_db
echo 1 > /data/misc/radio/db_check_done

View File

@@ -248,6 +248,9 @@ on property:ro.boot.dualsim=false
setprop persist.radio.multisim.config ""
setprop ro.telephony.default_network 10
on property:ro.boot.hwrev=*
start mmi-boot-sh
service adspd /system/vendor/bin/adspd
class main
socket adspdsock stream 0660 system audio
@@ -263,16 +266,7 @@ service mmi-boot-sh /system/vendor/bin/init.mmi.boot.sh
class core
user root
oneshot
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
disabled
# Sanders uses qcom sensor service
service sensors /system/vendor/bin/sensors.qcom