From a623254b4b47b33743a65b6809192d9e153c6691 Mon Sep 17 00:00:00 2001 From: AI Dev Date: Fri, 18 Sep 2026 19:31:35 +0000 Subject: [PATCH 1/2] load_*: stop a failed sensor detection latching the camera off for good A camera whose sensor is not detected on first boot never detects it again, however the underlying problem is fixed. Reported from a GK7202V500 in #2428, whose log shows the moment it happens: goke: Get data from ipcinfo and set SENSOR as unknown goke: Writing unknown to U-Boot ENV goke: SENSOR is not detected, aborting... The detect path stores whatever it found, and `unknown` is a value like any other. Every later boot takes the branch above it -- if fw_printenv -n sensor >/dev/null; then export SENSOR=$(fw_printenv -n sensor) -- reads `unknown` back, and aborts without running detection at all. Reseating the ribbon cable, fixing the bus, adding the missing driver: none of it helps, because nothing looks again. Nothing in the log says why, either; the second boot's output is identical to a camera that genuinely has no sensor. Guarding the write is the whole fix. This path is only reached when the variable was unset, so not writing leaves it unset and the next boot probes again. load_ingenic has always done this correctly -- on a miss it runs `unset SENSOR; fw_setenv sensor` and clears the variable rather than storing the miss -- so the six ingenic scripts are already right and are left alone. The other thirteen get the same behaviour by not writing at all. --- .../goke-osdrv-gk7205v200/files/script/load_goke | 10 +++++++++- .../goke-osdrv-gk7205v500/files/script/load_goke | 10 +++++++++- .../files/script/load_grainmedia | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../files/script/load_hisilicon | 10 +++++++++- .../novatek-osdrv-nt9856x/files/script/load_novatek | 10 +++++++++- 13 files changed, 117 insertions(+), 13 deletions(-) diff --git a/general/package/goke-osdrv-gk7205v200/files/script/load_goke b/general/package/goke-osdrv-gk7205v200/files/script/load_goke index ed8b69067d..29e34dc819 100755 --- a/general/package/goke-osdrv-gk7205v200/files/script/load_goke +++ b/general/package/goke-osdrv-gk7205v200/files/script/load_goke @@ -467,7 +467,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..48a20774e2 100755 --- a/general/package/goke-osdrv-gk7205v500/files/script/load_goke +++ b/general/package/goke-osdrv-gk7205v500/files/script/load_goke @@ -279,7 +279,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..82e769508b 100755 --- a/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia +++ b/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia @@ -32,7 +32,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..b725ecbfe1 100755 --- a/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon @@ -466,7 +466,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..b890dd917c 100755 --- a/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon @@ -449,7 +449,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..be000a6e9b 100755 --- a/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon @@ -503,7 +503,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..5c9fe3a9fa 100755 --- a/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon @@ -594,7 +594,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..a371ac071a 100755 --- a/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon @@ -407,7 +407,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..c2296f3f35 100755 --- a/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon @@ -362,7 +362,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..39571d1e7e 100755 --- a/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon @@ -407,7 +407,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..bb89e5ab26 100755 --- a/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon @@ -362,7 +362,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..7cc78a7156 100755 --- a/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon +++ b/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon @@ -908,7 +908,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..764984efff 100755 --- a/general/package/novatek-osdrv-nt9856x/files/script/load_novatek +++ b/general/package/novatek-osdrv-nt9856x/files/script/load_novatek @@ -171,7 +171,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 From fdd6d00a205f9a3f8307c8f366cf7226b8e9e001 Mon Sep 17 00:00:00 2001 From: AI Dev Date: Sat, 19 Sep 2026 04:32:49 +0000 Subject: [PATCH 2/2] load_*: clear a stale sensor=unknown before rcS's export can hide it The previous attempt at this put the recovery inside the branch reached when SENSOR is empty, which on a real camera is the one branch that never runs. /etc/init.d/rcS line 2 is export SENSOR=$(fw_printenv -n sensor) so by the time S70vendor calls load_ -i, an already-latched camera has SENSOR=unknown in its environment. The loader takes if [ -n "$SENSOR" ]; then logger ... "SENSOR: ${SENSOR}" logs the sentinel as a manually-set sensor, and the recovery below it is unreachable. The fix was inert on exactly the cameras it was written for. Clearing before that test, and blanking the shell variable as well as the stored one, puts the camera back on the detection path. Verified with the shipped block run under busybox ash, with fw_printenv / fw_setenv backed by a file and -- this time -- SENSOR exported from that file first, the way rcS does. The earlier harness set SENSOR= by hand, which is precisely why it reported a fix that could not work: A. latched camera, sensor now detectable before: boot1 SENSOR=unknown detection_runs=0 env=[sensor=unknown] after: boot1 SENSOR=sc2336 detection_runs=1 env=[sensor=sc2336] B. fresh camera, undetectable then detectable before: boot2 SENSOR=unknown detection_runs=1 env=[sensor=unknown] after: boot2 SENSOR=sc2336 detection_runs=2 env=[sensor=sc2336] C. working camera, sensor already stored before: boot1 SENSOR=sc2336 detection_runs=0 env=[sensor=sc2336] after: boot1 SENSOR=sc2336 detection_runs=0 env=[sensor=sc2336] C is the no-regression case and is byte-identical either side. Found by the Qodo review on #2442, which reviewed this branch's code against that PR. --- .../goke-osdrv-gk7205v200/files/script/load_goke | 10 ++++++++++ .../goke-osdrv-gk7205v500/files/script/load_goke | 10 ++++++++++ .../files/script/load_grainmedia | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../files/script/load_hisilicon | 10 ++++++++++ .../novatek-osdrv-nt9856x/files/script/load_novatek | 10 ++++++++++ 13 files changed, 130 insertions(+) diff --git a/general/package/goke-osdrv-gk7205v200/files/script/load_goke b/general/package/goke-osdrv-gk7205v200/files/script/load_goke index 29e34dc819..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 diff --git a/general/package/goke-osdrv-gk7205v500/files/script/load_goke b/general/package/goke-osdrv-gk7205v500/files/script/load_goke index 48a20774e2..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 diff --git a/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia b/general/package/grainmedia-osdrv-gm8136/files/script/load_grainmedia index 82e769508b..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 diff --git a/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516av100/files/script/load_hisilicon index b725ecbfe1..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 diff --git a/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv100/files/script/load_hisilicon index b890dd917c..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 diff --git a/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv200/files/script/load_hisilicon index be000a6e9b..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 diff --git a/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon index 5c9fe3a9fa..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 diff --git a/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv500/files/script/load_hisilicon index a371ac071a..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 diff --git a/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516cv6xx/files/script/load_hisilicon index c2296f3f35..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 diff --git a/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3516ev200/files/script/load_hisilicon index 39571d1e7e..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 diff --git a/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3519dv500/files/script/load_hisilicon index bb89e5ab26..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 diff --git a/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon b/general/package/hisilicon-osdrv-hi3519v101/files/script/load_hisilicon index 7cc78a7156..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 diff --git a/general/package/novatek-osdrv-nt9856x/files/script/load_novatek b/general/package/novatek-osdrv-nt9856x/files/script/load_novatek index 764984efff..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