feat(os-update): add generic 'os_update' pre-reboot event for plugins (OS-486)#2683
feat(os-update): add generic 'os_update' pre-reboot event for plugins (OS-486)#2683elibosley wants to merge 3 commits into
Conversation
Add a generic, self-registering os_update event dispatched via emhttp_event. unRAIDServer.plg fires it after the new release files (incl. changes.txt) are on the flash but before the reboot prompt, passing the incoming Unraid version and kernel release. Driver plugins can drop an event/os_update hook to stage a kernel-matched build pre-reboot, replacing the hardcoded third-party helper detection. Additive and backward compatible. OS-486
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe upgrade script now derives a kernel version from ChangesOS update event emission
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
…river-only The mechanism already runs any plugin's event/os_update; clarify in the unRAIDServer.plg comment and emhttp_event docs that it is a general pre-reboot OS-update hook (config migration, backups, compat checks, driver staging), with version/kernel passed as optional context. No behavior change. OS-486
Wrap the synchronous os_update event dispatch in 'timeout 300' so a wedged third-party hook cannot stall the OS update indefinitely. Document the self-background escape hatch for hooks that need long/async work. OS-486
Replace the per-boot-only download with an event/os_update hook that fires during an Unraid OS update, before the reboot prompt, and stages the rtw88 bundle matching the incoming kernel ($3) - so a reboot never lands on a kernel without a WiFi driver. Alerts if no build is published. Synchronous, so the update's reboot prompt only appears once WiFi is ready. Consumer of webgui os_update event (OS-486 / unraid/webgui#2683). On Unraid releases without the event there is no pre-reboot staging; the boot-time installer fetches the driver after reboot as before. Bump to 2026.06.27.3.
Why
When Unraid updates the OS, the new release ships a new kernel but the box keeps running the old one until reboot. Out-of-tree driver plugins (WiFi, GPU, NIC, …) build per-kernel modules, so a reboot can land on a kernel with no matching driver — fatal for, e.g., a headless server whose only link is a USB WiFi adapter.
Today the only mitigation is hardwired in
unRAIDServer.plg: it greps for a runninginotifywait -q /boot/changes.txt …process and, if found, force-downloads + runs ich777'splugin_update_helper, which carries a hardcoded list of ~22 supported plugins and is not extensible.What
Add a generic, self-registering
os_updateevent, dispatched through the existingemhttp_eventmechanism:unRAIDServer.plgfiresos_updateafter the new release files (incl.changes.txt) are on the flash but before the reboot prompt, passing the incoming Unraid version ($2) and kernel release ($3,uname -rform parsed fromchanges.txt).sbin/emhttp_eventdocuments the new event.Any plugin can then drop an executable at
…/event/os_updateto stage a kernel-matched build. Hooks run synchronously, so "PLEASE REBOOT" only appears once they finish — no separate "wait for a notification" gate.Notes
inotifywaitdetection and messaging are untouched.wget … | at nowof ich777's helper.unraid-rtl8821audriver plugin migrates toevent/os_update(separate repo).Test
xmllintclean onunRAIDServer.plg;bash -nclean on the resolved install block andemhttp_event.changes.txt→emhttp_event os_update→ sampleevent/os_updatehook receives(os_update, <version>, 6.19.2-Unraid); plugins without the hook are skipped.Resolves OS-486.
Summary by CodeRabbit
New Features
os_updateevent so supporting components can prepare before the system restarts.Bug Fixes
Documentation
os_updateevent timing and arguments.