Seeed-Jetson-DevelopTool / disk-encryption
AGENTS.md57 starsChanged 4 months agoMITView on GitHub
Encrypt the root filesystem on Jetson devices during flashing using OPTEE-based encryption keys. Covers BSP source build, OPTEE key generation, encrypted image creation, and flashing with l4t_initrd_flash. Requires an Ubuntu 20.04/22.04 host PC and the target Jetson device (e.g. reComputer J401 with L4T 36.4.3).
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository297 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-nvrAGENTS.md
- allxon-ota-updateAGENTS.md
- allxon-setupAGENTS.md
- alwaysai-setupAGENTS.md
- backup-restoreAGENTS.md
- bsp-source-buildAGENTS.md
- clawdbot-developmentAGENTS.md
- cochl-sense-setupAGENTS.md
- cvedia-setupAGENTS.md
- dashcamnet-xavier-nx-multicameraAGENTS.md
- deciai-setupAGENTS.md
- deepseek-quick-deployAGENTS.md
- deploy-deepseek-mlcAGENTS.md
- deploy-depth-anything-v3AGENTS.md
- deploy-diaAGENTS.md
- deploy-efficient-vision-engineAGENTS.md
- deploy-frigateAGENTS.md
- deploy-live-vlm-webuiAGENTS.md
- deploy-nvbloxAGENTS.md
- deploy-ollama-anythingllmAGENTS.md
- deploy-riva-llama2AGENTS.md
- developtool-deviceAGENTS.md
- diy-bsp-buildAGENTS.md
- ethercat-communicationAGENTS.md
- ethercat-setupAGENTS.md
- finetune-llm-llama-factoryAGENTS.md
- fix-browser-snap-jetsonAGENTS.md
- gapi-setupAGENTS.md
- generative-ai-introAGENTS.md
- gpt-oss-liveAGENTS.md
- gr00t-n1-5-deploy-thorAGENTS.md
- gr00t-n1-6-deploy-agxAGENTS.md
- hardhat-setupAGENTS.md
- hybrid-bsp-dk-to-recomputerAGENTS.md
- imx477-a603-setupAGENTS.md
- j501-viola-fruit-sortingAGENTS.md
- jetpack5-ssd-boot-fixAGENTS.md
- jetpack-flash-wsl2AGENTS.md
- jetpack-jetson-overviewAGENTS.md
- jetpack-ota-updateAGENTS.md
- jetson-ai-toolsAGENTS.md
- jetson-docker-setupAGENTS.md
- jetson-faqAGENTS.md
- jetson-pc-wired-shareAGENTS.md
- jetson-project-galleryAGENTS.md
- jetson-resource-indexAGENTS.md
- jetson-tutorial-exercisesAGENTS.md
- ko-module-buildAGENTS.md
- l4t-differencesAGENTS.md
- langchain-output-formattingAGENTS.md
- lerobot-env-setupAGENTS.md
- llama-cpp-rpc-distributedAGENTS.md
- llm-interface-controlAGENTS.md
- local-chatbot-multimodalAGENTS.md
- local-chatbot-physicalAGENTS.md
- local-llm-text-to-imageAGENTS.md
- local-rag-llamaindexAGENTS.md
- lumeo-setupAGENTS.md
- maskcam-nanoAGENTS.md
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Run one phase at a time. After each phase:
- Very specific: line 16
If output contains [STOP] → stop, consult the failure decision tree.
- Very specific: line 17
If output ends with [OK] → tell the user "Phase N complete" and proceed.
- Distinctive: line 168
Put the Jetson device into recovery mode, then:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Disk Encryption for Jetson
Encrypts the Jetson root filesystem during the flashing process using OPTEE-generated keys. This is a destructive operation — the device must be re-flashed.
Execution model
Run one phase at a time. After each phase:
- Relay all output to the user.
- If output contains
[STOP]→ stop, consult the failure decision tree. - If output ends with
[OK]→ tell the user "Phase N complete" and proceed.
WARNING: This process re-flashes the entire device. All existing data on the Jetson will be erased.
Prerequisites
| Requirement | Detail |
| Host PC | Ubuntu 20.04 or 22.04 (x86_64) |
| Jetson device | e.g. reComputer J401 (Orin) in recovery mode |
| L4T version | 36.4.3 (adjust commands for other versions) |
| USB cable | Connecting host to Jetson recovery port |
| Storage | ~50GB free on host for BSP and build artifacts |
Phase 1 — Prepare BSP workspace on host PC (~15 min)
Download and extract NVIDIA L4T BSP and root filesystem:
tar xf Jetson_Linux_r36.4.3_aarch64.tbz2
sudo tar xpf Tegra_Linux_Sample-Root-Filesystem_r36.4.3_aarch64.tbz2 -C Linux_for_Tegra/rootfs/Sync kernel source:
cd Linux_for_Tegra/source/
./source_sync.sh -t jetson_36.4.3
cd ../..Clone Seeed BSP overlay and apply:
sudo apt update && sudo apt install -y git-lfs
mkdir -p github/Linux_for_Tegra
git clone https://github.com/Seeed-Studio/Linux_for_Tegra.git -b r36.4.3 --depth=1 github/Linux_for_Tegra
cp -r github/Linux_for_Tegra/* Linux_for_Tegra/
cd Linux_for_Tegra
sudo ./apply_binaries.sh[OK] when apply_binaries.sh completes. [STOP] if download or extraction fails.
Phase 2 — Install build dependencies and compile kernel (~20–30 min)
sudo apt-get install -y build-essential flex bison libssl-dev sshpass \
abootimg nfs-kernel-server libxml2-utils qemu-user-staticSet up cross-compiler (download the toolchain first):
mkdir -p l4t-gcc
tar xf aarch64--glibc--stable-2022.08-1.tar.bz2 -C ./l4t-gcc
export ARCH=arm64
export CROSS_COMPILE=$(pwd)/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-Build kernel and install:
cd source
./nvbuild.sh
./do_copy.sh
export INSTALL_MOD_PATH=$(pwd)/../rootfs/
./nvbuild.sh -i
cd ..[OK] when kernel build and module install complete. [STOP] if compilation fails.
Phase 3 — Generate OPTEE encryption keys (~3 min)
cd Linux_for_Tegra
sudo apt-get install -y python3-cryptography python3-cffi-backend libxml2-utils \
python3-pycryptodome python3-crypto cryptsetup
pip install cryptography pycrypto
pip install --user --upgrade pycryptodomeGenerate keys:
cd source/tegra/optee-src/nv-optee/optee/samples/hwkey-agent/host/tool/gen_ekb
openssl rand -hex 32 > sym_t234.key
openssl rand -hex 16 > sym2_t234.key
openssl rand -hex 16 > auth_t234.key
openssl rand -hex 32 > oem_k1.key
./example.shCopy generated files to BSP directories:
cp eks_t234.img /path/to/Linux_for_Tegra/bootloader/
sudo cp sym2_t234.key /path/to/Linux_for_Tegra/[OK] when eks_t234.img and sym2_t234.key are generated and copied. [STOP] if key generation fails.
Phase 4 — Generate encrypted flash image (~10–20 min)
Replace recomputer-orin-j401 with your device name (check .conf files in Linux_for_Tegra/):
cd /path/to/Linux_for_Tegra
sudo ./tools/kernel_flash/l4t_initrd_flash.sh \
--network usb0 \
--no-flash \
--showlogs \
-p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
recomputer-orin-j401 \
internalCopy the encrypted header:
sudo cp bootloader/eks_t234_sigheader.img.encrypt ./tools/kernel_flash/images/internal/Available device names for L4T 36.4.3:
recomputer-orin-j401recomputer-industrial-orin-j201(also for j40/j30 series)reserver-agx-orin-j501xrecomputer-orin-j40minirecomputer-orin-robotics-j401recomputer-orin-super-j401
[OK] when image generation completes. [STOP] if flash tool errors.
Phase 5 — Flash encrypted filesystem to Jetson (~15–30 min)
Put the Jetson device into recovery mode, then:
sudo ROOTFS_ENC=1 \
./tools/kernel_flash/l4t_initrd_flash.sh \
--external-device nvme0n1p1 \
-i ./sym2_t234.key \
-c tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml \
-S 80GiB \
-p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
--showlogs \
--network usb0 \
recomputer-orin-j401 internal[OK] when flashing completes successfully. [STOP] if USB connection drops or flash fails.
Phase 6 — Retrieve decryption password (~2 min)
cp source/tegra/optee-src/nv-optee/optee/samples/hwkey-agent/host/tool/gen_ekb/sym2_t234.key \
source/tegra/optee-src/nv-optee/optee/samples/luks-srv/host/tool/gen_luks_passphrase/
cd source/tegra/optee-src/nv-optee/optee/samples/luks-srv/host/tool/gen_luks_passphrase
python3 gen_luks_passphrase.py -k sym2_t234.key -c "<UUID>" -u -e "<BR_CID>"Find UUID and BR_CID values in the flash log files under Linux_for_Tegra/initrdlog/ (match by timestamp).
Record the decryption password immediately — it displays briefly in the terminal.
[OK] when the password is displayed and recorded.
Failure decision tree
| Symptom | Action |
source_sync.sh fails | Check internet. Retry. Ensure git-lfs is installed. |
| Kernel build fails | Verify cross-compiler path. Check ARCH=arm64 is set. Install missing deps. |
example.sh (OPTEE) fails | Ensure openssl is installed. Check all .key files were generated. |
| Image generation fails | Verify device name matches a .conf file. Check -p path is correct for your L4T version. |
| USB connection drops during flash | Use a short, high-quality USB cable. Retry. Check Jetson is in recovery mode: lsusb | grep NVIDIA. |
| Flash fails with permission error | Run with sudo. Ensure all paths are absolute. |
gen_luks_passphrase.py fails | Verify sym2_t234.key is in the correct directory. Check UUID/BR_CID values from logs. |
| Cannot find UUID/BR_CID | Check Linux_for_Tegra/initrdlog/ for the log file matching your flash timestamp. |
Reference files
references/source.body.md— Full Seeed Wiki tutorial with screenshots, JetPack version mapping, and detailed OPTEE key generation steps (reference only)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

