Repository navigation
sysupgrade: a boot that never finished no longer blocks the update - #2797
Merged
Merged
Conversation
busybox init reads its signals only between inittab stages, and the sysinit stage lasts until rcS exits. A foreground loop in /etc/rc.local keeps rcS alive, so the SIGQUIT that hands PID 1 to the RAM root is never read. The updater waits 30 s and reboots with nothing written, and every later attempt does the same. Just before the signal, say so and end PID 1's rcS child. init is waiting on that pid alone, so it moves on and takes the signal. What rcS left running would have been killed by the hand-off anyway. The 30 s guard and its reboot stay as the backstop.
openipc-ai
requested review from
cronyx,
flyrouter and
viktorxda
as code owners
November 8, 2026 12:47
PR Summary by QodoAllow sysupgrade handoff when boot scripts are stuck
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Report. An upgrade fails with
PID 1 did not hand over; rebooting (nothing was flashed)on a camera whose/etc/rc.localruns a script in the foreground, and fails the same way every time.Cause. busybox init processes signals only after
run_actions(SYSINIT)returns, and that lasts untilrcSexits. A foreground loop inrc.localholds the hand-off's SIGQUIT unread, so the updater waits outhandoff_waitand reboots.Change.
release_boot_scripts()runs just beforekill -QUIT 1: if PID 1 still has anrcSchild, it says so in one line and ends it. init is waiting on that pid alone, so it reaches the signal, and the hand-off kills whateverrcSleft running. The 30 s guard stays as the backstop. Refusing the update instead would leave the owner still unable to update, and an in-place write is what the hand-off exists to avoid.scr_versiongoes to 1.0.84 so CLI runs self-update to this.On hardware (hi3516av300, split NOR, with
while :; do sleep 1; doneinrc.local):Firmware updatedandUnconditional reboot, and the camera rebooted.That run reinstalled the same build, so the evidence is the updater's log and the reboot, not a version change.
The WebUI's Install runs the updater already on the camera, so it gets this fix only from a firmware that includes it.
.github/scripts/test_sysupgrade.shhas two new checks and passes.