From ae85f36fcb3f3e47231fe4549d3dbfec95d5876e Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 9 Dec 2019 00:54:05 +0100 Subject: [PATCH] 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 --- rw-system.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rw-system.sh b/rw-system.sh index 4a36fd5..d61f656 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -502,3 +502,11 @@ done if [ "$has_hostapd" = false ];then setprop persist.sys.phh.system_hostapd true 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