jetson-derive-carrier
Customize first-run gate for any
skill on a custom
carrier. Resolve the active target per
target-platform-contract.md
.
Refuse if no
block, or if
<source.root_path>/Linux_for_Tegra/.git
is missing
(
first). Template file create/copy rows land in a
single overlay-tracker commit and copy
directly to the
custom-carrier-renamed target path — reference-named pristine files
are never staged (see
Fork plan for the local rule, which
overrides the standard pristine + customization split from the
workflow);
conf-chain discovery follows
per-board conf dispatch.
Kernel base DTB is
not forked — carrier deltas layer as a DT
overlay wired via
.
Identifiers (from active profile):
from
reference_devkit.module.id
via
catalogue (unknown →
warn, fallback
);
/
from
;
/
from
;
/
/
from
.
=
readlink <bsp_image.root_path>/Linux_for_Tegra/<reference_devkit.flash_config>
(NVIDIA convention
→
<carrier>-<module>-a<rev>.conf
;
warn + treat top-level as real + skip symlink-wrapper row if not a
symlink).
is a custom carrier board token, not necessarily an
NVIDIA-style
ID. Use it verbatim in dash-form filenames and DT
compatible strings. When a target file family uses p-stripped numeric
tokens, derive
as
only if
matches
; otherwise use
unchanged. Do not
reject custom carrier IDs merely because they do not start with
.
Instructions
The fork plan below is the instruction set: one discovery pass, then a
row-by-row fork of the per-board fileset, gated by the commit-message
preview before each
.
Fork plan
Every
produced by this skill — in the overlay tracker
(
) or the
source repo — runs through
the
commit message preview gate.
Surface the staged file list + proposed message to the operator
and require accept / edit / cancel before each
; on
cancel leave the index staged for manual resolution.
Materialize renamed forks even when bytes do not change. For every
accepted fork-plan row, create and track the custom-carrier target path;
do not skip a missing target because the fork is only a rename/copy or is
byte-identical to the reference. This includes BCT forks such as pinmux,
GPIO/GPIOINT, padvoltage/PMC, misc, and MB2 misc. Skip only when the
Acceptance column allows it, the source is an explicit warn-and-skip
miss, or the expected target path is already tracked; in the last case,
report it as already derived and do not create an empty commit.
Template file create/copy rows squash into one overlay-tracker
commit, and reference-named pristine files are never staged. All
rows that materialize a new (template-derived) file in the overlay
tracker — board flash-conf, flash-conf symlink, MB1 BCT (pinmux,
GPIO/GPIOINT, padvoltage/PMC, misc), MB2 BCT (misc), BPMP DTB (when
opted in), nvpmodel, nvfancontrol — copy
directly from
<bsp_image.root_path>/Linux_for_Tegra/<rel>/<reference-name>
to
<source.root_path>/Linux_for_Tegra/<rel>/<custom-name>
with any
content edits applied before staging. The reference-named
(
<carrier-id>-<carrier-sku>
-keyed) filename is never staged or
committed in the overlay tracker — only the custom-carrier-renamed
file is tracked. This overrides the standard pristine + customization
split from
commit batching.
All such rows land in a
single overlay-tracker commit that adds:
(i) the custom-carrier-named files at their target paths with content
already applied, (ii) the flash-conf symlink, and (iii) the targeted
flash-conf content rewrites inside the renamed flash-conf for
/
/
/
/
/
(plus
when BPMP DTB is opted
in). Rows that edit existing upstream files instead of creating
templates — the
patch — and the overlay wire-up
(
append to the just-created flash-conf fork,
treated as a temporally distinct phase per
commit batching)
remain separate commits per their own rows. The DT overlay skeleton
commits in
, not the overlay tracker, so it is
unaffected. The commit message preview gate fires once on the
squashed commit; warn-and-skipped rows do not contribute, and if every
row in the bundle is already tracked the commit is omitted entirely.
Discovery (single batched pass)
Run
one discovery pass; do not interleave with staging.
Do not
truncate listings — every candidate filename in each scanned
directory must be visible to the matcher.
,
,
,
, and any other row-limiting filter are out of bounds for
this step; use
/
unclipped, or grep on the full output.
Truncating risks false warn-and-skip calls when the matching file
sits past the cutoff. Capture:
- Flash-conf vars: / / /
/ / / .
/ are captured for reference only so
the overlay wire-up can derive for the overlay
filename — they are never rewritten by this skill.
- BCT at ; siblings live
one level up at — NOT alongside.
- nvpmodel:
nvpmodel_<module-id>_<module-sku>*.conf
. nvfancontrol:
nvfancontrol_<module-id>_<module-sku>_<carrier-id>_<carrier-sku>.conf
.
- anchors for (a)–(d): cvb branch,
SKU , nvpmodel
cascade, nvfancontrol cascade.
| File / category | Discovery | Acceptance | Fork rule |
|---|
| Board flash conf | | Always | Filename sub <carrier-id>-<carrier-sku>
→ . Content sub is targeted, not blanket: rewrite RHS only for vars whose file this skill forks — , , / , , . Other carrier-keyed vars (, , , , , , , , dynamic ) MUST stay at reference values — their files aren't forked here and a blanket would point them at nonexistent files. / specifically: base DTB is not forked; the overlay row appends a new line instead. : opt-in extra commit. Never touch , , . |
| Flash-conf symlink | Unconditional | Always (skip if not a symlink) | New symlink → flash-conf fork |
| MB1 BCT pinmux | + follow ¶ | Always | Rename rule † |
| MB1 BCT GPIO | / + follow ¶ | Always | Rename rule † |
| MB1 BCT padvoltage | + follow ¶ | Always | Rename rule † |
| MB1 BCT misc | + follow ¶ | Always | Rename rule † |
| MB2 BCT misc | + follow ¶ | Always | Rename rule † |
| Kernel DTB + source DTS | (reference only — see header) | Never forked | Base DTB stays at reference. No pristine binary copy in the overlay tracker; no source DTS fork in . Carrier deltas live entirely in the DT overlay (next row). |
| DT overlay skeleton (NEW) | Unconditional | Always | Create <source.root_path>/hardware/nvidia/<chip>/nv-public/overlay/<chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dts
(skeleton ‡); commit in , push to origin |
| Per-dir Makefile registration | <source.root_path>/bsp_sources/hardware/nvidia/<chip>/nv-public/overlay/Makefile
| Always | Append dtbo-y += <chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dtbo
after the last literal-named entry (BEFORE the $(addprefix $(makefile-path)/,$(dtbo-y))
prefix block — inserting after silently drops the .dtbo). Same position-sensitive idiom and snippet as the composite slot's Makefile patch in ../jetson-build-source/references/composite-registration.md#makefile-patch-idempotent-position-sensitive
. Commit in . Without this row, never produces the referenced by the next row's line and aborts mid-flash on the missing file. |
| Overlay wire-up | Unconditional | Always | Append OVERLAY_DTB_FILE+=",<chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dtbo"
to flash-conf fork (extra commit) |
| nvpmodel config | rootfs/etc/nvpmodel/nvpmodel_<module-id-num>_<module-sku>.conf
| Always | Filename: append _<custom-id-file-token>_<custom-sku>
|
| nvfancontrol config | rootfs/etc/nvpower/nvfancontrol/nvfancontrol_<module-id-num>_<module-sku>_<carrier-id-num>_<carrier-sku>.conf
| Always | Filename: substitute carrier portion (append _<custom-id-file-token>_<custom-sku>
if source is module-keyed only) |
| patch | rootfs/etc/systemd/nvpower.sh
| Always | Pristine + single customization commit with 4 insertions: (a) cvb cascade elif [[ "${machine}" =~ "<custom-id>" ]]; then cvb="<custom-id-file-token>"
before reference; (b) inside module-SKU branch set machine="<module-id>-<module-sku>-<custom-id>-<custom-sku>"
; (c) nvpmodel cascade branch for composite machine key → nvpmodel fork; (d) cvb-keyed nvfancontrol cascade branch → nvfancontrol fork |
| BPMP DTB | prebuilt at bootloader/generic/<BPFDTB_FILE>
(alt naming: no prefix, SKU) | Opt-in y/N, default N — module-level, usually shared with reference | Fork binary: pristine + filename sub → (content unchanged). Extra commit on flash-conf fork rewriting to the renamed binary. |
¶
follow. Scan each captured
for
directives
anywhere in the file (NVIDIA BSPs put them
inside BCT node bodies); carrier-keyed includes join the fork list.
Stop at one level.
†
Rename rule. Carrier-keyed source (e.g.
…-p3834-xxxx-p4071-0000.dts
) → filename sub
<carrier-id>-<carrier-sku>
→
; rewrite the
flash-conf variable (e.g.
) to the renamed filename in
the same customization commit.
Module portion is preserved
verbatim from pristine — if pristine has
, fork keeps
; if pristine has
, fork keeps
.
Never pin module-SKU on your own. Same rule for any other
wildcard in the carrier-SKU position when pristine uses it (e.g.
→
). Module-keyed
source (e.g.
) → append
_<custom-id-file-token>_<custom-sku>
(underscore-form) or
-<custom-id>-<custom-sku>
(dash-form)
plus an extra commit on
flash-conf fork rewriting the variable (e.g.
) to the
suffixed name. Content never substituted by default; prompt if
content holds a literal carrier-id-sku self-reference.
‡
Overlay skeleton. DT plugin overlay (
) with one
at
; inside
set
model = "<custom_carrier.name> carrier board"
and
compatible = "nvidia,<custom-id>-<custom-sku>+<module-id>-<module-sku>", "nvidia,<chip>"
.
machine narrowing reads
.
Edit verification
Re-grep after every
/ patch.
silently no-ops on miss;
exit code 0 proves nothing. Multi-line replacements: use Python
, not multi-line
(brittle to whitespace
drift, silent no-ops). Refuse to commit on verification miss.
Summary. Print forks per repo (count + commit SHAs), BPMP-DTB
decision, warn-and-skipped rows (mandatory source file missing on
this BSP — don't fail the run), overlay path written.
Examples
Trigger phrases the operator might use:
text
derive custom carrier
bootstrap custom carrier
fork carrier board from reference devkit
Minimal
block in the active profile that the skill
expects to find:
yaml
custom_carrier:
id: p1234 # any token; need not be NVIDIA pNNNN style
sku: 0000
flash_config: p1234.conf
name: Acme Custom Carrier
Purpose
Customize the per-board fileset for a new carrier board so downstream
skills,
, and the boot chain land on the
custom carrier instead of the reference devkit. Base DTB stays at the
reference; carrier deltas live in a DT overlay so a re-derive against
a new reference BSP only needs to re-run this skill.
Prerequisites
- Active profile resolved per
target-platform-contract.md
with a block (id, sku, flash-conf, friendly name).
source.root_path/Linux_for_Tegra/.git
initialized — run
first; this skill refuses if the overlay
tracker is missing.
- populated by so the
reference flash-conf symlink can be resolved.
- populated (module + carrier) so the rename rule
has carrier-id/sku tokens to substitute away from.
Limitations
- Kernel base DTB and its source DTS are not forked — carrier
deltas must layer through the DT overlay wired via
.
- BPMP DTB fork is opt-in (default OFF). Most carrier swaps share the
reference BPMP DTB; only opt in when board power/clock topology
diverges.
- Flash-conf content substitution is targeted, not blanket. Vars
whose files this skill does not fork (, ,
, , , ,
, , dynamic )
stay at reference values — rewriting them would point at files that
do not exist.
- Custom-carrier IDs need not follow NVIDIA style; the
p-stripped numeric token is derived only when the ID matches
.
- Does not customize module-level files. Use the relevant
skill for pinmux, clocks, fan curves,
nvpmodel, PCIe, UPHY, USB, MGBE, or camera deltas.
Troubleshooting
- Refuses with "no block" — declare the block in
the active profile before re-running; the skill will not infer it.
- Refuses with ".git missing in " — overlay
tracker not initialized. Run first.
- " not a symlink" — NVIDIA convention is a
symlink to
<carrier>-<module>-a<rev>.conf
; if the
top-level is the real conf, the skill warns, treats it as real, and
skips the symlink-wrapper row. Not an error.
- reported success but the edit is missing — silently
no-ops on miss. The skill re-greps after every patch and refuses to
commit on verification miss; for multi-line replacements switch to
Python .
- "chip: unknown" / fallback to — module ID is not in
the catalogue; update
the catalogue rather than override in the profile.
- Commit message preview prompt blocks the run — expected gate per
commit-batching;
accept, edit, or cancel. On cancel the index is left staged for
manual resolution.
- A mandatory source file is missing on this BSP — the row is
recorded as warn-and-skipped in the summary; the rest of the run
still completes.