jetson-init-source

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Initialize BSP Customization Workspace

初始化BSP定制工作区

Overview

概述

This skill bootstraps the source-side workspace that customize-* / build skills depend on: the
Linux_for_Tegra
overlay tracker (git repo for pristine + customization commits), the
bsp_sources/
mono-tree (kernel, OOT, nvgpu, display, hwpm, hardware DTs), and a working NVIDIA Crosstool-NG cross-compile prefix. It owns only the
source:
block in the active profile and the on-disk source workspace under
<source.root_path>
(default:
<workspace>/Source
).
Responsibilities:
  1. Optionally record a non-default
    source.root_path
    .
  2. Create or mount the
    Linux_for_Tegra
    overlay tracker.
  3. Materialize
    bsp_sources
    using the precedence in the "Materialize the BSP-sources baseline" step.
  4. Resolve and record
    source.toolchain
    .
  5. Clone extra user-defined repos from
    source.repos:
    .
该技能会搭建定制类/构建类技能依赖的源码端工作区:
Linux_for_Tegra
覆盖跟踪器(用于存储原始提交与定制提交的Git仓库)、
bsp_sources/
单目录树(包含内核、OOT、nvgpu、显示、hwpm、硬件设备树),以及可用的NVIDIA Crosstool-NG交叉编译前缀。它仅负责激活配置文件中的
source:
块,以及
<source.root_path>
下的磁盘源码工作区(默认路径:
<workspace>/Source
)。
职责:
  1. 可选记录非默认的
    source.root_path
  2. 创建或挂载
    Linux_for_Tegra
    覆盖跟踪器。
  3. 按照「生成BSP-sources基线」步骤中的优先级生成
    bsp_sources
  4. 解析并记录
    source.toolchain
  5. source.repos:
    克隆用户定义的额外仓库。

When to invoke

调用时机

  • The user asks to bootstrap, init, or sync the BSP customization workspace.
  • A downstream customization skill refused with "no workspace tracker at
    <source.root_path>/Linux_for_Tegra/
    ".
  • After
    jetson-init-image
    (Setup's next step on a fresh target).
  • 用户要求引导、初始化或同步BSP定制工作区时。
  • 下游定制技能返回错误「
    <source.root_path>/Linux_for_Tegra/
    处无工作区跟踪器」时。
  • 执行
    jetson-init-image
    之后(全新目标设备的下一步设置操作)。

Procedure

操作流程

Quick-start prefill mapping

快速启动预填充映射

Follow the shared
quick_start_prefill
contract
. This skill has source-specific mappings:
  • quick_start_prefill.source.public_sources_archive
    maps to the Branch-A archive candidate.
  • quick_start_prefill.source.repos
    maps to proposed
    source.repos:
    entries; validate reserved keys and
    url:
    /
    archive:
    mutual exclusion before writing.
  • quick_start_prefill.source.toolchain
    may be a cross-compile prefix, a
    gcc
    path, a containing
    bin/
    directory, an
    x-tools.tbz2
    archive path, or
    skip
    .
This skill remains the only owner of
source.root_path
,
source.repos:
, and
source.toolchain
profile writes.
遵循共享的
quick_start_prefill
协议
。该技能有特定于源码的映射规则:
  • quick_start_prefill.source.public_sources_archive
    映射到Branch-A归档候选。
  • quick_start_prefill.source.repos
    映射到建议的
    source.repos:
    条目;写入前需验证保留键以及
    url:
    /
    archive:
    的互斥性。
  • quick_start_prefill.source.toolchain
    可以是交叉编译前缀、
    gcc
    路径、包含
    bin/
    的目录、
    x-tools.tbz2
    归档路径或
    skip
该技能是唯一有权修改
source.root_path
source.repos:
source.toolchain
配置文件的模块。

Resolve the active target + paths

解析激活目标与路径

Resolve the active profile + workspace defaults per the contract in
../../context/target-platform-contract.md
.
  • Refuse if
    <bsp_image.root_path>
    does not contain
    Linux_for_Tegra/
    (BSP not extracted — route to
    /jetson-init-image
    ).
  • If the profile has
    source.root_path:
    , use it. Otherwise
    <source.root_path>
    defaults to
    <workspace>/Source
    ; use that default silently and do not write
    source.root_path:
    to the profile. Ask only for an explicit custom path, unrelated content at the default path, or an unwritable parent.
Read
source.repos:
(if present) into a map keyed by entry name, each carrying optional
url
,
ref
,
subdir
,
path
. Reserved keys:
Linux_for_Tegra
(overlay tracker),
bsp_sources
(kernel-source repo). Every other key is an extra user-defined repo.
根据
../../context/target-platform-contract.md
中的协议解析激活配置文件与工作区默认值。
  • 如果
    <bsp_image.root_path>
    不包含
    Linux_for_Tegra/
    ,则拒绝执行(引导至
    /jetson-init-image
    )。
  • 如果配置文件中有
    source.root_path:
    ,则使用该路径。否则
    <source.root_path>
    默认设为
    <workspace>/Source
    ;静默使用该默认值,不向配置文件写入
    source.root_path:
    。仅当用户要求显式自定义路径、默认路径存在无关内容或父目录不可写时才询问。
source.repos:
(如果存在)读取为以条目名称为键的映射,每个条目包含可选的
url
ref
subdir
path
。保留键包括:
Linux_for_Tegra
(覆盖跟踪器)、
bsp_sources
(内核源码仓库)。其余所有键均为用户定义的额外仓库。

(Optional) prompt for
source.root_path
override

(可选)提示覆盖
source.root_path

Only when
source.root_path
is absent from the profile and one of the override conditions above applies:
source.root_path
: default =
<workspace>/Source
. Press Enter to accept, or enter an absolute path to override.
  • On Enter — keep the default; do not touch the profile.
  • On override path — validate the closest existing parent is writable; refuse and re-prompt if not. Edit
    target-platform/<active>.yaml
    in place to add/update
    source.root_path:
    . Preserve all other blocks, comments, and quoting — use a round-tripping YAML loader (e.g.
    ruamel.yaml
    ).
Fires at most once per profile. Otherwise create
<workspace>/Source
as needed and continue without prompting.
仅当配置文件中缺少
source.root_path
且满足上述覆盖条件之一时触发:
source.root_path
: 默认值 =
<workspace>/Source
。按Enter键接受默认值,或输入绝对路径进行覆盖。
  • 按Enter — 保留默认值;不修改配置文件。
  • 输入覆盖路径 — 验证最近的现有父目录是否可写;如果不可写则拒绝并重新提示。使用支持往返的YAML加载器(如
    ruamel.yaml
    ),在原地编辑
    target-platform/<active>.yaml
    以添加/更新
    source.root_path:
    。保留所有其他块、注释和引号格式。
每个配置文件最多触发一次。否则按需创建
<workspace>/Source
并继续执行,无需提示。

Materialize
Linux_for_Tegra

生成
Linux_for_Tegra

Mount path is canonical:
<source.root_path>/Linux_for_Tegra/
.
Default (no
source.repos.Linux_for_Tegra
entry):
bash
LFT="<source.root_path>/Linux_for_Tegra"
mkdir -p "$LFT"
[ -d "$LFT/.git" ] || git -C "$LFT" init
Empty tracker. Do not commit anything here — pristine imports happen file-by-file when customization skills run.
Override (
url
,
ref
, optional
subdir
):
bash
undefined
挂载路径为标准路径:
<source.root_path>/Linux_for_Tegra/
默认情况(无
source.repos.Linux_for_Tegra
条目):
bash
LFT="<source.root_path>/Linux_for_Tegra"
mkdir -p "$LFT"
[ -d "$LFT/.git" ] || git -C "$LFT" init
空跟踪器。请勿在此处提交任何内容 — 原始导入操作会在定制技能运行时逐文件执行。
覆盖情况(指定
url
ref
,可选
subdir
):
bash
undefined

Clone the user's repo to a side location, then mount the

将用户仓库克隆到侧边位置,然后将预期目录(子目录或仓库根目录)挂载到标准路径。

expected tree (subdir or repo root) at the canonical path.

CLONE="<source.root_path>/.repos/Linux_for_Tegra" git clone <url> -b <ref> "$CLONE" ln -s "$CLONE/<subdir or .>" "<source.root_path>/Linux_for_Tegra"

If the mount already exists with valid git state, skip; refuse if it
exists with unrelated content.
CLONE="<source.root_path>/.repos/Linux_for_Tegra" git clone <url> -b <ref> "$CLONE" ln -s "$CLONE/<subdir or .>" "<source.root_path>/Linux_for_Tegra"

如果挂载已存在且Git状态有效,则跳过;如果挂载存在但包含无关内容,则拒绝执行。

Materialize the BSP-sources baseline

生成BSP-sources基线

Three branches, dispatched in precedence order against the profile entry
source.repos.bsp_sources
:
OrderProfile stateBranch
1
url:
set
C. Customer git clone (explicit override always wins)
2
archive:
set, OR entry absent AND
<workspace>/Downloads/public_sources.tbz2
exists
A. Local archive extraction (default)
3Entry absent AND no local archiveB.
source_sync.sh
(fallback)
url:
and
archive:
are mutually exclusive — refuse if both are set in the same entry.
Branch A is the preferred default because it sidesteps NVIDIA git egress entirely (the most common Setup failure mode). Branch B exists for fresh workspaces with no pre-downloaded tarball. Branch C is for customer forks of the whole BSP layout.
三种分支模式,根据配置文件条目
source.repos.bsp_sources
优先级顺序触发:
顺序配置文件状态分支模式
1设置了
url:
C. 客户Git克隆(显式覆盖始终优先)
2设置了
archive:
条目缺失
<workspace>/Downloads/public_sources.tbz2
存在
A. 本地归档提取(默认模式)
3条目缺失无本地归档B.
source_sync.sh
( fallback模式)
url:
archive:
互斥 — 如果同一条目同时设置两者,则拒绝执行。
Branch A是首选默认模式,因为它完全避开了NVIDIA Git出口(这是设置过程中最常见的失败原因)。Branch B适用于没有预下载压缩包的全新工作区。Branch C适用于客户对整个BSP布局的分支版本。

Branch A — Local archive extraction (default)

Branch A — 本地归档提取(默认模式)

Default branch: extract a pre-downloaded
public_sources.tbz2
into
<source.root_path>/bsp_sources/
as a single mono-repo (
git init
+ pristine commit). See
references/branch-a-extraction.md
for the full archive shape, path-resolution rules, and the extraction script (including the Tegra OOT Makefile force-replace workaround for R36.x).
Branches B and C may produce per-component repos instead; downstream build logic still walks the canonical sub-paths under
<source.root_path>/bsp_sources/
.
默认分支:将预下载的
public_sources.tbz2
提取到
<source.root_path>/bsp_sources/
,作为单一仓库(
git init
+ 原始提交)。完整归档结构、路径解析规则以及提取脚本(包括针对R36.x版本的Tegra OOT Makefile强制替换解决方案)请参考
references/branch-a-extraction.md
Branch B和C可能会生成按组件划分的仓库;下游构建逻辑仍会遍历
<source.root_path>/bsp_sources/
下的标准子路径。

Branch B —
source_sync.sh
(fallback)

Branch B —
source_sync.sh
(fallback模式)

Runs only when no local archive is found and no
url:
is set. Create the
bsp_sources/
mount directory under
<source.root_path>
and run
source_sync.sh
from the extracted BSP with two flags:
bash
mkdir -p "<source.root_path>/bsp_sources"
bash "<bsp_image.root_path>/Linux_for_Tegra/source/source_sync.sh" \
     -d "<source.root_path>/bsp_sources" \
     -t "jetson_<major.minor>"
  • -d <source.root_path>/bsp_sources
    — write clones into the
    bsp_sources/
    subdir of the workspace, so the on-disk folder matches the schema key. Without
    -d
    , the script writes under its own directory (the BSP itself) — wrong for the overlay model.
  • -t jetson_<major.minor>
    — pin the tag to the BSP release line. Derive from
    bsp_image.version
    by truncating to the first two dotted components:
    "38.4.0"
    jetson_38.4
    . Tag-format fallback: if rejected, try
    jetson_<bsp_image.version>
    (older L4T sometimes uses the full form). If that also fails, surface the error and stop — never fall back to "latest" silently.
Refuse if
source_sync.sh
does not exist: re-run
/jetson-init-image
to repopulate
Linux_for_Tegra/source/
.
source_sync.sh
exits 0 even when every clone failed — verify by counting
Failed to clone
lines in its output and refuse if non-zero. The most likely cause of universal failure is blocked git egress to
gitlab.com/nvidia/nv-tegra
/
nv-tegra.nvidia.com
; surface that explicitly and route the user to download
public_sources.tbz2
via
/quick-start
for Branch A.
仅当未找到本地归档且未设置
url:
时运行。在
<source.root_path>
下创建
bsp_sources/
挂载目录,并使用两个标志运行已提取BSP中的
source_sync.sh
bash
mkdir -p "<source.root_path>/bsp_sources"
bash "<bsp_image.root_path>/Linux_for_Tegra/source/source_sync.sh" \
     -d "<source.root_path>/bsp_sources" \
     -t "jetson_<major.minor>"
  • -d <source.root_path>/bsp_sources
    — 将克隆内容写入工作区的
    bsp_sources/
    子目录,确保磁盘文件夹与架构键匹配。如果不使用
    -d
    ,脚本会写入自身目录(BSP目录) — 这不符合覆盖模型。
  • -t jetson_<major.minor>
    — 将标签固定到BSP发布系列。从
    bsp_image.version
    派生,截断为前两个点分组件:
    "38.4.0"
    jetson_38.4
    标签格式 fallback:如果被拒绝,尝试
    jetson_<bsp_image.version>
    (旧版L4T有时使用完整格式)。如果仍然失败,则显示错误并停止 — 绝不静默回退到"latest"。
如果
source_sync.sh
不存在则拒绝执行:重新运行
/jetson-init-image
以重新填充
Linux_for_Tegra/source/
即使所有克隆失败,
source_sync.sh
也会返回0 — 通过统计输出中的
Failed to clone
行数进行验证,如果行数非零则拒绝执行。普遍失败的最可能原因是git出口被阻止,无法访问
gitlab.com/nvidia/nv-tegra
/
nv-tegra.nvidia.com
;需明确告知用户,并引导用户通过
/quick-start
下载
public_sources.tbz2
以使用Branch A。

Branch C — Customer git clone (
url:
override)

Branch C — 客户Git克隆(
url:
覆盖)

Triggered by an explicit
url:
field. Clone the customer repo once and expose its canonical kernel-side sub-paths under
<source.root_path>/bsp_sources/
. The canonical sub-path list is read from source_sync.sh's
SOURCE_INFO
at runtime
— do not hard-code it, so future NVIDIA additions/removals propagate automatically:
bash
undefined
由显式的
url:
字段触发。克隆一次客户仓库,并将其标准内核端子路径暴露在
<source.root_path>/bsp_sources/
下。标准子路径列表在运行时从source_sync.sh的
SOURCE_INFO
读取
— 请勿硬编码,以便自动适配NVIDIA未来的添加/移除操作:
bash
undefined

Parse canonical sub-paths from source_sync.sh's SOURCE_INFO

从source_sync.sh的SOURCE_INFO解析标准子路径

(only the kernel-side entries marked
k:
in the second field).

(仅第二个字段标记为
k:
的内核端条目)。

SUBPATHS=$(grep -oP '^\sk:[^:]+:'
"<bsp_image.root_path>/Linux_for_Tegra/source/source_sync.sh"
| sed 's/^\s
k://; s/:$//')
mkdir -p "<source.root_path>/bsp_sources" CLONE="<source.root_path>/.repos/bsp_sources" git clone <url> -b <ref> "$CLONE" ROOT="$CLONE/<subdir or .>" for SUB in $SUBPATHS; do [ -d "$ROOT/$SUB" ] &&
ln -s "$ROOT/$SUB" "<source.root_path>/bsp_sources/$SUB" done

Report any canonical sub-path expected for the active chip family
but not present inside the customer repo (warn, don't refuse —
customer may legitimately not have all repos).
SUBPATHS=$(grep -oP '^\sk:[^:]+:'
"<bsp_image.root_path>/Linux_for_Tegra/source/source_sync.sh"
| sed 's/^\s
k://; s/:$//')
mkdir -p "<source.root_path>/bsp_sources" CLONE="<source.root_path>/.repos/bsp_sources" git clone <url> -b <ref> "$CLONE" ROOT="$CLONE/<subdir or .>" for SUB in $SUBPATHS; do [ -d "$ROOT/$SUB" ] &&
ln -s "$ROOT/$SUB" "<source.root_path>/bsp_sources/$SUB" done

如果客户仓库中缺少当前芯片系列所需的标准子路径,需进行报告(仅警告,不拒绝执行 — 客户可能合法地不需要所有仓库)。

Resolve cross-compile toolchain

解析交叉编译工具链

The downstream
jetson-build-source
reads
source.toolchain
from this profile and exports it as
CROSS_COMPILE
. This step must land a valid prefix before init-source returns, or any subsequent kernel / OOT / DT build will refuse.
NVIDIA's official Crosstool-NG Toolchain gcc is the canonical toolchain for L4T.
jetson-download-bsp
owns any network fetch of
x-tools.tbz2
; this skill only discovers, extracts, validates, and writes the resolved prefix. Resolution follows a three-step ladder:
下游
jetson-build-source
会从配置文件读取
source.toolchain
并将其导出为
CROSS_COMPILE
。此步骤必须在init-source返回前确定有效的前缀,否则后续内核/OOT/DT构建将拒绝执行。
NVIDIA官方的Crosstool-NG Toolchain gcc是L4T的标准工具链。
jetson-download-bsp
负责网络获取
x-tools.tbz2
;该技能仅负责发现、提取、验证并写入解析后的前缀。解析遵循三步流程:

Auto-discover

自动发现

Look under
<workspace>/toolchain/x-tools/
for the Crosstool-NG layout — typically one of:
<workspace>/toolchain/x-tools/aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
<workspace>/toolchain/x-tools/aarch64-buildroot-linux-gnu/bin/aarch64-buildroot-linux-gnu-gcc
Glob:
<workspace>/toolchain/x-tools/aarch64-*-linux-gnu/bin/aarch64-*-linux-gnu-gcc
. If exactly one match, bind:
bash
TC_PREFIX=<absolute path to that .../bin/<triple>->   # trailing dash mandatory
Skip to "Write to profile" below. If zero matches, fall through to "Auto-extract from
Downloads/x-tools.tbz2
" below. If multiple, refuse with the list and ask the user to remove the unwanted ones (we never pick one silently among ambiguous installs — different Crosstool-NG flavors produce ABI- incompatible binaries).
<workspace>/toolchain/x-tools/
下查找Crosstool-NG布局 — 通常为以下路径之一:
<workspace>/toolchain/x-tools/aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
<workspace>/toolchain/x-tools/aarch64-buildroot-linux-gnu/bin/aarch64-buildroot-linux-gnu-gcc
使用通配符:
<workspace>/toolchain/x-tools/aarch64-*-linux-gnu/bin/aarch64-*-linux-gnu-gcc
。如果恰好找到一个匹配项,则绑定:
bash
TC_PREFIX=<.../bin/<triple>-的绝对路径>   # 必须包含末尾的短横线
跳至下方的「写入配置文件」步骤。如果未找到匹配项,则继续执行「从
Downloads/x-tools.tbz2
自动提取」步骤。如果找到多个匹配项,则拒绝执行并列出所有匹配项,要求用户移除不需要的版本(我们从不静默选择模糊安装中的某一个 — 不同Crosstool-NG版本会生成ABI不兼容的二进制文件)。

Auto-extract from
Downloads/x-tools.tbz2

Downloads/x-tools.tbz2
自动提取

If
<workspace>/Downloads/x-tools.tbz2
exists (mirrors the
public_sources.tbz2
Branch-A pattern in the "Materialize the BSP-sources baseline" step — air-gapped / no-egress users drop archives there):
bash
file -b "<workspace>/Downloads/x-tools.tbz2" | grep -q "bzip2 compressed" || \
  refuse "<workspace>/Downloads/x-tools.tbz2 is not a bzip2 tarball"
mkdir -p "<workspace>/toolchain"
tar xjf "<workspace>/Downloads/x-tools.tbz2" -C "<workspace>/toolchain"
Then re-run the "Auto-discover" pass above. Refuse if extraction succeeds but no
x-tools/aarch64-*-linux-gnu/bin/
is produced (archive content doesn't match the Crosstool-NG layout).
如果
<workspace>/Downloads/x-tools.tbz2
存在(与「生成BSP-sources基线」步骤中的Branch-A模式
public_sources.tbz2
类似 — 离线/无出口用户可将归档放置在此处):
bash
file -b "<workspace>/Downloads/x-tools.tbz2" | grep -q "bzip2 compressed" || \
  refuse "<workspace>/Downloads/x-tools.tbz2不是bzip2压缩包"
mkdir -p "<workspace>/toolchain"
tar xjf "<workspace>/Downloads/x-tools.tbz2" -C "<workspace>/toolchain"
然后重新执行上方的「自动发现」步骤。如果提取成功但未生成
x-tools/aarch64-*-linux-gnu/bin/
,则拒绝执行(归档内容不符合Crosstool-NG布局)。

Prompt the user

提示用户

If both Auto-discover and Auto-extract came up empty, ask:
No Crosstool-NG toolchain found at
<workspace>/toolchain/
or in
<workspace>/Downloads/x-tools.tbz2
.
Reply with one of:
  • absolute path to your
    aarch64-*-linux-gnu-gcc
    binary or its containing
    bin/
    directory,
  • cancel
    to abort.
To fetch the archive instead, cancel this run, run
/jetson-download-bsp
, then re-run
/jetson-init-source
.
For a path reply, validate via
[ -f "${TC_PREFIX}gcc" ]
. Refuse and re-prompt on failure.
如果自动发现和自动提取均失败,则询问:
<workspace>/toolchain/
<workspace>/Downloads/x-tools.tbz2
中未找到Crosstool-NG工具链。
请回复以下内容之一:
  • aarch64-*-linux-gnu-gcc
    二进制文件的绝对路径或其所在的
    bin/
    目录路径
  • cancel
    以中止操作
如果需要获取归档,请取消本次运行,执行
/jetson-download-bsp
,然后重新运行
/jetson-init-source
对于路径回复,通过
[ -f "${TC_PREFIX}gcc" ]
进行验证。如果验证失败,则拒绝并重新提示。

Write to profile

写入配置文件

Once
$TC_PREFIX
resolves and
${TC_PREFIX}gcc
exists, write it into the active profile using a round-tripping YAML loader:
yaml
source:
  toolchain: <TC_PREFIX>   # absolute, with trailing dash
If
source:
is otherwise empty (no
root_path
override, no
repos:
entries), the
source:
block is now non-empty and stays in the profile. Future
jetson-init-source
runs skip the "Resolve cross-compile toolchain" step if
source.toolchain
is already set and points at a working
gcc
.
一旦
$TC_PREFIX
解析完成且
${TC_PREFIX}gcc
存在,使用支持往返的YAML加载器将其写入激活配置文件:
yaml
source:
  toolchain: <TC_PREFIX>   # 绝对路径,包含末尾的短横线
如果
source:
块原本为空(无
root_path
覆盖,无
repos:
条目),则
source:
块现在变为非空并保留在配置文件中。如果
source.toolchain
已设置且指向可用的
gcc
,未来的
jetson-init-source
运行将跳过「解析交叉编译工具链」步骤

Clone extra user-defined repos

克隆用户定义的额外仓库

For each entry under
source.repos:
whose name is not
Linux_for_Tegra
or
bsp_sources
:
bash
MOUNT="<source.root_path>/<entry.path or entry.name>"
if [ -n "<entry.subdir>" ]; then
  CLONE="<source.root_path>/.repos/<entry.name>"
  git clone <entry.url> -b <entry.ref> "$CLONE"
  ln -s "$CLONE/<entry.subdir>" "$MOUNT"
else
  git clone <entry.url> -b <entry.ref> "$MOUNT"
fi
Refuse if a mount path already exists with unrelated content.
对于
source.repos:
下名称不是
Linux_for_Tegra
bsp_sources
的每个条目:
bash
MOUNT="<source.root_path>/<entry.path or entry.name>"
if [ -n "<entry.subdir>" ]; then
  CLONE="<source.root_path>/.repos/<entry.name>"
  git clone <entry.url> -b <entry.ref> "$CLONE"
  ln -s "$CLONE/<entry.subdir>" "$MOUNT"
else
  git clone <entry.url> -b <entry.ref> "$MOUNT"
fi
如果挂载路径已存在且包含无关内容,则拒绝执行。

Summary

总结

Print:
  • Resolved
    <workspace>
    ,
    <bsp_image.root_path>
    , and
    <source.root_path>
    .
  • For each materialized component: created, reused, skipped, or refused.
  • For
    bsp_sources
    : branch selected plus key evidence (archive path,
    source_sync.sh
    failure count, or clone URL/ref).
  • Toolchain prefix, resolution source, and
    ${TC_PREFIX}gcc --version
    first line.
  • Reminder that customize-* skills stage future BSP edits in
    <source.root_path>/Linux_for_Tegra/
    ; promote is what later copies committed overlay changes into
    bsp_image
    .
If a downstream skill triggered this run, tell the user to re-issue their original request.
打印以下内容:
  • 解析后的
    <workspace>
    <bsp_image.root_path>
    <source.root_path>
  • 每个生成组件的状态:已创建、已复用、已跳过或已拒绝。
  • bsp_sources
    的分支选择情况及关键依据(归档路径、
    source_sync.sh
    失败次数或克隆URL/ref)。
  • 工具链前缀、解析来源以及
    ${TC_PREFIX}gcc --version
    的第一行输出。
  • 提醒用户:定制类技能会将未来的BSP修改暂存到
    <source.root_path>/Linux_for_Tegra/
    ;后续的promote操作会将已提交的覆盖变更复制到
    bsp_image
如果本次运行由下游技能触发,告知用户重新发出原始请求。

Gotchas

注意事项

  • Linux_for_Tegra
    and
    bsp_sources
    mount paths are canonical.
    path:
    applies only to extra user-defined repos.
  • The default
    Linux_for_Tegra
    tracker is intentionally empty; do not pre-populate it.
  • bsp_sources
    precedence is
    url:
    archive:
    → auto-discovered
    Downloads/public_sources.tbz2
    source_sync.sh
    .
    url:
    and
    archive:
    are mutually exclusive.
  • Branch A auto-discovery does not prompt and is not written back to the profile. Persist it only with
    source.repos.bsp_sources.archive:
    .
  • Branch A
    $DEST/Makefile
    collision.
    Inner tarballs in
    public_sources.tbz2
    ship two files named
    Makefile
    : the Tegra orchestrator (
    kernel_oot_modules_src.tbz2
    ) and the dGPU/OpenRM proprietary Makefile (
    nvidia_kernel_display_driver_source_without_ root_dir.tbz2
    ). Alphabetical extraction order lets the dGPU one win on R36.x; downstream arm64 cross-builds then fail with
    '-mlittle-endian' unrecognized
    . Step 3a force-replaces from
    <bsp_image>/Linux_for_Tegra/source/Makefile
    when the Tegra
    modules: hwpm nvidia-oot nvgpu nvidia-display
    signature is missing. R38+ extractions already match; the check is a no-op there.
  • Branch C customer repos must expose the canonical
    source_sync.sh
    sub-path layout, optionally shifted by
    subdir:
    .
  • Derive the
    source_sync.sh
    tag from
    bsp_image.version
    as
    jetson_<major.minor>
    first; never fall back to an unpinned latest.
  • jetson-download-bsp
    owns network downloads of
    public_sources.tbz2
    and
    x-tools.tbz2
    ; this skill consumes local archives only.
  • source.toolchain
    must be an NVIDIA Crosstool-NG prefix with trailing dash and a working
    ${prefix}gcc
    . Never silently use
    $PATH
    .
  • Use a round-tripping YAML writer for profile edits.
  • Linux_for_Tegra
    bsp_sources
    的挂载路径为标准路径。
    path:
    仅适用于用户定义的额外仓库。
  • 默认的
    Linux_for_Tegra
    跟踪器故意为空;请勿预先填充内容。
  • bsp_sources
    的优先级为
    url:
    archive:
    → 自动发现的
    Downloads/public_sources.tbz2
    source_sync.sh
    url:
    archive:
    互斥。
  • Branch A自动发现不会提示,也不会写回配置文件。仅当设置
    source.repos.bsp_sources.archive:
    时才会持久化。
  • Branch A的
    $DEST/Makefile
    冲突
    public_sources.tbz2
    中的内部压缩包包含两个名为
    Makefile
    的文件:Tegra编排器(
    kernel_oot_modules_src.tbz2
    )和dGPU/OpenRM专有Makefile(
    nvidia_kernel_display_driver_source_without_root_dir.tbz2
    )。在R36.x版本中,按字母顺序提取会让dGPU的Makefile覆盖Tegra的;下游arm64交叉构建随后会因
    '-mlittle-endian' unrecognized
    失败。步骤3a会在缺少Tegra的
    modules: hwpm nvidia-oot nvgpu nvidia-display
    签名时,从
    <bsp_image>/Linux_for_Tegra/source/Makefile
    强制替换。R38+版本的提取已修复此问题,该检查会自动跳过。
  • Branch C的客户仓库必须暴露
    source_sync.sh
    定义的标准子路径布局,可通过
    subdir:
    调整根目录。
  • bsp_image.version
    派生
    source_sync.sh
    的标签时,优先使用
    jetson_<major.minor>
    ;绝不回退到未固定的latest版本。
  • jetson-download-bsp
    负责网络下载
    public_sources.tbz2
    x-tools.tbz2
    ;该技能仅使用本地归档。
  • source.toolchain
    必须是带有末尾短横线的NVIDIA Crosstool-NG前缀,且
    ${prefix}gcc
    可用。绝不静默使用
    $PATH
  • 编辑配置文件时使用支持往返的YAML写入器。

Prerequisites

前置条件

  • Active target profile resolved per
    ../../context/target-platform-contract.md
    .
  • /jetson-init-image
    already run so
    bsp_image.version
    is recorded (Branch B
    source_sync.sh
    tag derives from it).
  • For Branch A: a local
    public_sources.tbz2
    (and optionally
    x-tools.tbz2
    ) staged under
    Downloads/
    .
  • For Branch C: customer Git access to the override repo URL.
  • 根据
    ../../context/target-platform-contract.md
    解析激活目标配置文件。
  • 已运行
    /jetson-init-image
    ,因此
    bsp_image.version
    已记录(Branch B的
    source_sync.sh
    标签由此派生)。
  • 对于Branch A:
    Downloads/
    下已放置本地
    public_sources.tbz2
    (可选
    x-tools.tbz2
    )。
  • 对于Branch C:客户拥有覆盖仓库URL的Git访问权限。

Limitations

限制

  • Owns only the
    source:
    block; never edits
    bsp_image
    ,
    reference_devkit
    ,
    custom_carrier
    , or
    documents
    .
  • Network egress only for Branch B (
    source_sync.sh
    ) and Branch C (customer Git clone); Branch A is fully offline.
  • Refuses to silently substitute a system toolchain — the NVIDIA Crosstool-NG prefix must be present or extractable.
  • 仅负责
    source:
    块;绝不修改
    bsp_image
    reference_devkit
    custom_carrier
    documents
  • 仅在Branch B(
    source_sync.sh
    )和Branch C(客户Git克隆)时使用网络出口;Branch A完全离线。
  • 拒绝静默替换系统工具链 — 必须存在或可提取NVIDIA Crosstool-NG前缀。

Troubleshooting

故障排除

  • ${toolchain}gcc
    not found
    — re-stage
    x-tools.tbz2
    under
    Downloads/
    and rerun, or pass a verified absolute prefix path.
  • source_sync.sh
    cannot resolve
    jetson_<major.minor>
    tag
    — the recorded
    bsp_image.version
    is wrong; re-run
    /jetson-init-image
    to refresh it.
  • Linux_for_Tegra/.git
    shows uncommitted hand-edits
    — abort and ask the user to commit or stash; this skill expects a clean tracker.
  • Branch C clone missing canonical sub-paths — repo layout doesn't match
    source_sync.sh
    ; set
    subdir:
    to the right sub-root or fall back to multi-repo overrides under
    source.repos:
    .
  • ${toolchain}gcc
    未找到
    — 将
    x-tools.tbz2
    重新放置到
    Downloads/
    下并重新运行,或传入已验证的绝对前缀路径。
  • source_sync.sh
    无法解析
    jetson_<major.minor>
    标签
    — 记录的
    bsp_image.version
    错误;重新运行
    /jetson-init-image
    以刷新。
  • Linux_for_Tegra/.git
    显示未提交的手动修改
    — 中止操作,要求用户提交或暂存修改;该技能要求跟踪器处于干净状态。
  • Branch C克隆缺少标准子路径 — 仓库布局与
    source_sync.sh
    不匹配;设置
    subdir:
    为正确的子根目录,或回退到
    source.repos:
    下的多仓库覆盖。

References

参考资料

  • ../../references/platform_template.yaml
    source:
    schema, including the
    repos:
    map.
  • ../../context/target-platform-contract.md
    — target-platform contract.
  • ../../context/bsp-customization-workflow.md
    — Workspace edit protocol.
  • ../jetson-init-target/SKILL.md
    — authors the profile this skill consumes.
  • ../jetson-init-image/SKILL.md
    — extracts the BSP and back-fills
    bsp_image.version
    ; run before this skill.
  • ../../references/platform_template.yaml
    source:
    架构,包括
    repos:
    映射。
  • ../../context/target-platform-contract.md
    — 目标平台协议。
  • ../../context/bsp-customization-workflow.md
    — 工作区编辑协议。
  • ../jetson-init-target/SKILL.md
    — 该技能所使用的配置文件的创建者。
  • ../jetson-init-image/SKILL.md
    — 提取BSP并回填
    bsp_image.version
    ;需在该技能之前运行。