diff --git a/general/package/goke-osdrv-gk7205v200/files/script/load_goke b/general/package/goke-osdrv-gk7205v200/files/script/load_goke index ed8b69067d..0759e5fd18 100755 --- a/general/package/goke-osdrv-gk7205v200/files/script/load_goke +++ b/general/package/goke-osdrv-gk7205v200/files/script/load_goke @@ -455,6 +455,16 @@ if [ $# -lt 1 ]; then fi if [ $b_arg_insmod -eq 1 ]; then + # A failed probe used to be stored as sensor=unknown, and rcS exports the + # stored value into SENSOR before this ever runs -- so an already-latched + # camera arrives here with SENSOR=unknown, takes the "set manually" branch + # below, and never probes again however the real fault is fixed. Treat it + # as unset and drop it from the environment so this boot re-detects. #2428. + if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor + fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t goke "SENSOR: ${SENSOR}" else @@ -467,7 +477,15 @@ if [ $b_arg_insmod -eq 1 ]; then export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t goke "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t goke "Writing ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t goke "Writing ${SENSOR} to U-Boot ENV" + fi fi fi fi diff --git a/general/package/goke-osdrv-gk7205v500/files/script/load_goke b/general/package/goke-osdrv-gk7205v500/files/script/load_goke index e7b4fce8c8..df8f0246d5 100755 --- a/general/package/goke-osdrv-gk7205v500/files/script/load_goke +++ b/general/package/goke-osdrv-gk7205v500/files/script/load_goke @@ -267,6 +267,16 @@ if [ $# -lt 1 ]; then fi if [ $b_arg_insmod -eq 1 ]; then + # A failed probe used to be stored as sensor=unknown, and rcS exports the + # stored value into SENSOR before this ever runs -- so an already-latched + # camera arrives here with SENSOR=unknown, takes the "set manually" branch + # below, and never probes again however the real fault is fixed. Treat it + # as unset and drop it from the environment so this boot re-detects. #2428. + if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor + fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t goke "SENSOR: ${SENSOR}" else @@ -279,7 +289,15 @@ if [ $b_arg_insmod -eq 1 ]; then export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t goke "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t goke "Writing ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t goke "Writing ${SENSOR} to U-Boot ENV" + fi fi fi fi diff --git a/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia b/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia index 2d94692720..700134f289 100755 --- a/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia +++ b/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia @@ -21,6 +21,16 @@ if [ "$chipid" != "8136" ] && [ "$chipid" != "8135" ]; then exit fi +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t grainmedia "Manualy set SENSOR as ${SENSOR}" else @@ -32,7 +42,15 @@ else SENSOR_DETECT=$(ipcinfo --short-sensor) export SENSOR=${SENSOR_DETECT:=unknown} logger -s -p daemon.info -t grainmedia "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t grainmedia "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t grainmedia "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon index f470d55b1f..1d10ded6cc 100755 --- a/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon @@ -453,6 +453,16 @@ fi # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -466,7 +476,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon index ca995d836f..bd67910f99 100755 --- a/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon @@ -436,6 +436,16 @@ calc_mmz_info # Sensor config # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -449,7 +459,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon index 7975af7c2e..9c05e638da 100755 --- a/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon @@ -490,6 +490,16 @@ fi # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -503,7 +513,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon index 5aba07614d..bfc25d8d8f 100755 --- a/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon @@ -581,6 +581,16 @@ fi # Sensor config # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -594,7 +604,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon index 575875e035..961facab31 100755 --- a/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon @@ -394,6 +394,16 @@ fi # Sensor config # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -407,7 +417,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon index 795b5e4e0b..36670aa183 100755 --- a/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon @@ -349,6 +349,16 @@ fi calc_mmz_info +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -362,7 +372,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon index e601b21e6c..0db48ae77b 100755 --- a/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon @@ -394,6 +394,16 @@ fi # Sensor config # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -407,7 +417,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon index 5318b311a7..26d4c8e12a 100755 --- a/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon @@ -349,6 +349,16 @@ fi calc_mmz_info +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -362,7 +372,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon index 90222c01b2..66c00dab53 100755 --- a/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon @@ -895,6 +895,16 @@ fi # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t hisilicon "Manualy set SENSOR as ${SENSOR}" else @@ -908,7 +918,15 @@ else export SENSOR=${SENSOR_DETECT:=unknown} remove_detect logger -s -p daemon.info -t hisilicon "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t hisilicon "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi diff --git a/general/package/novatek-osdrv-nt9856x/files/script/load_novatek b/general/package/novatek-osdrv-nt9856x/files/script/load_novatek index 9bcd1b5cd5..1ab7584223 100755 --- a/general/package/novatek-osdrv-nt9856x/files/script/load_novatek +++ b/general/package/novatek-osdrv-nt9856x/files/script/load_novatek @@ -159,6 +159,16 @@ insert_ko # SENSOR=${SENSOR:=imx307} # +# A failed probe used to be stored as sensor=unknown, and rcS exports the +# stored value into SENSOR before this ever runs -- so an already-latched +# camera arrives here with SENSOR=unknown, takes the "set manually" branch +# below, and never probes again however the real fault is fixed. Treat it +# as unset and drop it from the environment so this boot re-detects. #2428. +if [ "$SENSOR" = "unknown" ]; then + SENSOR= + fw_setenv sensor +fi + if [ -n "$SENSOR" ]; then logger -s -p daemon.info -t novatek "Manualy set SENSOR as ${SENSOR}" else @@ -171,7 +181,15 @@ else SENSOR_DETECT=$(ipcinfo --short-sensor) export SENSOR=${SENSOR_DETECT:=unknown} logger -s -p daemon.info -t novatek "Get data from ipcinfo and set SENSOR as ${SENSOR}" - fw_setenv sensor $SENSOR && logger -s -p daemon.info -t novatek "Write detected ${SENSOR} to U-Boot ENV" + # Do not persist a failed detection. The fw_printenv branch above wins + # whenever `sensor` exists, so writing "unknown" here latches the camera + # into "SENSOR is not detected, aborting..." for good -- detection never + # runs again and nothing says why. Seen on a GK7202V500 in #2428. + # load_ingenic has always cleared the variable instead of storing the + # miss; this is the same behaviour, reached by not writing at all. + if [ "$SENSOR" != "unknown" ]; then + fw_setenv sensor $SENSOR && logger -s -p daemon.info -t novatek "Write detected ${SENSOR} to U-Boot ENV" + fi fi fi