[T31] save sensor to env

pull/329/head
Dmitry Ermakov 2022-08-11 08:10:50 +03:00
parent 0b0910866c
commit df98aa91c3
1 changed files with 12 additions and 6 deletions

View File

@ -24,13 +24,19 @@ if [ $? -ne 0 ]; then
check_return "insmod sinfo"
fi
if fw_printenv -n sensor >/dev/null; then
export SENSOR=$(fw_printenv -n sensor)
logger -s -p daemon.info -t ingenic "Get data from environment and set SENSOR as ${SENSOR}"
else
echo 1 >/proc/jz/sinfo/info
check_return "start sinfo"
SENSOR_INFO=$(cat /proc/jz/sinfo/info)
check_return "get sensor type"
SENSOR=${SENSOR_INFO#*:}
logger -s -p daemon.info -t ingenic "Get data from sinfo and set SENSOR as ${SENSOR}"
fw_setenv sensor $SENSOR && logger -s -p daemon.info -t ingenic "Write detected ${SENSOR} to U-Boot ENV"
fi
case ${SENSOR} in
"sc2232")