majestic: ship the eula, and ask the first login to accept it - #2346
Conversation
The three language texts land at /usr/share/openipc/eula/ through the majestic package's late overlay, so a majestic-free image carries no license for software it does not have -- and both claim doors key on the files' presence, so such an image keeps today's flow exactly. openipc-claim shows the English text before the passwd loop and requires the words "I agree", typed; majestic's setup page shows it in the visitor's language and enforces the matching checkbox server-side. Whichever door claims records version, language, door and time in /etc/eula-accepted, informationally -- /etc/shadow stays the single record of the claim, and both die together on firstboot.
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 describe a rule in plain language on the Rules page and Qodo drafts it for you |
PR Summary by QodoGate Majestic first-boot claims on EULA acceptance
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Aligned with the review fix on the majestic side: a regular, non-empty, readable file, so a stray overlay directory or a truncated overlay write at the eula path cannot demand acceptance of nothing.
libsvpruntime.so (617 KB) and libnnie.so shipped on all four cv500-family boards with zero consumers: a DT_NEEDED sweep over every ELF in the 2026-08-31 nightly images of hi3516av300 lite/neo, hi3516cv500_lite and hi3516dv300_lite finds no linker and no dlopen-style string reference, load_hisilicon's open_nnie lines are commented out, and libsvpruntime needs the libstdc++ that rootfs_script.sh prunes, so it could not even load on most builds. That is ~215 KB of squashfs per board -- and the reason hi3516av300_neo sat 12 KB from its 8192 KB cap and tipped over when the eula landed. Measured after: 8008 KB, 184 KB of headroom.
|
The first matrix run failed on exactly one board: Fixed in 2664df5 by removing While sizing this I also found the cv500 family ships every |
…2350) Post-merge review on #2346: the refusal an unclaimed camera gives a non-interactive SSH attempt pointed at http://<hostname>/, a name only the camera itself resolves, so pasting it into a browser went nowhere. Whoever hit that refusal reached the camera over SSH, and dropbear records the address they used in SSH_CONNECTION's third field -- the one address their network provably routes. The hostname stays as the fallback for a local exec with no connection to read, and an IPv6 literal gets brackets in the URL alone: a browser wants them, ssh refuses them. Verified on the hi3516ev300 lab bench, reset to the unclaimed state: the refusal prints the reached address whether the camera is reached by IP or by DNS name.
Problem
Phase 2 of the first-boot claim flow (#2342). Majestic is licensed software (free forever
for personal and noncommercial use), and its new EULA v1.0 (en/ru/zh-CN, 2026-09-01) must
be read and accepted by the camera's human owner at the same moment they set the first
password — at either door. Today the image carries no license text and neither claim door
asks.
What this does
/usr/share/openipc/eula/eula.<lang>.txtthroughgeneral/package/majestic/overlay, keyed onBR2_PACKAGE_MAJESTICingeneral/scripts/late-overlays.list— a majestic-free image carries no license forsoftware it does not have, and both gates key on the files' presence, so such an
image behaves exactly as today. (First live use of the late-overlay mechanism; verified
in the built rootfs below.)
openipc-claimgains the gate in front of the passwd loop, only while the document ison the image: short summary,
viewto read the full text, the exact wordsI agreetoaccept (five misses give up; decline leaves the camera unclaimed and streaming
nothing), the same claimed-elsewhere race check the passwd loop carries. All
user-visible text is heredoc, so it survives comment-stripping — including a notice that
AI agents and automation must not accept on a person's behalf.
/etc/eula-accepted(<version> <lang> <door> <utc>),informational only;
/etc/shadowstays the single record of the claim, and both dietogether on
firstboot.acceptance; removing majestic from an image entirely is always legitimate).
Pairs with widgetii/majestic#530 (serves
/eula.<lang>.txtpre-auth with an explicitutf-8 charset and enforces
eula=acceptedinPOST /setupiff the document is present)and OpenIPC/majestic-webui#283 (
setup.htmlshows the text by browser language and poststhe checkbox). Landing order is majestic → webui → this, same as phase 1 — do not merge
before both are merged and their artifacts republished, or images pair the documents
with a majestic that cannot enforce the browser door (the SSH door still works, and the
new page degrades cleanly either way).
Hardware tested on
hi3516ev300, imx335 lab bench camera, flashed with the exact image from this branch
(
openipc.hi3516ev300-nor-lite.tgz,local+build, 2026-09-01) viasysupgrade --url.The unclaimed state was reproduced with
/rom/etc/{passwd,shadow}copied over the liveoverlay copies. The browser-door enforcement half lives in majestic and is covered by that
PR's unit tests; this image's majestic (current published tarball) was used to confirm the
old-majestic rows of the pairing matrix.
Evidence
Before (nightly
master+bebd80a, same camera):After — shipped rootfs:
After — decline (
viewshown full text first;/still 302 → setup.html afterwards):After — exact phrase enforced (
i agree,I AGREE,yes,agree,ok×5 → give up):After — claimed from the browser (
POST /setup→ 200) while the SSH gate sat at theEULA prompt, then
I agreetyped:After — accept:
Majestic-free control build (
gk7205v500_lite,# BR2_PACKAGE_MAJESTIC is not set): no/usr/share/openipc/eula, no majestic binary, the gate ships dormant and the login flowis byte-for-byte the phase-1 conversation. Size-critical
hi3519v101_lite: rootfs4736KB/5120KB, no headroom warning.
Script checks:
test_shell_parse.sh(134 scripts clean),STRICT=1 test_strip_shell_comments.sh(parses identically stripped; the heredoc notices survive),ci-matrix.py --self-test,test_sysupgrade.sh,test_excludes_report.sh,test_load_hisilicon.sh— all green.ci-matrix --stdinwidens this diff to all 99boards, as a shared-overlay change should.
Scope
general/package/all-patches/linux/(those go to OpenIPC/linux)general/overlay/or in a sharedload_<vendor>script hardcodes a value specific to my boardLD_PRELOAD, and no binaries that cannot be rebuilt from source