blob: f8cbbc361f0a62b13f1bfe038684d8148a21e9c6 [file] [log] [blame]
Austin Schuh51014832023-10-20 17:44:45 -07001#!/bin/bash
2set -ex
3
4TMPDIR=$(mktemp -d /tmp/yoctoflash.XXXXXXXXXX)
5
6# Cleanup on exit.
7function finish {
8 sudo rm -rf "${TMPDIR}"
9}
10trap finish EXIT
11
Jim Ostrowskiafcc0982024-01-15 15:28:53 -080012# Call sudo to get it started here, rather than waiting for after tar/cp's
13sudo echo "Flashing orin"
14
Austin Schuh51014832023-10-20 17:44:45 -070015# Assumes that the image has been copied into ./
16tar xf frc971-image-orin-nx-8g.tegraflash.tar.gz -C "${TMPDIR}"
17
18# Replace the rootfs with our new image.
19cp --sparse=always arm64_bookworm_debian_yocto.img "${TMPDIR}/frc971-image.ext4"
20
21cd ${TMPDIR}
22
23sudo ./initrd-flash