-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit-jetpack
executable file
·73 lines (60 loc) · 1.62 KB
/
init-jetpack
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -euo pipefail
source /etc/os-release
if [[ "${ID_LIKE:=}" == "debian" ]]
then
sudo apt-get update
sudo apt-get install -y libxml2-utils
fi
JETPACK_VERSION="32.7.6"
BSP_BINARY="Jetson-210_Linux_R${JETPACK_VERSION}_aarch64.tbz2"
BSP_SOURCE="public_sources.tbz2"
ROOTFS_BINARY="Tegra_Linux_Sample-Root-Filesystem_R${JETPACK_VERSION}_aarch64.tbz2"
PCN211181_OVERLAY="overlay_32.7.5_PCN211181.tbz2"
# Download
# * Driver Package (BSP)
# * Sample Root Filesystem
# * Driver Package (BSP) Sources
#from https://developer.nvidia.com/embedded/linux-tegra-r3273
ARCHIVE_AVAILABLE="true"
for i in "$BSP_BINARY" "$BSP_SOURCE" "$ROOTFS_BINARY" "$PCN211181_OVERLAY"
do
if [[ ! -f "$i" ]]
then
ARCHIVE_AVAILABLE="false"
echo "$i is missing!"
fi
done
if ! $ARCHIVE_AVAILABLE
then
exit 1
fi
echo "Decompressing $BSP_BINARY..."
tar xf $BSP_BINARY
echo "Decompressing $BSP_SOURCE..."
tar xf $BSP_SOURCE
for i in u-boot kernel
do
mkdir "Linux_for_Tegra/source/$i"
pushd "Linux_for_Tegra/source/$i"
echo "Decompressing ${i}_src.tbz2..."
tar xf ../public/${i}_src.tbz2
popd
done
pushd "Linux_for_Tegra/rootfs"
echo "Decompressing $ROOTFS_BINARY..."
sudo tar xpf ../../$ROOTFS_BINARY
popd
echo "Decompressing $PCN211181_OVERLAY..."
sudo tar xf $PCN211181_OVERLAY
if [[ "$ID_LIKE" == "debian" ]]
then
pushd "Linux_for_Tegra"
echo "Updating rootfs..."
sudo ./apply_binaries.sh
popd
else
echo "Non Debian system does not support apply_binaries.sh. Skipping."
echo "You will not be able to run 'make flash'."
fi
echo "JetPack development environment has been set up."