Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tegra-kernel-cache

Kernel metadata (kmeta) for NVIDIA L4T-supported machines on linux-yocto: the vendor patch queues, their .scc feature descriptions, and the scripts that maintain them.

Patch model

Three queues, applied in do_patch order via KERNEL_FEATURES:tegra:

Queue Source Applied at build as
platform NVIDIA linux/patches/<ver> First, on the yocto base
sauce NVIDIA <ver> integration branch, reference-filtered On top of platform
distro Hand-maintained OE/distro patches (tegra-distro.scc) Last, after the NVIDIA queues

The platform and sauce queues live in features/tegra/<queue>/patches/ with a generated <queue>.scc listing their patches; tegra-patches.scc aggregates them in order. tegra-distro.scc is hand-maintained and not generated by the scripts. Kernel config is a fragment (cfg/tegra.cfg), not patches; config-only commits are dropped on export.

Patches are exported per queue as the delta since the previous queue's HEAD, so the git state during a refresh matches bitbake's apply order.

Refreshing the patches

refresh.sh builds the queues in a detached worktree (.refresh-worktree), pausing on conflicts for resolution, then rewrites the patches and regenerates the SCCs.

Against an updated linux-yocto

The common case: linux-yocto's SRCREV advanced and you need the existing patches to keep applying. refresh.sh re-applies the patches onto the new base (git am --3way), pausing only if a moved base introduces a conflict, then rewrites them.

./scripts/refresh.sh --linux-yocto /path/to/linux-yocto

Override the base with YOCTO_BASE=<ref> (defaults to yocto_base_ref in sources/branches.yaml). Name queues to refresh a subset; predecessors are applied to build the cumulative base but only the named queues are rewritten.

Resolving conflicts

When refresh.sh pauses, resolve in .refresh-worktree with the helper, which verifies no markers remain before continuing:

scripts/resolve-conflict.sh status
scripts/resolve-conflict.sh union|ours|theirs <file>...
scripts/resolve-conflict.sh continue | skip | abort

A clean 3-way merge that produces no net change (content already present) is skipped automatically. --non-interactive fails on conflicts instead of pausing (for CI).

Version bumps

version_suffix in sources/branches.yaml is the single source of truth; the {version} placeholders (yocto_base_ref, each nvidia_branch) are substituted at load. A minor bump (6.18 -> 6.19) is that one edit, then re-run. For a major bump also confirm each nvidia_branch still resolves on the NVIDIA remote and review cfg/tegra.cfg for renamed Kconfig symbols.

Verifying

./scripts/verify-queues.sh                                   # SCC lists match disk
./scripts/verify-queues.sh --apply --linux-yocto <path>      # git am the whole chain

--apply proves the patches apply, not that the kernel compiles. For a real check, build (bitbake linux-yocto -c compile). To map a compile error back to a queue: rg -l '<filename>' features/tegra/*/patches/*.patch, then re-refresh that queue.

Scripts

Script Purpose
refresh.sh Re-apply existing patches onto an updated linux-yocto
refresh-from-nvidia.sh Re-derive queues from NVIDIA branches (requires NVIDIA access)
resolve-conflict.sh Safe conflict resolution during a refresh
verify-queues.sh SCC vs disk check; --apply runs git am on all patches
generate-scc.sh Per-queue .scc, or --aggregator for tegra-patches.scc
lib/refresh-common.sh Shared worktree, apply, conflict, and write-patch machinery

Layout

  • sources/branches.yaml - queue manifest and reference filter
  • features/tegra/<queue>/patches/ + <queue>.scc - generated per queue
  • features/tegra/tegra-patches.scc - aggregator (KERNEL_FEATURES)
  • features/tegra/tegra-distro.scc - hand-maintained distro patches
  • cfg/tegra.cfg - shared Kconfig fragment (pulled in by the patch queues)
  • cfg/<machine>.cfg - per-machine config overlay (applied by the BSP)

Do not hand-edit patch files or generated .scc files. Edit tegra-distro.scc and its patches directly; the scripts do not touch it.

About

Patches and configuration specific to Tegra devices for the linux-yocto kernel tree

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages