jetson-init-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInitialize BSP Image
初始化BSP镜像
Output is only in the active profile: derived
plus only when overriding .
bsp_image:versionroot_path<workspace>/Image输出仅为当前配置文件中的:包含推导的,仅当覆盖时才会添加。
bsp_image:version<workspace>/Imageroot_pathWhen to invoke
调用时机
- The user asks to extract, prepare, or initialize the BSP image.
- A downstream skill reports missing
.
<bsp_image.root_path>/Linux_for_Tegra/ - The active profile has no block yet.
bsp_image:
- 用户要求提取、准备或初始化BSP镜像时。
- 下游技能报告缺少时。
<bsp_image.root_path>/Linux_for_Tegra/ - 当前配置文件中尚未存在块时。
bsp_image:
Procedure
操作流程
Resolve target and image path
解析目标与镜像路径
Resolve the active profile per
.
Refuse if there is no active profile or is missing.
../../context/target-platform-contract.mdreference_devkit:<workspace>target-platform/<bsp_image.root_path><workspace>/Image| Profile state | Action |
|---|---|
| Use it without prompting. |
| Use |
No | Ask once: Enter for default, or absolute override path. |
For an override, validate that the closest existing parent is writable.
Omit when the default is used.
root_path根据解析当前配置文件。若不存在当前配置文件或缺少,则拒绝执行。
../../context/target-platform-contract.mdreference_devkit:<workspace>target-platform/<bsp_image.root_path><workspace>/Image| 配置文件状态 | 操作 |
|---|---|
| 直接使用该路径,无需提示。 |
| 使用 |
无 | 询问一次:直接回车使用默认路径,或输入绝对路径进行覆盖。 |
若使用覆盖路径,需验证其最近的现有父目录是否可写入。使用默认路径时,省略。
root_pathDetermine GPU stack
确定GPU栈
Use the shared GPU-driver invariant from
.
Derive the expected stack from and the
catalogue:
../../context/target-platform-contract.mdreference_devkit.module.id| Chip family | Module IDs | Stack | |
|---|---|---|---|
| T234 / Orin | | nvgpu | none |
| T264 and later / Thor+ | | OpenRM | |
Refuse unknown module IDs. The flag is only valid on BSP
releases that ship the OpenRM stack; if the active BSP doesn't expose
the flag, omit it regardless of what the target wants.
--openrm使用中共享的GPU驱动不变量。根据和目录推导预期的栈:
../../context/target-platform-contract.mdreference_devkit.module.id| 芯片系列 | 模块ID | 栈 | |
|---|---|---|---|
| T234 / Orin | | nvgpu | 无 |
| T264及后续 / Thor+ | | OpenRM | |
若遇到未知模块ID则拒绝执行。参数仅在包含OpenRM栈的BSP版本中有效;若当前BSP不支持该参数,无论目标需求如何,均省略该参数。
--openrmReuse or extract
复用或提取
If already exists:
<bsp_image.root_path>/Linux_for_Tegra/-
Do not extract over it unless the user explicitly requested re-extraction and accepted the overwrite risk.
-
Derive the on-disk version from. Ask before replacing a different recorded
Linux_for_Tegra/nv_tegra_release.bsp_image.version -
Verify the installed GPU stack against the platform-derived expectation when possible. Detection precedence (first probe that yields a definitive answer wins):
- carries an
Linux_for_Tegra/rootfs/etc/nv_tegra_releasetoken on BSP releases that expose it (newer lines). Read and compare directly.INSTALL_TYPE= - Otherwise, : present → nvgpu, absent → OpenRM.
find Linux_for_Tegra -name nvgpu.ko - If the chip family has only ever shipped one stack (e.g. T234 / Orin is always nvgpu in current BSPs), fall back to the catalogue-derived expectation without disk probing.
If the installed stack conflicts with the active target, refuse and ask
the user to re-extract with the correct stack or fix the target profile.
Otherwise skip extraction and update the profile.
若已存在:
<bsp_image.root_path>/Linux_for_Tegra/-
除非用户明确要求重新提取并接受覆盖风险,否则不得覆盖现有内容。
-
从推导磁盘上的版本。若与已记录的
Linux_for_Tegra/nv_tegra_release不同,需询问用户后再替换。bsp_image.version -
尽可能验证已安装的GPU栈是否符合平台推导的预期。检测优先级(首个得出明确结果的探测方式生效):
- 在部分BSP版本(较新版本)中,包含
Linux_for_Tegra/rootfs/etc/nv_tegra_release标记。直接读取并对比。INSTALL_TYPE= - 若上述方式不可行,执行:若存在则为nvgpu,不存在则为OpenRM。
find Linux_for_Tegra -name nvgpu.ko - 若该芯片系列仅支持一种栈(例如当前BSP中T234 / Orin始终使用nvgpu),则直接使用目录推导的预期结果,无需探测磁盘。
- 在部分BSP版本(较新版本)中,
若已安装的栈与当前目标冲突,拒绝执行并要求用户重新提取正确的栈或修复目标配置文件。否则跳过提取步骤并更新配置文件。
Locate tarballs
定位压缩包
When extraction is needed, search:
<bsp_image.root_path>/<workspace>/- current working directory
Prompt for absolute paths for anything missing. Required filenames:
Jetson_Linux_R<ver>_aarch64.tbz2Tegra_Linux_Sample-Root-Filesystem_R<ver>_aarch64.tbz2
Both filenames must contain the same token. Refuse mismatches
and record as . Do not download tarballs.
R<ver><ver>bsp_image.version当需要提取时,按以下顺序搜索:
<bsp_image.root_path>/<workspace>/- 当前工作目录
若缺少文件,提示用户输入绝对路径。所需文件名:
Jetson_Linux_R<ver>_aarch64.tbz2Tegra_Linux_Sample-Root-Filesystem_R<ver>_aarch64.tbz2
两个文件名必须包含相同的标记。若版本不匹配则拒绝执行,并将记录为。不提供压缩包下载功能。
R<ver><ver>bsp_image.versionExtract and apply binaries
提取并应用二进制文件
Use absolute tarball paths; they may live outside
.
<bsp_image.root_path>bash
ROOT="<bsp_image.root_path>"
BSP_TARBALL="<absolute path to Jetson_Linux_R<ver>_aarch64.tbz2>"
ROOTFS_TARBALL="<absolute path to Tegra_Linux_Sample-Root-Filesystem_R<ver>_aarch64.tbz2>"
mkdir -p "$ROOT"
tar xjf "$BSP_TARBALL" -C "$ROOT"
sudo tar xpjf "$ROOTFS_TARBALL" -C "$ROOT/Linux_for_Tegra/rootfs"
cd "$ROOT/Linux_for_Tegra"
if [ "$GPU_STACK" = "openrm" ]; then
sudo ./apply_binaries.sh --openrm
else
sudo ./apply_binaries.sh
fiSet from the "Determine GPU stack" step above. Abort on the first failing command and
surface the failed command.
GPU_STACK使用压缩包的绝对路径;它们可能位于之外。
<bsp_image.root_path>bash
ROOT="<bsp_image.root_path>"
BSP_TARBALL="<absolute path to Jetson_Linux_R<ver>_aarch64.tbz2>"
ROOTFS_TARBALL="<absolute path to Tegra_Linux_Sample-Root-Filesystem_R<ver>_aarch64.tbz2>"
mkdir -p "$ROOT"
tar xjf "$BSP_TARBALL" -C "$ROOT"
sudo tar xpjf "$ROOTFS_TARBALL" -C "$ROOT/Linux_for_Tegra/rootfs"
cd "$ROOT/Linux_for_Tegra"
if [ "$GPU_STACK" = "openrm" ]; then
sudo ./apply_binaries.sh --openrm
else
sudo ./apply_binaries.sh
fiGPU_STACKUpdate the active profile
更新当前配置文件
Persist the resolved BSP image metadata in the active target profile so
later skills can find the BSP without re-prompting. Preserve existing
blocks, comments, and quoted SKU values; use a round-tripping YAML
writer such as .
ruamel.yamlyaml
bsp_image:
root_path: <absolute override path> # omit for <workspace>/Image
version: "<derived version>"Rules:
- Same version and same root path: no rewrite.
- Different version: ask before updating.
- Different recorded : refuse automatic rewrite.
root_path - Always quote .
version
将解析后的BSP镜像元数据持久化到当前目标配置文件中,以便后续技能无需重新提示即可找到BSP。保留现有块、注释和带引号的SKU值;使用支持往返的YAML写入工具(如)。
ruamel.yamlyaml
bsp_image:
root_path: <absolute override path> # 使用<workspace>/Image时省略
version: "<derived version>"规则:
- 版本和根路径均相同:不重写。
- 版本不同:询问用户后再更新。
- 已记录的不同:拒绝自动重写。
root_path - 始终需加引号。
version
Finish
完成
Report the image path, extracted vs reused state, GPU stack, derived
version, and profile update status. Then suggest .
/jetson-init-source报告镜像路径、提取/复用状态、GPU栈、推导的版本以及配置文件更新状态。然后建议使用。
/jetson-init-sourcePurpose
目的
Materialize on disk by extracting the right Jetson
Linux + sample-rootfs tarballs and running with
the GPU-stack flag derived from the active target (nvgpu for T234,
OpenRM for T264+). Then commit the derived BSP version into the
profile's block.
Linux_for_Tegra/apply_binaries.shbsp_image:通过提取正确的Jetson Linux和sample-rootfs压缩包,并根据当前目标推导的GPU栈参数(T234使用nvgpu,T264+使用OpenRM)运行,在磁盘上生成目录。然后将推导的BSP版本提交到配置文件的块中。
apply_binaries.shLinux_for_Tegra/bsp_image:Prerequisites
前提条件
- Active target profile resolved per
.
../../context/target-platform-contract.md - Jetson Linux BSP tarball and matching sample-rootfs tarball staged
on disk (e.g. by or hand-placed).
/jetson-download-bsp - Write access to the workspace root (or the override
Image/).bsp_image.root_path - available for
sudo.apply_binaries.sh
- 已根据解析出当前目标配置文件。
../../context/target-platform-contract.md - Jetson Linux BSP压缩包和匹配的sample-rootfs压缩包已存放在磁盘上(例如通过或手动放置)。
/jetson-download-bsp - 对工作区根目录(或覆盖的
Image/)具有写入权限。bsp_image.root_path - 可使用执行
sudo。apply_binaries.sh
Limitations
限制
- Writes only the block; source tree, documents, and carrier profile are owned by sibling skills.
bsp_image: - Refuses to overwrite an existing without explicit user direction.
Linux_for_Tegra/ - Does not download tarballs; rely on or hand-stage the inputs.
/jetson-download-bsp
- 仅写入块;源码树、文档和载体配置文件由同级技能负责。
bsp_image: - 若无明确用户指令,拒绝覆盖已存在的目录。
Linux_for_Tegra/ - 不提供压缩包下载功能;依赖或手动准备输入文件。
/jetson-download-bsp
Troubleshooting
故障排除
- exits non-zero — re-read its console output; most failures are missing
apply_binaries.sh, missing rootfs tarball, or wrong GPU stack flag for the SoC generation.sudo - absent after extract — extraction stopped early; verify tarball integrity and rerun.
nv_tegra_release - Recorded disagrees with the tarball filename — the tarball was renamed; trust the value parsed from
versionover filenames.Linux_for_Tegra/nv_tegra_release - Different recorded already in profile — refuse and ask the user to confirm before overwriting.
root_path
- 非零退出 — 重新查看其控制台输出;大多数失败原因是缺少
apply_binaries.sh、缺少rootfs压缩包或针对SoC世代使用了错误的GPU栈参数。sudo - 提取后缺少— 提取过程提前终止;验证压缩包完整性后重新运行。
nv_tegra_release - 已记录的与压缩包文件名不一致 — 压缩包已被重命名;优先信任从
version解析的值,而非文件名。Linux_for_Tegra/nv_tegra_release - 配置文件中已存在不同的记录 — 拒绝执行,要求用户确认后再覆盖。
root_path
References
参考资料
../../context/target-platform-contract.md../../references/bsp-platforms-catalogue.md../../references/platform_template.yaml../jetson-init-target/SKILL.md../jetson-init-source/SKILL.md../jetson-flash-image/SKILL.md
../../context/target-platform-contract.md../../references/bsp-platforms-catalogue.md../../references/platform_template.yaml../jetson-init-target/SKILL.md../jetson-init-source/SKILL.md../jetson-flash-image/SKILL.md