sanders: init: read hardware revision from ro.boot.hwrev
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user