jetson-promote-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePromote BSP Image
推广BSP镜像
Purpose
目的
Stage every Customize-* and Build output into so it is
ready for . This is the promote leg of
Deploy — it copies files, never flashes and never builds.
bsp_image/jetson-flash-image将所有Customize-*和构建输出暂存到中,使其为做好准备。这是部署流程的推广环节——仅执行文件复制操作,绝不进行烧录或构建。
bsp_image/jetson-flash-imagePrerequisites
前置条件
- Active target-platform profile with both and
source:resolved (runbsp_image:and/jetson-init-sourcefirst)./jetson-init-image - initialized as a git repo (overlay tracker) with a clean working tree.
<source.root_path>/Linux_for_Tegra/ - extracted from a BSP tarball +
<bsp_image.root_path>/Linux_for_Tegra/already run.apply_binaries.sh - ,
git,yq, andcmp(forsudodestinations) on the host.rootfs/* - +
<source.root_path>/.build-manifest.yamlfrom.build-state.yaml(required when kernel-side repos have customize-* commits)./jetson-build-source
- 已激活的目标平台配置文件,且和
source:均已解析(需先运行bsp_image:和/jetson-init-source)。/jetson-init-image - 已初始化为git仓库(覆盖跟踪器),且工作树干净。
<source.root_path>/Linux_for_Tegra/ - 已从BSP压缩包解压完成,且已执行
<bsp_image.root_path>/Linux_for_Tegra/。apply_binaries.sh - 主机上已安装、
git、yq和cmp(用于sudo目标路径)。rootfs/* - 存在来自的
/jetson-build-source+<source.root_path>/.build-manifest.yaml(当内核端仓库包含customize-*提交时为必需)。.build-state.yaml
Overview
概述
This is the promote leg of Deploy — see
for the pipeline view. The two channels this skill walks are:
../../context/bsp-customization-workflow.md| Channel | Source | Carrier | Owner |
|---|---|---|---|
| Overlay tracker | | Customize-* outputs that don't require a build (e.g. | Customize |
| Build manifest | | Rebuilt kernel | Build |
The skill computes the union of files to copy and writes each into
with diff-aware
skip-if-identical logic. When the copy pass touches the kernel
or anything under , it also rebuilds
the initramfs via NVIDIA's so the
freshly promoted kernel + modules ship in the initrd the
bootloader actually loads. After it returns, carries
every Customize and Build output. The skill does not flash and
does not modify the workspace.
<bsp_image.root_path>/Linux_for_Tegra/Imagerootfs/lib/modules/tools/l4t_update_initrd.shbsp_image这是部署流程的推广环节——如需查看流水线视图,请参阅。本技能涉及两个渠道:
../../context/bsp-customization-workflow.md| 渠道 | 源路径 | 承载内容 | 维护方 |
|---|---|---|---|
| 覆盖跟踪器 | | 无需构建的Customize-*输出(例如 | Customize类 |
| 构建清单 | | 重新构建的内核 | Build类 |
本技能计算需要复制的文件集合,并将每个文件写入,同时采用差异感知的“内容相同则跳过”逻辑。当复制操作涉及内核或下的任何文件时,还会通过NVIDIA的重新构建initramfs,确保新推广的内核和模块包含在引导加载程序实际加载的initrd中。执行完成后,将包含所有Customize和Build输出。本技能绝不执行烧录操作,也绝不修改工作区。
<bsp_image.root_path>/Linux_for_Tegra/Imagerootfs/lib/modules/tools/l4t_update_initrd.shbsp_imageWhen to invoke
调用时机
- First leg of the typical Deploy chain
.
jetson-promote-image → jetson-flash-image → jetson-validate-image - Standalone, when the user wants updated but isn't ready to flash yet (e.g. to inspect resolved files, run an out-of-band build that reads bsp_image, or hand bsp_image to a separate flashing host).
bsp_image
- 典型部署链的第一个环节:。
jetson-promote-image → jetson-flash-image → jetson-validate-image - 独立调用场景:用户希望更新但暂不准备烧录时(例如检查解析后的文件、运行读取bsp_image的离线构建,或将bsp_image交付给单独的烧录主机)。
bsp_image
Procedure
操作步骤
Resolve active target + paths
解析激活的目标与路径
Resolve the active profile per the contract in
.
../../context/target-platform-contract.mdRefuse and route in these cases:
| Condition | Refuse with |
|---|---|
No active profile, or | Route to |
Profile lacks | Route to |
| Route to |
| Route to |
Resolve paths:
- = parent of the active profile's
<workspace>directory (discovered at load time).target-platform/ - from
<bsp_image.root_path>if present, elsebsp_image.root_path:.<workspace>/Image - from
<source.root_path>if present, elsesource.root_path:.<workspace>/Source
Bind shell variables for the rest of the procedure:
bash
LFT_SRC="<source.root_path>/Linux_for_Tegra" # overlay tracker
LFT_DST="<bsp_image.root_path>/Linux_for_Tegra"
MANIFEST="<source.root_path>/.build-manifest.yaml" # build outputs根据中的约定解析激活的配置文件。
../../context/target-platform-contract.md在以下情况下拒绝执行并引导用户操作:
| 条件 | 拒绝提示 |
|---|---|
无激活配置文件,或 | 引导至 |
配置文件缺少 | 引导至 |
| 引导至 |
| 引导至 |
解析路径:
- = 激活配置文件的
<workspace>目录的父目录(加载时自动发现)。target-platform/ - :若配置中存在
<bsp_image.root_path>则使用该值,否则为bsp_image.root_path:。<workspace>/Image - :若配置中存在
<source.root_path>则使用该值,否则为source.root_path:。<workspace>/Source
为后续步骤绑定shell变量:
bash
LFT_SRC="<source.root_path>/Linux_for_Tegra" # 覆盖跟踪器
LFT_DST="<bsp_image.root_path>/Linux_for_Tegra"
MANIFEST="<source.root_path>/.build-manifest.yaml" # 构建输出Validate the two channels
验证两个渠道
The skill needs at least one channel populated. Refuse if the
overlay tracker has uncommitted changes (
non-empty), if exists but doesn't parse as YAML, or
if both channels are empty. Records /
and for downstream steps.
status --porcelain$MANIFESTOVERLAY_HAS_COMMITSOVERLAY_HEADMANIFEST_PRESENTSee
for the shell snippet and refuse messages.
references/copy-pass-snippets.md本技能需要至少一个渠道包含内容。若覆盖跟踪器存在未提交的更改(输出非空)、存在但无法解析为YAML,或两个渠道均为空,则拒绝执行。记录 / 和供后续步骤使用。
status --porcelain$MANIFESTOVERLAY_HAS_COMMITSOVERLAY_HEADMANIFEST_PRESENT有关shell代码片段和拒绝提示,请参阅。
references/copy-pass-snippets.mdVerify build-source freshness
验证构建源的新鲜度
Refuse if shows any kernel-side repo in
dirty since the last
— otherwise the copy pass would silently ship stale artifacts.
Detection rules + shell snippet in
.
Records .
.build-state.yamlSource/bsp_sources//jetson-build-sourcereferences/build-source-freshness-gate.mdBUILD_FRESH=1若显示下的任何内核端仓库自上次运行后发生更改,则拒绝执行——否则复制操作会静默交付过时的产物。检测规则和shell代码片段请参阅。记录。
.build-state.yamlSource/bsp_sources//jetson-build-sourcereferences/build-source-freshness-gate.mdBUILD_FRESH=1Pre-promote collision check (overlay only)
推广前冲突检查(仅覆盖渠道)
When the overlay tracks a remote, refuse if upstream has commits
not yet pulled. Skip gracefully when no remote is configured
(the default empty tracker from ).
Manifest channel has no git remote concept — this check is
overlay-only. Records for the Summary.
git initjetson-init-sourceCOLLISION_CHECKSee
for the shell snippet.
references/copy-pass-snippets.md当覆盖跟踪器关联远程仓库时,若上游存在未拉取的提交则拒绝执行。当未配置远程仓库时(默认创建的空git跟踪器),则跳过此检查。构建清单渠道无git远程仓库概念——此检查仅适用于覆盖渠道。记录供摘要使用。
jetson-init-sourceCOLLISION_CHECK有关shell代码片段,请参阅。
references/copy-pass-snippets.mdEnumerate sources (both channels)
枚举源文件(两个渠道)
Channel A — overlay: against is
the source of truth (transparent to symlink mounts when
was overridden, excludes
untracked / d files). Each entry maps
→ .
git ls-files$LFT_SRCsource.repos.Linux_for_Tegra.gitignoresrc = $LFT_SRC/<rel>dst = $LFT_DST/<rel>Channel B — manifest: parse from
. Refuse if any is missing on disk (build was
interrupted, or manifest stale — re-run ).
The manifest schema is written by
v0.2.0.
artifacts[].{src,dst}$MANIFESTsrc/jetson-build-sourcejetson-build-sourceSee
for both shell snippets and the manifest YAML schema.
references/copy-pass-snippets.md渠道A — 覆盖:以为目标执行作为事实来源(当被覆盖时,对符号链接挂载透明,排除未跟踪或被忽略的文件)。每个条目映射为 → 。
$LFT_SRCgit ls-filessource.repos.Linux_for_Tegra.gitignoresrc = $LFT_SRC/<rel>dst = $LFT_DST/<rel>渠道B — 构建清单:从解析。若任何在磁盘上不存在(构建中断或清单过时),则拒绝执行并提示用户重新运行。清单 schema 由 v0.2.0定义。
$MANIFESTartifacts[].{src,dst}src/jetson-build-sourcejetson-build-source有关两个渠道的shell代码片段和清单YAML schema,请参阅。
references/copy-pass-snippets.mdDiff-aware copy into bsp_image
差异感知复制到bsp_image
Iterate the union of overlay files and manifest entries. For
each : if byte-identical, skip; otherwise (with
for destinations, where the sample rootfs
was extracted as root). Tag on any
or write — the
"Refresh initramfs" step gates on this flag. Counts /
/ are recorded for the Summary.
dstcp -psudorootfs/*INITRD_DIRTY=1rootfs/lib/modules/*kernel/ImageFIRSTLASTFail-fast: if any fails, surface the failed path and stop.
may be left partially updated — re-running after
fixing the cause resumes via the diff-aware skip. Channel
order is overlay first, then manifest: on a collision
the manifest wins (freshly built artifact beats the older
overlay copy).
cpbsp_imagedstSee
for the function and the two driving loops.
references/copy-pass-snippets.mdcopy_one()遍历覆盖文件和清单条目的并集。对于每个:若内容字节相同则跳过;否则执行(对于目标路径使用,因为示例根文件系统是以root权限解压的)。当写入或时标记——“刷新initramfs”步骤将基于此标志触发。记录复制计数、和供摘要使用。
dstcp -prootfs/*sudorootfs/lib/modules/*kernel/ImageINITRD_DIRTY=1FIRSTLAST快速失败:若任何操作失败,则显示失败路径并停止。可能处于部分更新状态——修复问题后重新运行,差异感知复制会跳过已推广的文件。渠道顺序:先覆盖渠道,再构建清单渠道:当路径冲突时,构建清单渠道优先(新构建的产物优于旧的覆盖副本)。
cpbsp_imagedst有关函数和两个驱动循环,请参阅。
copy_one()references/copy-pass-snippets.mdMirror kernel Image into rootfs (when kernel changed)
将内核Image镜像到rootfs(当内核更改时)
The kernel lives in two paths inside :
(read by the flash tool) and
(the rootfs-side copy, visible as
from inside the rootfs chroot the refresh tool
will run in). The build manifest only carries the
dst, so this step mirrors →
(diff-aware, no-op when already in sync) so the chrooted refresh
tool resolves the kernel against the freshly promoted binary,
not the stale rootfs copy. The mirror also sets
so a kernel-only promote (no writes) still
triggers the refresh.
Imagebsp_image<LFT_DST>/kernel/Image<LFT_DST>/rootfs/boot/Image/boot/Imagekernel/Imagekernel/Imagerootfs/boot/ImageINITRD_DIRTY=1rootfs/lib/modules/*See
for the shell snippet, the failure mode this prevents, and the
corner case.
references/kernel-image-and-initramfs.mdINITRD_DIRTY内核在中有两个路径:(供烧录工具读取)和(根文件系统侧副本,在刷新工具将运行的根文件系统chroot中可见为)。构建清单仅包含目标路径,因此此步骤将镜像到(差异感知,内容同步时无操作),确保chroot环境下的刷新工具使用新推广的二进制文件,而非过时的根文件系统副本。镜像操作还会设置,因此仅推广内核(未写入)时仍会触发刷新。
Imagebsp_image<LFT_DST>/kernel/Image<LFT_DST>/rootfs/boot/Image/boot/Imagekernel/Imagekernel/Imagerootfs/boot/ImageINITRD_DIRTY=1rootfs/lib/modules/*有关shell代码片段、此步骤避免的故障模式以及的边界情况,请参阅。
INITRD_DIRTYreferences/kernel-image-and-initramfs.mdRefresh initramfs (when kernel or modules changed)
刷新initramfs(当内核或模块更改时)
Run from whenever
(set by the diff-aware copy or the mirror step
above). The tool chroots into , runs NVIDIA's
, and writes both
(used by the flash tool)
and ( on the DUT).
Idempotent; ~30 s. Skip when (overlay-only
edits). DUT-side workarounds ( + manual
) are out of scope — fix the gap here so flash ships a
coherent image.
tools/l4t_update_initrd.sh<LFT_DST>/INITRD_DIRTY=1rootfs/nv-update-initrd<LFT_DST>/bootloader/l4t_initrd.img<LFT_DST>/rootfs/boot/initrd/boot/initrdINITRD_DIRTY=0update-initramfs -ucpSee
for the shell snippet, refuse paths, the "module shadowing" and
"vermagic skew" failure modes the rebuild closes, and why
(a different file) is left alone.
references/kernel-image-and-initramfs.mdbootloader/initrd每当(由差异感知复制或上述镜像步骤设置)时,从运行。该工具chroot到中,运行NVIDIA的,并写入(供烧录工具使用)和(DUT上的)。此操作具有幂等性,耗时约30秒。当(仅覆盖编辑)时跳过。DUT侧的解决方法( + 手动)不在本技能范围内——在此处修复问题,确保烧录交付一致的镜像。
INITRD_DIRTY=1<LFT_DST>/tools/l4t_update_initrd.shrootfs/nv-update-initrd<LFT_DST>/bootloader/l4t_initrd.img<LFT_DST>/rootfs/boot/initrd/boot/initrdINITRD_DIRTY=0update-initramfs -ucp有关shell代码片段、拒绝场景、此重建操作解决的“模块遮蔽”和“版本魔数不匹配”故障模式,以及为何不修改(另一个文件)的原因,请参阅。
bootloader/initrdreferences/kernel-image-and-initramfs.mdSummary
摘要
Report:
- Overlay scope: or "(empty)".
overlay HEAD ($OVERLAY_HEAD) - Manifest scope: or "(absent)".
mode=<...>, bsp_version=<...>, rebuilt_at=<...>, N artifacts - Collision check: .
$COLLISION_CHECK - Counts:
- overlay:
$COPIED_OVERLAY copied, $IDENTICAL_OVERLAY identical - manifest:
$COPIED_MANIFEST copied, $IDENTICAL_MANIFEST identical
- overlay:
- Kernel Image mirror: and initramfs:
$KIMG_MIRRORED($INITRD_STATUS/copied …when triggered byrebuiltorkernel/Imagewrites;rootfs/lib/modules/*otherwise).skipped … - First / last paths copied (omit if both totals are 0).
COPIED - Resolved ,
<source.root_path>.<bsp_image.root_path> - Next step: (or
/jetson-flash-imageif the user only wanted bsp_image refreshed for inspection / static validation)./jetson-validate-image
报告内容包括:
- 覆盖范围:或“(空)”。
overlay HEAD ($OVERLAY_HEAD) - 构建清单范围:或“(不存在)”。
mode=<...>, bsp_version=<...>, rebuilt_at=<...>, N artifacts - 冲突检查:。
$COLLISION_CHECK - 计数:
- 覆盖渠道:个已复制,
$COPIED_OVERLAY个内容相同$IDENTICAL_OVERLAY - 构建清单渠道:个已复制,
$COPIED_MANIFEST个内容相同$IDENTICAL_MANIFEST
- 覆盖渠道:
- 内核Image镜像:,以及initramfs状态:
$KIMG_MIRRORED(当由$INITRD_STATUS或kernel/Image写入触发时显示rootfs/lib/modules/*/copied …;否则显示rebuilt)。skipped … - 第一个/最后一个复制的路径(若总数均为0则省略)。
COPIED - 已解析的和
<source.root_path>。<bsp_image.root_path> - 下一步操作:(若用户仅需刷新bsp_image用于检查/静态验证,则为
/jetson-flash-image)。/jetson-validate-image
Limitations
限制
- Two channels, one destination. is written by both passes. Overlay carries customize-* outputs (overlay-only edits like nvfancontrol.conf); manifest carries rebuilt binaries (kernel/OOT/DT). The two are intentionally disjoint by construction: build outputs don't go into the overlay, and customize-* edits to non-build files don't enter the manifest.
bsp_image/Linux_for_Tegra/ - Build manifest is the trace-to-dirty contract. Anything in
the manifest came from a dirty source repo (per
's "Write the build manifest" step trace policy). Promoting the manifest is therefore safe: every entry is a customization-bearing artifact, not toolchain-divergence noise. The skill does not re-derive the trace — it trusts the manifest.
jetson-build-source - Manifest entries can outlive their build outputs. If the
user wipes or
Source/.build/'s build artifacts betweenbsp_sources/andjetson-build-source, the manifest will reference missing files. The "Enumerate sources (both channels)" step refuses in that case and points the user atjetson-promote-imageto rebuild./jetson-build-source - Manifest absence is fine when only overlay edits happened.
A purely overlay-side customization (e.g. ) produces no build outputs and writes no manifest — the "Enumerate sources (both channels)" step is a no-op, the "Diff-aware copy into bsp_image" step promotes only overlay files. The skill prints "manifest: (absent)" in the summary and continues.
customize-fan - Diff-aware, idempotent. Re-running with no overlay commits or manifest changes since the last promote is a no-op (all files identical). Use this to confirm bsp_image is in sync without side effects.
- Symlink-mount transparency. When
was overridden in
source.repos.Linux_for_Tegra, the canonical mount is a symlink intojetson-init-source.<source.root_path>/.repos/Linux_for_Tegra/<subdir>,git -C, andcp -pall follow it transparently — no special handling needed at this layer. Manifestcmp -spaths are absolute, so symlinks undersrcdon't matter for the manifest channel.bsp_sources/ - is scoped to
sudodestinations. Files underrootfs/were extracted withrootfs/bysudo tar xpjf, so they carry root ownership and special mode bits the flashing toolchain reads back.jetson-init-imagepreserves them. Everything else (sudo cp -p,bootloader/,kernel/,kernel/dtb/, etc.) is user-owned and does not needtools/. This applies to both channels.sudo - Channel-overlap precedence. If the same appears in both overlay and manifest, manifest wins (later in the "Diff-aware copy into bsp_image" step's loop). This is the desired semantic — manifest entries are freshly built, overlay entries may be older state. Hand-editing binary files into the overlay is discouraged (Build's job is to rebuild them); the precedence rule makes such mistakes recoverable.
dst - is read-only outside Deploy. This skill is the only writer in the normal flow (matches the workflow invariant). Hand-edits to
bsp_imageoutside Deploy will be silently overwritten on the next promote run if the same path exists in either channel; conversely they will not be reverted if no entry shadows them. Both behaviors are wrong for the diff trail — never hand-edit upstream.<bsp_image.root_path>/Linux_for_Tegra/ - Scope is overlay HEAD only (channel A). Named tags /
manifests / commit ranges are deferred (see below). To promote
a historical state, first, then re-run. The manifest channel has no ranged scope — it reflects whatever
git -C $LFT_SRC checkout <ref>'s last run produced.jetson-build-source - No automatic rollback on partial failure. If fails partway through,
cpis left in an intermediate state. Fix the underlying cause (usually permissions / disk full) and re-run — the "Diff-aware copy into bsp_image" step will resume by skipping already-promoted files.bsp_image - Kernel mirror + initramfs refresh. Gated on copy-pass writes to
Imageorkernel/Image; the mirror feeds the refresh's chroot. Both are diff-aware and skipped on pure-overlay edits.rootfs/lib/modules/*must exist intools/l4t_update_initrd.sh(ships withbsp_image); a missing tool refuses and routes toapply_binaries.sh. See/jetson-init-imagefor the full contract and failure modes.references/kernel-image-and-initramfs.md
- 两个渠道,一个目标。由两个渠道写入。覆盖渠道承载customize-*输出(仅覆盖编辑,如nvfancontrol.conf);构建清单渠道承载重新构建的二进制文件(内核/内核外模块/DTB)。两者在设计上有意不重叠:构建输出不会进入覆盖渠道,对非构建文件的customize-*编辑也不会进入构建清单。
bsp_image/Linux_for_Tegra/ - 构建清单是脏迹跟踪约定。清单中的所有内容均来自脏源仓库(根据的“写入构建清单”步骤跟踪策略)。因此推广清单是安全的:每个条目都是包含定制内容的产物,而非工具链差异产生的冗余内容。本技能不会重新推导跟踪信息——信任清单内容。
jetson-build-source - 清单条目可能比构建输出存在更久。若用户在和
jetson-build-source之间删除jetson-promote-image或Source/.build/下的构建产物,清单将引用不存在的文件。“枚举源文件(两个渠道)”步骤会在此情况下拒绝执行,并提示用户重新运行bsp_sources/进行重建。/jetson-build-source - 仅覆盖编辑时,清单不存在是允许的。纯覆盖侧定制(例如)不会产生构建输出,也不会写入清单——“枚举源文件(两个渠道)”步骤无操作,“差异感知复制到bsp_image”步骤仅推广覆盖文件。本技能会在摘要中显示“manifest: (不存在)”并继续执行。
customize-fan - 差异感知,幂等性。自上次推广后,若覆盖渠道无提交且构建清单无更改,重新运行本技能无任何操作(所有文件内容相同)。可用于确认bsp_image已同步且无副作用。
- 符号链接挂载透明。当中
jetson-init-source被覆盖时,标准挂载是指向source.repos.Linux_for_Tegra的符号链接。<source.root_path>/.repos/Linux_for_Tegra/<subdir>、git -C和cp -p均会透明跟随符号链接——此层无需特殊处理。构建清单的cmp -s路径为绝对路径,因此src下的符号链接对构建清单渠道无影响。bsp_sources/ - 仅作用于
sudo目标路径。rootfs/下的文件由rootfs/通过jetson-init-image解压,因此它们具有root所有权和烧录工具链需要读取的特殊权限位。sudo tar xpjf会保留这些属性。其他所有路径(sudo cp -p、bootloader/、kernel/、kernel/dtb/等)均为用户所有,无需tools/。此规则适用于两个渠道。sudo - 渠道重叠优先级。若同一路径同时出现在覆盖渠道和构建清单渠道中,构建清单渠道优先(在“差异感知复制到bsp_image”步骤的循环中后执行)。这是预期的语义——构建清单条目是新构建的产物,覆盖渠道条目可能是旧状态。不鼓励手动编辑二进制文件到覆盖渠道(构建的职责是重新构建它们);优先级规则使此类错误可恢复。
dst - 在部署流程外为只读。在正常流程中,本技能是唯一的写入者(符合工作流不变量)。在部署流程外手动编辑
bsp_image,若同一路径存在于任一渠道中,下次推广运行时会被静默覆盖;反之,若没有条目遮蔽该路径,则不会被还原。两种行为都会破坏差异跟踪——绝不要手动编辑上游内容。<bsp_image.root_path>/Linux_for_Tegra/ - 范围仅为覆盖渠道的HEAD(渠道A)。命名标签/清单/提交范围功能已推迟(见下文)。若要推广历史状态,请先执行,然后重新运行本技能。构建清单渠道无范围概念——它反映
git -C $LFT_SRC checkout <ref>上次运行的结果。jetson-build-source - 部分失败时无自动回滚。若操作中途失败,
cp将处于中间状态。修复根本原因(通常是权限/磁盘已满)并重新运行——“差异感知复制到bsp_image”步骤会跳过已推广的文件,继续执行。bsp_image - 内核镜像 + initramfs刷新。由复制操作写入
Image或kernel/Image触发;镜像操作为刷新的chroot环境提供文件。两者均为差异感知,纯覆盖编辑时会跳过。rootfs/lib/modules/*必须存在于tools/l4t_update_initrd.sh中(随bsp_image一起提供);若工具缺失则拒绝执行并引导至apply_binaries.sh。完整约定和故障模式请参阅/jetson-init-image。references/kernel-image-and-initramfs.md
Troubleshooting
故障排除
| Error | Cause | Solution |
|---|---|---|
| Customize-* edits not committed before promote | Run |
| Remote overlay diverged from local | |
| No Customize-* commits and no Build manifest | Run a customize-* skill or |
| Freshness gate detected unprocessed customize-* edits under | Commit pending edits, run |
| | Re-run |
| Manifest hand-edited or partially written | Re-run |
| Missing | Run on an account that can |
Profile lacks | Workspace not bootstrapped | Run |
| | Re-run |
| Insufficient sudo, broken rootfs (missing | Run |
DUT boots with stale kernel / modules after promote, modules fail to load with | The mirror / refresh gate didn't fire (manual hand-edit under | Force the gate by |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| Customize-*编辑未在推广前提交 | 运行 |
| 远程覆盖仓库与本地仓库分歧 | |
| 无Customize-*提交且无构建清单 | 先运行customize-*技能或 |
| 新鲜度检测到 | 提交待处理的编辑,运行 |
| | 重新运行 |
| 清单被手动编辑或仅部分写入 | 重新运行 |
| 主机缺少 | 使用可执行 |
配置文件缺少 | 工作区未初始化 | 运行 |
| | 重新运行 |
| sudo权限不足、根文件系统损坏(缺少 | 先对根文件系统运行 |
推广后DUT启动时使用过时的内核/模块,模块加载失败并提示 | 镜像/刷新触发条件未生效(在本技能外手动编辑 | 通过 |
Spec status
规范状态
Locked in for v0.2.0:
- Two-channel scope — overlay HEAD + build manifest, both
diff-aware, both copying into .
<bsp_image.root_path>/Linux_for_Tegra/ - Channel-overlap precedence — manifest wins on collision.
dst - Source-repo collision check — overlay only; manifest has no
remote concept and source repos under are not fetched (their state was sealed when
bsp_sources/wrote the manifest).jetson-build-source - Atomicity — fail-fast, no rollback. Diff-aware copy makes resume natural.
- Audit trail — stdout-only at promote time. The overlay tracker's git log is the canonical record for channel A; the manifest itself is the canonical record for channel B.
- Kernel Image mirror + initramfs refresh. Locked in as a
paired step. The mirror copies →
kernel/Imagewhenever the copy pass touchedrootfs/boot/Image; the refresh runskernel/Imagewhenevertools/l4t_update_initrd.shor anykernel/Imagewas promoted, rebuilding bothrootfs/lib/modules/*andbootloader/l4t_initrd.img. Inseparable because the refresh chroots intorootfs/boot/initrdand resolves the kernel throughrootfs/— the mirror has to run first. Closes both module-shadowing and vermagic-skew failure modes; both diff-aware, both skipped on overlay-only edits. Full contract in/boot/Image.references/kernel-image-and-initramfs.md
Still deferred:
- Named-tag / commit-range scope for the overlay channel. Revisit when a "promote release X" use case appears.
- Manifest history. Currently only the last build's manifest
exists; if a user wants to roll bsp_image back to a previous
build state, they'd need to re-run at the prior commit. A manifest archive (saved per-build-mode or per-commit) would enable rollback without rebuild.
/jetson-build-source - Sidecar manifest in . Revisit when promotion happens on a host that does not have access to the overlay tracker repo (or the workspace's manifest file).
bsp_image
v0.2.0已锁定:
- 双渠道范围——覆盖渠道HEAD + 构建清单,均采用差异感知,均写入。
<bsp_image.root_path>/Linux_for_Tegra/ - 渠道重叠优先级——路径冲突时构建清单渠道优先。
dst - 源仓库冲突检查——仅覆盖渠道;构建清单渠道无远程概念,下的源仓库不会被拉取(其状态在
bsp_sources/写入清单时已固定)。jetson-build-source - 原子性——快速失败,无回滚。差异感知复制使恢复操作自然。
- 审计跟踪——仅在推广时输出到标准输出。覆盖跟踪器的git日志是渠道A的规范记录;构建清单本身是渠道B的规范记录。
- 内核Image镜像 + initramfs刷新。作为配对步骤锁定。每当复制操作触及时,镜像操作将
kernel/Image复制到kernel/Image;每当推广rootfs/boot/Image或任何kernel/Image时,刷新操作运行rootfs/lib/modules/*,重新构建tools/l4t_update_initrd.sh和bootloader/l4t_initrd.img。两者不可分离,因为刷新操作chroot到rootfs/boot/initrd中并通过rootfs/解析内核——必须先运行镜像操作。解决了模块遮蔽和版本魔数不匹配两种故障模式;两者均为差异感知,纯覆盖编辑时会跳过。完整约定请参阅/boot/Image。references/kernel-image-and-initramfs.md
仍推迟实现:
- 覆盖渠道的命名标签/提交范围功能。当出现“推广版本X”的用例时再重新考虑。
- 构建清单历史。当前仅存在最后一次构建的清单;若用户希望将bsp_image回滚到之前的构建状态,需在先前的提交上重新运行。按构建模式或提交保存的清单归档将无需重建即可实现回滚。
/jetson-build-source - 中的辅助清单。当推广操作在无法访问覆盖跟踪器仓库(或工作区的清单文件)的主机上执行时再重新考虑。
bsp_image
References
参考资料
- — full contract for the kernel
references/kernel-image-and-initramfs.mdmirror +Imagerefresh: shell snippets, failure modes, tool semantics, output filenames.l4t_update_initrd.sh - — target-platform contract.
../../context/target-platform-contract.md - — workspace edit protocol (this skill is the promote leg of Deploy).
../../context/bsp-customization-workflow.md - — Setup; materializes the overlay tracker this skill reads (channel A) and authors
../jetson-init-source/SKILL.md.source.toolchain - — Build builder; writes the
../jetson-build-source/SKILL.mdthis skill reads (channel B)..build-manifest.yaml - — next leg; flashes the just-promoted bsp_image to the DUT.
../jetson-flash-image/SKILL.md - — final leg; static + on-target validation.
../jetson-validate-image/SKILL.md
- ——内核
references/kernel-image-and-initramfs.md镜像 +Image刷新的完整约定:shell代码片段、故障模式、工具语义、输出文件名。l4t_update_initrd.sh - ——目标平台约定。
../../context/target-platform-contract.md - ——工作区编辑协议(本技能是部署流程的推广环节)。
../../context/bsp-customization-workflow.md - ——初始化;生成本技能读取的覆盖跟踪器(渠道A)并编写
../jetson-init-source/SKILL.md。source.toolchain - ——构建工具;编写本技能读取的
../jetson-build-source/SKILL.md(渠道B)。.build-manifest.yaml - ——下一个环节;将刚推广的bsp_image烧录到DUT。
../jetson-flash-image/SKILL.md - ——最后一个环节;静态+目标端验证。
../jetson-validate-image/SKILL.md