Created
November 3, 2022 10:36
-
-
Save adujardin/5298a596fdab30e6f45b74db3971dd7c to your computer and use it in GitHub Desktop.
On device jetpack upgrade for jetson (from L4T 32.6 -> 32.7)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
LT4_MAJOR=32 | |
LT4_MINOR_OLD=6 | |
LT4_MINOR=7 | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
jetson_clocks # speed things up | |
# Check disk space | |
disk_space_byte=$(df $PWD | awk '/[0-9]%/{print $(NF-2)}') | |
disk_space_megabyte=$(( disk_space_byte / 1000 )) | |
echo "** Free space : $disk_space_megabyte Mo **" | |
if [[ $disk_space_megabyte -lt 5000 ]]; then | |
echo "Not enough disk space (need 5Go)" | |
exit 1 | |
fi | |
# Upgrade | |
apt update; apt upgrade -y; | |
echo "The device should be rebooted before continuing (the script is paused)" | |
sleep 20 | |
# Actual upgrade | |
# https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fquick_start.html%23wwpID0EXHA | |
sed -i "s/r$LT4_MAJOR.$LT4_MINOR_OLD /r$LT4_MAJOR.$LT4_MINOR /g" /etc/apt/sources.list.d/nvidia-l4t-apt-source.list | |
apt update; apt upgrade -y; | |
echo "The device can be rebooted now" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment