jetson-derive-carrier
Customize first-run gate for any customize-* skill on a custom
carrier. Resolve the active target per
target-platform-contract.md.
Refuse if no custom_carrier: block, or if
<source.root_path>/Linux_for_Tegra/.git is missing
(jetson-init-source 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 OVERLAY_DTB_FILE.
Identifiers (from active profile): <chip> from
reference_devkit.module.id via
catalogue (unknown →
warn, fallback tegra234); <module-id>/<module-sku> from
reference_devkit.module; <carrier-id>/<carrier-sku> from
reference_devkit.carrier; <custom-id>/<custom-sku>/
<custom-flash-conf> from custom_carrier. <real-conf> =
readlink <bsp_image.root_path>/Linux_for_Tegra/<reference_devkit.flash_config>
(NVIDIA convention <devkit>.conf → <carrier>-<module>-a<rev>.conf;
warn + treat top-level as real + skip symlink-wrapper row if not a
symlink).
<custom-id> is a custom carrier board token, not necessarily an
NVIDIA-style pNNNN ID. Use it verbatim in dash-form filenames and DT
compatible strings. When a target file family uses p-stripped numeric
tokens, derive <custom-id-file-token> as NNNN only if <custom-id>
matches ^p[0-9]{4}$; otherwise use <custom-id> unchanged. Do not
reject custom carrier IDs merely because they do not start with p.
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 git commit.
Fork plan
Every git commit produced by this skill — in the overlay tracker
(Linux_for_Tegra/) or the hardware/ 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 git commit; 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
PINMUX_CONFIG / GPIO_CONFIG / GPIOINT_CONFIG / PMC_CONFIG /
MISC_CONFIG / MB2_BCT (plus BPFDTB_FILE when BPMP DTB is opted
in). Rows that edit existing upstream files instead of creating
templates — the nvpower.sh patch — and the overlay wire-up
(OVERLAY_DTB_FILE+= 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 bsp_sources/hardware/, 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. head, tail, | head -N,
| tail -N, and any other row-limiting filter are out of bounds for
this step; use ls -1 / find 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:
DTB_FILE / TBCDTB_FILE / BPFDTB_FILE /
PINMUX_CONFIG / PMC_CONFIG / GPIO_CONFIG / GPIOINT_CONFIG.
DTB_FILE / TBCDTB_FILE are captured for reference only so
the overlay wire-up can derive <dtb-stem> for the overlay
filename — they are never rewritten by this skill.
- BCT
.dts at bootloader/generic/BCT/; .dtsi siblings live
one level up at bootloader/ — NOT alongside.
- nvpmodel:
nvpmodel_<module-id>_<module-sku>*.conf. nvfancontrol:
nvfancontrol_<module-id>_<module-sku>_<carrier-id>_<carrier-sku>.conf.
nvpower.sh anchors for (a)–(d): <carrier-id> cvb branch,
<module-id>-<module-sku> SKU elif, tegra<chip> nvpmodel
cascade, tegra<chip> nvfancontrol cascade.
¶ #include follow. Scan each captured .dts for #include "..." 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> → <custom-id>-<custom-sku>; rewrite the
flash-conf variable (e.g. PINMUX_CONFIG) to the renamed filename in
the same customization commit. Module portion is preserved
verbatim from pristine — if pristine has p3834-xxxx, fork keeps
p3834-xxxx; if pristine has p3834-0008, fork keeps p3834-0008.
Never pin module-SKU on your own. Same rule for any other xxxx
wildcard in the carrier-SKU position when pristine uses it (e.g.
p4071-xxxx → p1234-xxxx). Module-keyed
source (e.g. …-p3767-dp-a03.dtsi) → 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. PINMUX_CONFIG) 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 (/plugin/;) with one
fragment@0 at target-path = "/"; inside __overlay__ set
model = "<custom_carrier.name> carrier board" and compatible = "nvidia,<custom-id>-<custom-sku>+<module-id>-<module-sku>", "nvidia,<chip>". nvpower.sh machine narrowing reads compatible.