Skip to content

install-novatek: the first install from the vendor U-Boot, step by step - #616

Merged
widgetii merged 2 commits into
masterfrom
novatek-first-install
Oct 22, 2026
Merged

widgetii merged 2 commits into
masterfrom
novatek-first-install

Conversation

@widgetii

Copy link
Copy Markdown
Member

The Initial device firmware update section on this page has been a placeholder ("will be completed at the end of the research") followed by run uk; run ur; reset, which only works if uk and ur already exist. People keep asking how to flash these boards (OpenIPC/firmware#1496).

This adds:

  • What is supported: XM vendor boards with the nvt@na51089: prompt, 8 MB+ NOR, the three sensors the image drives (SC401AI, SC500AI, SC501AI), and the two published images. The NT98562 image is marked as not yet tested on a camera.
  • Step by step: a backup, where to get the archive, how to reach the prompt with zero boot delay, the full environment (soc, osmem, bootargs with the ${osmem} placeholder from install-novatek: keep osmem and mem= equal, with ${osmem} in bootargs #615, bootcmd, uk, ur), firstboot, and claiming the camera.
  • Follow-up updates: run uk; run ur; reset, or sysupgrade.

uk and ur chain every step with &&. In the form used so far (tftp ... && sf probe 0; sf erase ...; sf write ...), the && covers only sf probe. If the download fails in a session where the flash is already selected, for example run ur straight after run uk, the partition is still erased and an empty buffer written back. With the chained form, a failed download stops before anything is erased.

Verified on an NT98566 board with this vendor U-Boot:

  • the chained uk/ur flash the published image and the camera boots and streams;
  • with a missing file, run ur stops at the TFTP error and erases nothing.

Not covered: starting from the stock vendor firmware (verified from an existing OpenIPC install on the same U-Boot), and 16 MB flash.

Replace the "to be completed" note with what the images support, a backup step, the U-Boot environment that installs and boots them (osmem, bootargs with ${osmem}, bootcmd, uk, ur), firstboot and claiming the camera. In uk and ur every step is chained with &&, so a failed download stops before the flash is erased rather than writing an empty buffer over the partition.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Document safe first-time OpenIPC installation on Novatek boards

📝 Documentation 🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Define supported boards, sensors, flash sizes, images, and untested hardware.
Diagram

graph TD
  A["Back up flash"] --> B["TFTP images"] --> C["Configure U-Boot"] --> D["Run uk / ur"] -->|success| E[("NOR partitions")] --> F["Format settings"] --> G["Claim camera"]
  D -->|download fails; retry| B
Loading
High-Level Assessment

A step-by-step guide is appropriate for an installation that requires a UART console and board-specific U-Boot settings. Chaining download, probe, erase, and write in each flashing variable is preferable to the previous commands, which could erase a partition after a failed download.

Files changed (1) +46 / -6

Documentation (1) +46 / -6
install-novatek.mdAdd first-install instructions and failure-safe flash commands +46/-6

Add first-install instructions and failure-safe flash commands

• Replaces the placeholder with supported-hardware limits, backup and TFTP preparation, complete U-Boot setup, and first-boot claiming steps. The documented uk and ur commands now stop before erasure if a download or flash-preparation step fails, and the page distinguishes initial installation from later updates.

en/install-novatek.md

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

qodo-free-for-open-source-projects Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. The guide exposes a vendor boot command 📘 Rule violation ⛨ Security
Description
bootcmd embeds the vendor-specific nvt_boot command instead of describing the externally visible
boot result. Publishing this closed-component identifier in the installation recipe exposes an
implementation detail to every reader who only needs the camera to boot.
Code

en/install-novatek.md[39]

+setenv bootcmd 'setenv setargs setenv bootargs ${bootargs};run setargs;sf probe 0;sf read 0x03100000 0x50000 0x200000;nvt_boot'
Evidence
The changed bootcmd line publishes nvt_boot, a vendor-specific boot command identifier, while
Compliance ID 1 prohibits publishing identifiers and implementation mechanisms from closed
components.

Rule 1: Documents behaviour, not the internals behind it
en/install-novatek.md[39-39]

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

## Issue description
The installation guide publishes the closed vendor component's internal `nvt_boot` command, which violates the requirement to document observable behavior rather than closed-component internals.
## Fix Focus Areas
- en/install-novatek.md[39-39]
## Recommended Fix
Remove the vendor-specific command from the public instructions where possible and describe the resulting boot behavior in user-facing terms. If the command is unavoidable for an actionable procedure, isolate it as a required vendor-U-Boot compatibility step without explaining or presenting it as a product concept.

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


2. First boot names an internal component ✓ Resolved
Description
The first-boot instructions tell users to accept the Majestic licence, using the closed
component's internal product name rather than describing the camera software licence. That name is
newly published in the public installation path even though the observable action is simply
accepting the licence.
Code

en/install-novatek.md[R51-54]

+4. On the first boot, run `firstboot` once to format the settings partition.
+5. The camera then starts unclaimed. Open its web page to set the root password
+   and accept the Majestic licence, or log in over SSH or the console, which
+   asks for the same.
Evidence
The changed first-boot text publishes the internal component name Majestic; Compliance ID 1
prohibits naming an internal subsystem from a closed component when describing user-visible
behavior.

Rule 1: Documents behaviour, not the internals behind it
en/install-novatek.md[51-54]

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

## Issue description
The first-boot instructions expose the closed component name `Majestic` instead of documenting the observable licence-acceptance action.
## Fix Focus Areas
- en/install-novatek.md[51-54]
## Recommended Fix
Replace `accept the Majestic licence` with a user-facing description such as `accept the camera software licence`, while retaining the web, SSH and console ways to complete the action.

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


3. Operators can lose their stock backup ✓ Resolved
Description
The backup step presents cat /dev/mtdblockN as a way to copy the whole flash, but one numbered
device contains only one partition and the command specifies no off-camera destination. An operator
following that option before flashing can lose the bootloader, device identity, and other partitions
needed to recover the camera.
Code

en/install-novatek.md[R22-24]

+1. Back up the whole flash first, with a programmer or with
+   `cat /dev/mtdblockN` from the stock firmware's shell. U-Boot on these boards
+   cannot send a backup over the network.
Evidence
The dedicated backup guide states that a whole-chip dump concatenates every mtdblock in /proc/mtd
order and that its destination must be off-camera; it also explains why an on-camera copy can
disappear during reflashing.

en/install-novatek.md[22-24]
en/backup-stock-firmware.md[43-55]
en/backup-stock-firmware.md[62-78]

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

## Issue description
The suggested single-device `cat` command does not produce the promised whole-flash backup or say where to keep it safely.
## Fix Focus Areas
- en/install-novatek.md[22-24]
- en/backup-stock-firmware.md[43-78]
## Recommended Fix
Replace the shorthand with a link to the existing stock-firmware backup procedure, or give its complete partition-ordered command and require a verified off-camera destination.

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



Remediation recommended

4. A first install can reboot after failed flashing ✓ Resolved
Description
The initial-install block runs uk, ur, and reset as separate unconditional commands despite
guarding operations inside each flash recipe. If an operator enters or pastes the block through to
completion after a download or write fails, it still attempts the next partition and reboots without
both images being successfully written.
Code

en/install-novatek.md[R43-45]

+run uk
+run ur
+reset
Evidence
The new recipes chain their internal flash operations, but the newly added outer sequence has no
condition between the two run commands and reset; the following text itself requires both writes
to finish before resetting.

en/install-novatek.md[40-50]

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

## Issue description
The executable first-install sequence reaches reset even if one of its flash steps fails.
## Fix Focus Areas
- en/install-novatek.md[43-50]
## Recommended Fix
Make the sequence conditional on both flash steps succeeding, or put an explicit stop-and-check boundary before the reset command rather than presenting an uninterrupted executable block.

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


5. New operators cannot run the reset first ✓ Resolved
Description
The installation sequence puts firstboot before the password-setting step, although an unclaimed
camera does not provide a Linux shell until interactive login sets that password. On current images,
following the stated order over SSH or the serial console requires claiming the camera first, after
which firstboot erases that password and requires claiming it again.
Code

en/install-novatek.md[R51-53]

+4. On the first boot, run `firstboot` once to format the settings partition.
+5. The camera then starts unclaimed. Open its web page to set the root password
+   and accept the Majestic licence, or log in over SSH or the console, which
Evidence
The first-boot guide says an unclaimed camera offers no shell, that SSH and serial interactive login
set the password before opening a shell, and that firstboot erases the overlay containing that
password.

en/install-novatek.md[51-54]
en/first-boot.md[5-8]
en/first-boot.md[20-39]
en/first-boot.md[45-63]

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

## Issue description
The firstboot instruction precedes the interactive password setup needed to obtain a shell on a fresh image.
## Fix Focus Areas
- en/install-novatek.md[51-54]
- en/first-boot.md[43-63]
## Recommended Fix
Tell readers to complete the interactive password prompt to reach a shell, run firstboot, then claim the reset camera again; alternatively document a supported pre-login way to clear the settings partition.

ⓘ 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 ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread en/install-novatek.md
Comment thread en/install-novatek.md Outdated
Comment thread en/install-novatek.md Outdated
Comment thread en/install-novatek.md Outdated
Comment thread en/install-novatek.md Outdated
…ilure

A fresh image has no shell until it is claimed, and firstboot erases that claim, so the first-install steps now say so in order. uk, ur and reset are joined with && so a failed step stops before the camera resets, the backup step points to the backup guide instead of a single-partition cat, and the licence is named as the user sees it.
@widgetii
widgetii merged commit a353475 into master Oct 22, 2026
@widgetii
widgetii deleted the novatek-first-install branch October 22, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant