Skip to content

majestic-webui: the Live PTZ Suite goes with the rest of PTZ on images without a motor - #2904

Merged
dimerr merged 2 commits into
masterfrom
webui-ptz-fixup-new-files
Nov 19, 2026
Merged

dimerr merged 2 commits into
masterfrom
webui-ptz-fixup-new-files

Conversation

@dimerr

@dimerr dimerr commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Problem

The ssc377, ssc377d, ssc377de, ssc377qe, ssc378de and ssc378qe lite builds fail on every PR:

- rootfs.squashfs: [5144KB/5120KB]
-- size exceeded by: 24KB

The last nightly that published them is 4cc6476 (Nov 15), with the ssc377d rootfs at 5108 KB. The Nov 16 nightly no longer had them.

None of the firmware commits in between account for the growth. It comes from the web UI, which the build downloads from the dist release each time. OpenIPC/majestic-webui#722 (Live PTZ Suite, merged Nov 16) added presets, Box PTZ, AF peaks and AF triggers. MAJESTIC_WEBUI_PTZ_FIXUP doesn't know these files, so they ship on every image without a motor:

File Bytes
a/preview-ptz-presets.js 42,093
cgi-bin/j/ptz_presets.cgi 19,364
a/preview-af-peaks.js 12,621
a/preview-box-ptz.js 12,224
cgi-bin/j/box_ptz.cgi 5,813
cgi-bin/j/af_candidates.cgi 4,442
cgi-bin/p/ptz_common.sh 4,343
cgi-bin/j/af_triggers.cgi 4,125

Comparison of the ssc377d web tree after the fixups (no PTZ/SMS/counting/FPV), as xz squashfs at 128K blocks:

  • Nov 15 nightly: 384 KB
  • current dist: 416 KB
  • current dist with this change: 388 KB

majestic itself grew by 116 bytes over the same period.

Change

Add the eight files to MAJESTIC_WEBUI_PTZ_FIXUP.

  • The three scripts load only from p/motor.cgi, which the fixup already empties.
  • The CGIs are called only by those scripts and by preview-ptz.js, which is already removed. ptz_common.sh is sourced only by the PTZ CGIs.
  • The settings page fetches af_triggers.cgi and takes a failed request as no triggers.

Images with BR2_PACKAGE_MAJESTIC_WEBUI_PTZ (gpio-motors or majestic-af) are unaffected.

The comment saying sbin/updatewebui lists the same paths is dropped: the current updatewebui no longer does.

Note

That estimate leaves ssc377d at about 5116 of 5120 KB, so the next few KB of growth will break it again. a/mj-settings.js alone grew 11 KB in #722 and #727.

…s without a motor

majestic-webui #722 added presets, Box PTZ, AF peaks and AF triggers to the
Live page. Their scripts load only from p/motor.cgi, which the PTZ fixup
already empties, and their CGIs only steer the motor or the autofocus, but
the fixup did not know the new files, so every image without a motor
carried them: about 30 KB of xz, which took the ssc377/ssc378 lite rootfs to
5144 KB of 5120 and failed those builds since the Nov 16 nightly.

Remove them with the rest of PTZ. The settings page that reads
af_triggers.cgi takes a failed request as no triggers. The note that
sbin/updatewebui lists the same paths is dropped: it no longer does.

Co-authored-by: OpenIPC AI team <ai@openipc.org>
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Exclude Live PTZ Suite files from motorless WebUI images

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Remove eight unused Live PTZ Suite files from images without motor support.
• Restore ssc377/ssc378 lite builds that exceeded their 5120 KB rootfs limit.
• Leave PTZ-enabled images unchanged and correct the outdated updatewebui comment.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The added files are all parts of one end-to-end PTZ WebUI behavior: the suite is loaded through p/motor.cgi and its handlers steer the motor or autofocus.
  • They share the same PTZ gate and user outcome, so the scripts and CGIs are implementation hops of one bounded capability rather than independent capabilities.
Sources

general/package/majestic-webui/majestic-webui.mk[120-130]

	rm -f $(TARGET_DIR)/var/www/a/ptz-orient.js
	rm -f $(TARGET_DIR)/var/www/a/af-state.js
	[ ! -e $(TARGET_DIR)/var/www/cgi-bin/p/motor.cgi ] || : >$(TARGET_DIR)/var/www/cgi-bin/p/motor.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/ptz.cgi
	rm -f $(TARGET_DIR)/var/www/a/preview-ptz-presets.js
	rm -f $(TARGET_DIR)/var/www/a/preview-box-ptz.js
	rm -f $(TARGET_DIR)/var/www/a/preview-af-peaks.js
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/ptz_presets.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/box_ptz.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/af_candidates.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/af_triggers.cgi
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, the PTZ-disabled fixup removed the established core PTZ assets.
  • After, it removes additional suite-specific assets under the same existing option gate.
  • The new correctness condition is that every Live PTZ asset must be omitted whenever the PTZ capability is disabled; this is a direct file-to-gate mapping, not a new algorithm, concurrency protocol, state transition, or compatibility transformation.
  • The source also says the affected scripts are loaded through p/motor.cgi and the handlers only steer motor/autofocus, which bounds the intended behavior.
Sources

general/package/majestic-webui/majestic-webui.mk[120-130]

	rm -f $(TARGET_DIR)/var/www/a/ptz-orient.js
	rm -f $(TARGET_DIR)/var/www/a/af-state.js
	[ ! -e $(TARGET_DIR)/var/www/cgi-bin/p/motor.cgi ] || : >$(TARGET_DIR)/var/www/cgi-bin/p/motor.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/ptz.cgi
	rm -f $(TARGET_DIR)/var/www/a/preview-ptz-presets.js
	rm -f $(TARGET_DIR)/var/www/a/preview-box-ptz.js
	rm -f $(TARGET_DIR)/var/www/a/preview-af-peaks.js
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/ptz_presets.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/box_ptz.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/af_candidates.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/af_triggers.cgi
Potential damage 🟡 Medium 🩹 Temporary loss

  • The plausible failure is loss of a bounded PTZ WebUI capability, not data corruption or an effect on unrelated pages.
  • Reverting the package change alone restores the deletion commands but does not restore files already omitted from an image; rebuilding or reinstalling the WebUI with PTZ enabled is required.
  • No persistent state or external side effect is created by these rm commands.
  • Recoverable by rebuilding the image with BR2_PACKAGE_MAJESTIC_WEBUI_PTZ enabled or reinstalling the complete WebUI assets.
  • Recovery prerequisites are access to a matching WebUI distribution and a profile whose PTZ capability is intentionally enabled; no automatic repair path was established.
Sources

general/package/majestic-webui/majestic-webui.mk[120-130]

	rm -f $(TARGET_DIR)/var/www/a/ptz-orient.js
	rm -f $(TARGET_DIR)/var/www/a/af-state.js
	[ ! -e $(TARGET_DIR)/var/www/cgi-bin/p/motor.cgi ] || : >$(TARGET_DIR)/var/www/cgi-bin/p/motor.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/ptz.cgi
	rm -f $(TARGET_DIR)/var/www/a/preview-ptz-presets.js
	rm -f $(TARGET_DIR)/var/www/a/preview-box-ptz.js
	rm -f $(TARGET_DIR)/var/www/a/preview-af-peaks.js
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/ptz_presets.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/box_ptz.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/af_candidates.cgi
	rm -f $(TARGET_DIR)/var/www/cgi-bin/j/af_triggers.cgi
Assessed commit 9aef7c0
Diagram

graph TD
  dist["WebUI dist"] --> install["Install WebUI"] --> option{"PTZ enabled?"} -->|Yes| keep["Keep PTZ files"]
  option -->|No| prune["PTZ fixup"] --> rootfs["Smaller rootfs"]
Loading
High-Level Assessment

Extending the existing PTZ fixup is the most direct way to keep motorless images small without changing PTZ-enabled builds. Pinning an older WebUI distribution would avoid the immediate growth but also defer unrelated WebUI changes; it would not address future PTZ files.

Files changed (1) +16 / -3

Bug fix (1) +16 / -3
majestic-webui.mkPrune Live PTZ Suite files when PTZ is disabled +16/-3

Prune Live PTZ Suite files when PTZ is disabled

• Adds three scripts and five CGI or shell files to the existing PTZ removal fixup, addressing rootfs overflow on motorless lite builds. Updates the comment to explain the removal and drops an outdated claim about updatewebui.

general/package/majestic-webui/majestic-webui.mk

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. A removed cross-repo contract note may let WebUI updates restore files 🐞 Bug ⚙ Maintainability
Description
The PR deletes the comment that records that the WebUI's sbin/updatewebui lists the same eight
paths, on the strength of the claim that the current updatewebui no longer does. This repository has
no majestic-webui sources, so nothing in the tree checks that claim, and the surrounding FPV and SMS
fixups in the same file still document the same image-versus-updatewebui agreement as a hard rule.
Code

general/package/majestic-webui/majestic-webui.mk[L98-100]

-# two by default. The same eight paths are listed in the WebUI's
-# sbin/updatewebui, which installs them only where the image carries
-# /usr/bin/gpio-motors or /usr/lib/majestic-af.so.
+# two by default.
+#
+# The Live PTZ Suite (majestic-webui #722: presets, Box PTZ, AF peaks and
+# triggers) is PTZ too. Its scripts are loaded only from p/motor.cgi, and its
+# CGIs only steer the motor or the autofocus; the settings page that reads
+# af_triggers.cgi takes a failed request as no triggers. Left in, it was some
+# 30 KB of xz on every image without a motor, and took the ssc377 lite rootfs
+# past its 5120 KB.
Evidence
The removed comment is the only place in this file that tells a maintainer the PTZ fixup must agree
with the WebUI's updatewebui. The FPV fixup comment in the same file (around lines 74-80) states
that a mismatch means a deploy puts back a file the image deliberately left out. If updatewebui
still installs these paths on motor-less images, a later WebUI update would restore the Live PTZ
files this PR removes, and a reader would have no pointer to check.

general/package/majestic-webui/majestic-webui.mk[74-80]
general/package/majestic-webui/majestic-webui.mk[98-100]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
Issue description
The PR removes the comment in majestic-webui.mk that says the WebUI's sbin/updatewebui lists the same PTZ paths, relying on an unverified claim that updatewebui no longer does. The fixup and updatewebui must agree or a WebUI deploy can restore files the image removed.
Fix Focus Areas
- general/package/majestic-webui/majestic-webui.mk[95-117]
Recommended Fix
In the majestic-webui repository, confirm that sbin/updatewebui no longer installs the eight Live PTZ paths on images without a motor. Then restore a short comment in MAJESTIC_WEBUI_PTZ_FIXUP that names the WebUI commit or PR that made the change, so a future reader can re-check the contract.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

It does: the repo's sbin/updatewebui skips the PTZ files where the image
has no motor driver. The dist tarball carries only a stub of it, which is
what was read. Its list has ptz-orient.js, which the fixup lacked; the
Live PTZ Suite files are missing from it too (Qodo review).

Co-authored-by: OpenIPC AI team <ai@openipc.org>
@dimerr

dimerr commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9aef7c0

@dimerr
dimerr merged commit 78ad9d3 into master Nov 19, 2026
151 checks passed
@dimerr
dimerr deleted the webui-ptz-fixup-new-files branch November 19, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants