This repository has been archived on 2025-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
device_motorola_msm8953-common/rootdir/bin/init.mmi.boot.sh
jeangraff30 1220e128cd msm8953-common: Initial Common tree
* based on motorola sdm632-common

Co-authored-by: Jorg3Lucas <jorgelucas@pixelexperience.org>
2020-11-09 18:04:50 +01:00

47 lines
1.2 KiB
Bash

#!/vendor/bin/sh
PATH=/sbin:/vendor/bin
export PATH
scriptname=${0##*/}
# 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%?}
minor2=${hw#$m2}
m1=${m2%?}
minor1=${m2#$m1}
if [ "$minor2" == "0" ]; then
minor2=""
if [ "$minor1" == "0" ]; then
minor1=""
fi
fi
rev="p${hw%??}$minor1$minor2"
rev2=`echo $rev | tr '[:upper:]' '[:lower:]'`
setprop ro.boot.hardware.revision $rev2
unset hw cinfo m1 m2 minor1 minor2
# Let kernel know our image version/variant/crm_version
if [ -f /sys/devices/soc0/select_image ]; then
image_version="10:"
image_version+=`getprop ro.build.id`
image_version+=":"
image_version+=`getprop ro.build.version.incremental`
image_variant=`getprop ro.product.name`
image_variant+="-"
image_variant+=`getprop ro.build.type`
oem_version=`getprop ro.build.version.codename`
echo 10 > /sys/devices/soc0/select_image
echo $image_version > /sys/devices/soc0/image_version
echo $image_variant > /sys/devices/soc0/image_variant
echo $oem_version > /sys/devices/soc0/image_crm_version
fi