jetson-derive-carrier

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

jetson-derive-carrier

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
.
为自定义载板上的任意
customize-*
skill定制首次运行入口。根据
target-platform-contract.md
解析当前目标平台。拒绝执行的情况:配置中无
custom_carrier:
块,或
<source.root_path>/Linux_for_Tegra/.git
缺失(需先执行
jetson-init-source
)。模板文件的创建/复制操作会合并为单个overlay-tracker提交,并直接复制到重命名后的自定义载板目标路径——参考命名的原始文件绝不会被暂存(本地规则详见复刻方案,该规则覆盖了工作流中标准的原始文件+定制拆分逻辑);配置链发现遵循每板配置分发规则。 内核基础DTB不会被复刻——载板差异以DT overlay形式分层,通过
OVERLAY_DTB_FILE
关联。
标识符(来自当前配置文件):
<chip>
来自
reference_devkit.module.id
,通过目录获取(未知则警告,默认回退为
tegra234
);
<module-id>
/
<module-sku>
来自
reference_devkit.module
<carrier-id>
/
<carrier-sku>
来自
reference_devkit.carrier
<custom-id>
/
<custom-sku>
/
<custom-flash-conf>
来自
custom_carrier
<real-conf>
=
readlink <bsp_image.root_path>/Linux_for_Tegra/<reference_devkit.flash_config>
(NVIDIA惯例为
<devkit>.conf
<carrier>-<module>-a<rev>.conf
;若不是符号链接则警告,将顶层文件视为真实配置并跳过符号链接包装步骤)。
<custom-id>
是自定义载板的标识,不一定是NVIDIA风格的
pNNNN
格式。在连字符命名的文件名和DT兼容字符串中直接使用该标识。当目标文件家族使用去除p前缀的数字标识时,仅当
<custom-id>
匹配
^p[0-9]{4}$
格式时,才将
<custom-id-file-token>
推导为
NNNN
;否则直接使用
<custom-id>
。不会仅因自定义载板ID不以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
.
以下复刻方案即为操作指令:先执行一次发现扫描,再逐行复刻每板文件集,每次
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.
本skill生成的每一个
git commit
——无论是在overlay tracker(
Linux_for_Tegra/
)还是
hardware/
源码仓库中——都会经过提交信息预览确认。向操作者展示暂存文件列表+拟提交信息,要求在每次
git commit
前选择接受/编辑/取消;若选择取消,则保留暂存索引供手动处理。
**即使文件内容未变更,也要生成重命名后的复刻文件。**对于每一条被接受的复刻方案行,创建并跟踪自定义载板的目标路径;即使仅为重命名/复制操作,或与参考文件内容完全一致,也不能跳过目标文件创建。这包括BCT复刻,如pinmux、GPIO/GPIOINT、padvoltage/PMC、misc以及MB2 misc。仅在以下情况跳过:适用条件允许跳过、源文件明确为警告并跳过的缺失项,或预期目标路径已被跟踪;最后一种情况会报告该文件已完成复刻,不会创建空提交。
模板文件的创建/复制操作合并为单个overlay-tracker提交,参考命名的原始文件绝不会被暂存。所有在overlay tracker中生成新的(基于模板的)文件的操作——板卡烧录配置、烧录配置符号链接、MB1 BCT(pinmux、GPIO/GPIOINT、padvoltage/PMC、misc)、MB2 BCT(misc)、BPMP DTB(若启用)、nvpmodel、nvfancontrol——都会直接从
<bsp_image.root_path>/Linux_for_Tegra/<rel>/<reference-name>
复制到
<source.root_path>/Linux_for_Tegra/<rel>/<custom-name>
,并在暂存前应用所有内容编辑。参考命名(以
<carrier-id>-<carrier-sku>
为关键字)的文件名绝不会在overlay tracker中被暂存或提交——仅跟踪重命名后的自定义载板文件。这覆盖了提交批处理中的标准原始文件+定制拆分逻辑。所有此类操作会合并为
单个
overlay-tracker提交,包含:(i) 自定义载板命名的文件已应用内容修改并处于目标路径;(ii) 烧录配置符号链接;(iii) 重命名后的烧录配置中针对
PINMUX_CONFIG
/
GPIO_CONFIG
/
GPIOINT_CONFIG
/
PMC_CONFIG
/
MISC_CONFIG
/
MB2_BCT
(若启用BPMP DTB则额外包含
BPFDTB_FILE
)的定向内容改写。编辑现有上游文件而非创建模板的操作——
nvpower.sh
补丁——以及overlay关联(向刚创建的烧录配置复刻文件追加
OVERLAY_DTB_FILE+=
,根据提交批处理视为时间上独立的阶段)仍会按各自步骤生成独立提交。DT overlay骨架提交在
bsp_sources/hardware/
而非overlay tracker中,因此不受影响。合并提交会触发一次提交信息预览确认;警告并跳过的步骤不会纳入提交,若合并包中的所有步骤均已被跟踪则完全省略该提交。

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.
File / categoryDiscoveryAcceptanceFork rule
Board flash conf
<real-conf>
AlwaysFilename sub
<carrier-id>-<carrier-sku>
<custom-id>-<custom-sku>
. Content sub is targeted, not blanket: rewrite RHS only for vars whose file this skill forks —
PINMUX_CONFIG
,
PMC_CONFIG
,
GPIO_CONFIG
/
GPIOINT_CONFIG
,
MISC_CONFIG
,
MB2_BCT
. Other carrier-keyed vars (
DTB_FILE
,
TBCDTB_FILE
,
SCR_CONFIG
,
PMIC_CONFIG
,
DEVICEPROD_CONFIG
,
PROD_CONFIG
,
MINRATCHET_CONFIG
,
UPHY_CONFIG
, dynamic
OVERLAY_DTB_FILE+=
) MUST stay at reference values — their files aren't forked here and a blanket
sed
would point them at nonexistent files.
DTB_FILE
/
TBCDTB_FILE
specifically: base DTB is not forked; the overlay row appends a new
OVERLAY_DTB_FILE+=
line instead.
BPFDTB_FILE
: opt-in extra commit. Never touch
<chip>
,
<module-id>
,
xxxx
.
Flash-conf symlinkUnconditionalAlways (skip if
<real-conf>
not a symlink)
New symlink
<custom-flash-conf>
→ flash-conf fork
MB1 BCT pinmux
PINMUX_CONFIG
+
#include
follow ¶
AlwaysRename rule †
MB1 BCT GPIO
GPIO_CONFIG
/
GPIOINT_CONFIG
+
#include
follow ¶
AlwaysRename rule †
MB1 BCT padvoltage
PMC_CONFIG
+
#include
follow ¶
AlwaysRename rule †
MB1 BCT misc
MISC_CONFIG
+
#include
follow ¶
AlwaysRename rule †
MB2 BCT misc
MB2_BCT
+
#include
follow ¶
AlwaysRename rule †
Kernel DTB + source DTS(reference only — see header)Never forkedBase DTB stays at reference. No pristine binary copy in the overlay tracker; no source DTS fork in
bsp_sources/hardware/
. Carrier deltas live entirely in the DT overlay (next row).
DT overlay skeleton (NEW)UnconditionalAlwaysCreate
<source.root_path>/hardware/nvidia/<chip>/nv-public/overlay/<chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dts
(skeleton ‡); commit in
hardware/
, push to origin
Per-dir Makefile registration
<source.root_path>/bsp_sources/hardware/nvidia/<chip>/nv-public/overlay/Makefile
AlwaysAppend
dtbo-y += <chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dtbo
after the last literal-named
dtbo-y +=
entry (BEFORE the
$(addprefix $(makefile-path)/,$(dtbo-y))
prefix block — inserting after
dtbo-y += $(old-dtbo)
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
hardware/
. Without this row,
nvidia-dtbs
never produces the
.dtbo
referenced by the next row's
OVERLAY_DTB_FILE+=
line and
flash.sh
aborts mid-flash on the missing file.
Overlay wire-upUnconditionalAlwaysAppend
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
AlwaysFilename: 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
AlwaysFilename: substitute carrier portion (append
_<custom-id-file-token>_<custom-sku>
if source is module-keyed only)
nvpower.sh
patch
rootfs/etc/systemd/nvpower.sh
AlwaysPristine + 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 →
conf_file=
nvpmodel fork; (d) cvb-keyed nvfancontrol cascade branch →
conf_file=
nvfancontrol fork
BPMP DTBprebuilt at
bootloader/generic/<BPFDTB_FILE>
(alt naming: no
p
prefix,
xxxx
SKU)
Opt-in y/N, default N — module-level, usually shared with referenceFork binary: pristine + filename sub
-<carrier-id-num>-
-<custom-id-file-token>-
(content unchanged). Extra commit on flash-conf fork rewriting
BPFDTB_FILE
to the renamed binary.
#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
.
执行一次发现扫描;不要与暂存操作交错进行。不要截断列表——每个扫描目录中的所有候选文件名都必须能被匹配器识别。
head
tail
| head -N
| tail -N
及其他行限制过滤器在此步骤禁用;使用无截断的
ls -1
/
find
,或对完整输出执行grep。截断可能导致匹配文件在截断范围外时出现错误的警告并跳过操作。需捕获以下内容:
  • 烧录配置变量:
    DTB_FILE
    /
    TBCDTB_FILE
    /
    BPFDTB_FILE
    /
    PINMUX_CONFIG
    /
    PMC_CONFIG
    /
    GPIO_CONFIG
    /
    GPIOINT_CONFIG
    DTB_FILE
    /
    TBCDTB_FILE
    仅用于参考,以便overlay关联推导overlay文件名的
    <dtb-stem>
    ——本skill绝不会改写这些变量。
  • BCT
    .dts
    文件位于
    bootloader/generic/BCT/
    .dtsi
    同级文件位于上一级目录
    bootloader/
    ——不在同一目录下。
  • nvpmodel:
    nvpmodel_<module-id>_<module-sku>*.conf
    。nvfancontrol:
    nvfancontrol_<module-id>_<module-sku>_<carrier-id>_<carrier-sku>.conf
  • nvpower.sh
    的锚点:(a)–(d):
    <carrier-id>
    cvb分支、
    <module-id>-<module-sku>
    SKU
    elif
    tegra<chip>
    nvpmodel级联、
    tegra<chip>
    nvfancontrol级联。
文件/类别发现方式适用条件复刻规则
板卡烧录配置
<real-conf>
始终适用文件名替换
<carrier-id>-<carrier-sku>
<custom-id>-<custom-sku>
。内容替换为定向替换,而非全局替换:仅改写本skill复刻文件对应的变量右侧值——
PINMUX_CONFIG
PMC_CONFIG
GPIO_CONFIG
/
GPIOINT_CONFIG
MISC_CONFIG
MB2_BCT
。其他与载板相关的变量(
DTB_FILE
TBCDTB_FILE
SCR_CONFIG
PMIC_CONFIG
DEVICEPROD_CONFIG
PROD_CONFIG
MINRATCHET_CONFIG
UPHY_CONFIG
、动态
OVERLAY_DTB_FILE+=
)必须保持参考值——本skill不会复刻这些变量对应的文件,全局
sed
会指向不存在的文件。特别说明
DTB_FILE
/
TBCDTB_FILE
:基础DTB不会被复刻;overlay步骤会追加新的
OVERLAY_DTB_FILE+=
行。
BPFDTB_FILE
:可选额外提交。绝不能修改
<chip>
<module-id>
xxxx
烧录配置符号链接无条件始终适用(若
<real-conf>
不是符号链接则跳过)
创建新符号链接
<custom-flash-conf>
→ 烧录配置复刻文件
MB1 BCT pinmux
PINMUX_CONFIG
+ 追踪
#include
引用 ¶
始终适用重命名规则 †
MB1 BCT GPIO
GPIO_CONFIG
/
GPIOINT_CONFIG
+ 追踪
#include
引用 ¶
始终适用重命名规则 †
MB1 BCT padvoltage
PMC_CONFIG
+ 追踪
#include
引用 ¶
始终适用重命名规则 †
MB1 BCT misc
MISC_CONFIG
+ 追踪
#include
引用 ¶
始终适用重命名规则 †
MB2 BCT misc
MB2_BCT
+ 追踪
#include
引用 ¶
始终适用重命名规则 †
内核DTB + 源码DTS仅作参考——见头部说明绝不复刻基础DTB保持参考值。overlay tracker中不会复制原始二进制文件;
bsp_sources/hardware/
中不会复刻源码DTS。载板差异完全通过DT overlay实现(见下一行)。
DT overlay骨架(新增)无条件始终适用创建
<source.root_path>/hardware/nvidia/<chip>/nv-public/overlay/<chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dts
(骨架‡);在
hardware/
中提交并推送到源仓库
目录Makefile注册
<source.root_path>/bsp_sources/hardware/nvidia/<chip>/nv-public/overlay/Makefile
始终适用最后一个字面命名的
dtbo-y +=
条目之后(
$(addprefix $(makefile-path)/,$(dtbo-y))
前缀块之前——若插入到
dtbo-y += $(old-dtbo)
之后会静默丢失.dtbo)追加
dtbo-y += <chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dtbo
。使用与复合插槽Makefile补丁相同的位置敏感语法和代码片段,详见
../jetson-build-source/references/composite-registration.md#makefile-patch-idempotent-position-sensitive
。在
hardware/
中提交。若缺少此步骤,
nvidia-dtbs
将无法生成下一行
OVERLAY_DTB_FILE+=
引用的
.dtbo
文件,
flash.sh
会在烧录中途因文件缺失而终止。
Overlay关联无条件始终适用向烧录配置复刻文件追加
OVERLAY_DTB_FILE+=",<chip>-<custom-id>-<custom-sku>+<module-id>-<module-sku>.dtbo"
(额外提交)
nvpmodel配置
rootfs/etc/nvpmodel/nvpmodel_<module-id-num>_<module-sku>.conf
始终适用文件名:追加
_<custom-id-file-token>_<custom-sku>
nvfancontrol配置
rootfs/etc/nvpower/nvfancontrol/nvfancontrol_<module-id-num>_<module-sku>_<carrier-id-num>_<carrier-sku>.conf
始终适用文件名:替换载板部分(若源文件仅以模块为关键字则追加
_<custom-id-file-token>_<custom-sku>
nvpower.sh
补丁
rootfs/etc/systemd/nvpower.sh
始终适用原始文件+单个定制提交,包含4处插入:(a) 在参考分支前插入cvb级联
elif [[ "${machine}" =~ "<custom-id>" ]]; then cvb="<custom-id-file-token>"
;(b) 在模块SKU分支内设置
machine="<module-id>-<module-sku>-<custom-id>-<custom-sku>"
;(c) 针对复合机器关键字的nvpmodel级联分支 →
conf_file=
指向nvpmodel复刻文件;(d) 针对cvb关键字的nvfancontrol级联分支 →
conf_file=
指向nvfancontrol复刻文件
BPMP DTB预编译文件位于
bootloader/generic/<BPFDTB_FILE>
(替代命名:无p前缀,
xxxx
SKU)
可选是/否,默认否——模块级文件,通常与参考开发板共享复刻二进制文件:原始文件+文件名替换
-<carrier-id-num>-
-<custom-id-file-token>-
(内容不变)。在烧录配置复刻文件的额外提交中改写
BPFDTB_FILE
为新命名的二进制文件。
追踪
#include
引用
。扫描每个捕获的
.dts
文件中任意位置
#include "..."
指令(NVIDIA BSP通常将其放在BCT节点体内);与载板相关的引用会加入复刻列表。仅追踪一层引用。
重命名规则。与载板相关的源文件(如
…-p3834-xxxx-p4071-0000.dts
)→ 文件名替换
<carrier-id>-<carrier-sku>
<custom-id>-<custom-sku>
;在同一定制提交中改写烧录配置变量(如
PINMUX_CONFIG
)为新命名的文件名。模块部分完全保留原始内容——若原始文件包含
p3834-xxxx
,复刻文件保留
p3834-xxxx
;若原始文件包含
p3834-0008
,复刻文件保留
p3834-0008
。绝不能自行固定模块SKU。若原始文件在载板SKU位置使用
xxxx
通配符(如
p4071-xxxx
p1234-xxxx
),规则相同。以模块为关键字的源文件(如
…-p3767-dp-a03.dtsi
)→ 追加
_<custom-id-file-token>_<custom-sku>
(下划线格式)或
-<custom-id>-<custom-sku>
(连字符格式)在烧录配置复刻文件的额外提交中改写变量(如
PINMUX_CONFIG
)为带后缀的名称。默认不替换内容;若内容包含字面载板id-sku自引用则提示操作者。
Overlay骨架。DT插件overlay(
/plugin/;
)包含一个位于
target-path = "/"
fragment@0
;在
__overlay__
内设置
model = "<custom_carrier.name> carrier board"
compatible = "nvidia,<custom-id>-<custom-sku>+<module-id>-<module-sku>", "nvidia,<chip>"
nvpower.sh
通过读取
compatible
来缩小机器范围。

Edit verification

编辑验证

Re-grep after every
sed
/ patch.
sed
silently no-ops on miss; exit code 0 proves nothing. Multi-line replacements: use Python
str.replace(old, new)
, not multi-line
sed
(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.
每次执行
sed
/补丁后重新执行grep检查。
sed
在匹配失败时会静默无操作;退出码0不代表编辑成功。多行替换:使用Python
str.replace(old, new)
,而非多行
sed
(对空格变化敏感,易静默无操作)。验证失败时拒绝提交。
总结。打印每个仓库的复刻情况(数量+提交SHA)、BPMP-DTB选择、警告并跳过的步骤(当前BSP中缺失必需源文件——不会终止运行)、已写入的overlay路径。

Examples

示例

Trigger phrases the operator might use:
text
derive custom carrier
bootstrap custom carrier
fork carrier board from reference devkit
Minimal
custom_carrier:
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
操作者可能使用的触发短语:
text
derive custom carrier
bootstrap custom carrier
fork carrier board from reference devkit
本skill期望在当前配置文件中找到的最小
custom_carrier:
块:
yaml
custom_carrier:
  id: p1234            # 任意标识;无需遵循NVIDIA pNNNN格式
  sku: 0000
  flash_config: p1234.conf
  name: Acme Custom Carrier

Purpose

用途

Customize the per-board fileset for a new carrier board so downstream
customize-*
skills,
nvpower.sh
, 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.
为新载板定制每板文件集,使下游
customize-*
skill、
nvpower.sh
和启动链指向自定义载板而非参考开发板。基础DTB保持参考值;载板差异通过DT overlay实现,因此针对新参考BSP重新复刻时只需再次运行本skill。

Prerequisites

前置条件

  • Active profile resolved per
    target-platform-contract.md
    with a
    custom_carrier:
    block (id, sku, flash-conf, friendly name).
  • source.root_path/Linux_for_Tegra/.git
    initialized — run
    /jetson-init-source
    first; this skill refuses if the overlay tracker is missing.
  • bsp_image.root_path
    populated by
    /jetson-init-image
    so the reference flash-conf symlink can be resolved.
  • reference_devkit:
    populated (module + carrier) so the rename rule has carrier-id/sku tokens to substitute away from.
  • 当前配置文件已根据
    target-platform-contract.md
    解析完成,且包含
    custom_carrier:
    块(id、sku、烧录配置、友好名称)。
  • source.root_path/Linux_for_Tegra/.git
    已初始化——需先运行
    /jetson-init-source
    ;若overlay tracker缺失,本skill会拒绝执行。
  • bsp_image.root_path
    已通过
    /jetson-init-image
    填充,以便解析参考烧录配置符号链接。
  • reference_devkit:
    已填充(模块+载板),以便重命名规则有可替换的载板id/sku标识。

Limitations

限制

  • Kernel base DTB and its source DTS are not forked — carrier deltas must layer through the DT overlay wired via
    OVERLAY_DTB_FILE
    .
  • 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 (
    DTB_FILE
    ,
    TBCDTB_FILE
    ,
    SCR_CONFIG
    ,
    PMIC_CONFIG
    ,
    DEVICEPROD_CONFIG
    ,
    PROD_CONFIG
    ,
    MINRATCHET_CONFIG
    ,
    UPHY_CONFIG
    , dynamic
    OVERLAY_DTB_FILE+=
    ) stay at reference values — rewriting them would point at files that do not exist.
  • Custom-carrier IDs need not follow NVIDIA
    pNNNN
    style; the p-stripped numeric token is derived only when the ID matches
    ^p[0-9]{4}$
    .
  • Does not customize module-level files. Use the relevant
    jetson-customize-*
    skill for pinmux, clocks, fan curves, nvpmodel, PCIe, UPHY, USB, MGBE, or camera deltas.
  • 内核基础DTB及其源码DTS不会被复刻——载板差异必须通过
    OVERLAY_DTB_FILE
    关联的DT overlay实现。
  • BPMP DTB复刻为可选(默认关闭)。大多数载板更换会共享参考BPMP DTB;仅当板卡电源/时钟拓扑不同时才启用。
  • 烧录配置内容替换为定向替换,而非全局替换。本skill未复刻文件对应的变量(
    DTB_FILE
    TBCDTB_FILE
    SCR_CONFIG
    PMIC_CONFIG
    DEVICEPROD_CONFIG
    PROD_CONFIG
    MINRATCHET_CONFIG
    UPHY_CONFIG
    、动态
    OVERLAY_DTB_FILE+=
    )保持参考值——改写这些变量会指向不存在的文件。
  • 自定义载板ID无需遵循NVIDIA
    pNNNN
    格式;仅当ID匹配
    ^p[0-9]{4}$
    时才推导去除p前缀的数字标识。
  • 不会定制模块级文件。如需修改pinmux、时钟、风扇曲线、nvpmodel、PCIe、UPHY、USB、MGBE或相机,请使用相应的
    jetson-customize-*
    skill。

Troubleshooting

故障排除

  • Refuses with "no
    custom_carrier:
    block"
    — declare the block in the active profile before re-running; the skill will not infer it.
  • Refuses with ".git missing in
    Linux_for_Tegra/
    "
    — overlay tracker not initialized. Run
    /jetson-init-source
    first.
  • "
    <real-conf>
    not a symlink"
    — NVIDIA convention is a
    <devkit>.conf
    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.
  • sed
    reported success but the edit is missing
    sed
    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
    str.replace
    .
  • "chip: unknown" / fallback to
    tegra234
    — 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.
  • 提示“无
    custom_carrier:
    块”并拒绝执行
    ——重新运行前需在当前配置文件中声明该块;本skill不会自动推断。
  • 提示“
    Linux_for_Tegra/
    中缺失.git”并拒绝执行
    ——overlay tracker未初始化。需先运行
    /jetson-init-source
  • 提示“
    <real-conf>
    不是符号链接”
    ——NVIDIA惯例是
    <devkit>.conf
    符号链接到
    <carrier>-<module>-a<rev>.conf
    ;若顶层文件为真实配置,本skill会发出警告,将其视为真实配置并跳过符号链接包装步骤。这不是错误。
  • sed
    报告成功但编辑内容缺失
    ——
    sed
    在匹配失败时会静默无操作。本skill会在每次补丁后重新执行grep检查,验证失败时拒绝提交;多行替换请改用Python
    str.replace
  • 提示“chip: unknown” / 回退为
    tegra234
    ——模块ID不在目录中;请更新目录而非在配置文件中覆盖。
  • 提交信息预览提示中断运行——这是提交批处理中的预期确认步骤;选择接受、编辑或取消。取消后会保留暂存索引供手动处理。
  • 当前BSP中缺失必需源文件——该步骤会在总结中记录为警告并跳过;其余步骤仍会完成。