Add support for Huawei's phone.prop

Reference is https://github.com/LineageOS/android_device_huawei_kirin970-common/blob/lineage-16.0/init/init_kirin970.cpp
This commit is contained in:
Pierre-Hugues Husson 2019-12-09 00:54:05 +01:00
parent 897f17c554
commit 8a6837d774

View File

@ -456,3 +456,11 @@ done
if [ "$has_hostapd" = false ];then if [ "$has_hostapd" = false ];then
setprop persist.sys.phh.system_hostapd true setprop persist.sys.phh.system_hostapd true
fi fi
#Weird /odm/phone.prop Huawei stuff
if [ -f /odm/phone.prop ];then
HW_PRODID="$(sed -nE 's/.*productid=([0-9x]*).*/\1/p' /proc/cmdline)"
if [ -n "$HW_PRODID" ];then
eval "$(awk 'BEGIN { a=0 }; /\[.*\].*/ { a=0 }; tolower($0) ~ /.*0x39606014.*/ { a=1 }; /.*=.*/ { if(a == 1) print $0 }' /odm/phone.prop |sed -nE 's/(.*)=(.*)/setprop \1 "\2";/p')"
fi
fi