Skip to content

Commit 73d072b

Browse files
committed
Get 32.2 sources
1 parent 05c380a commit 73d072b

File tree

4 files changed

+44
-23
lines changed

4 files changed

+44
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# buildKernelAndModules
22
Build the Linux Kernel and Modules on board the NVIDIA Jetson Nano Developer Kit
33

4-
Work in progress
4+
command 2>&1 | tee log.txt

getKernelSources.sh

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,50 @@
33
# Copyright (c) 2016-19 Jetsonhacks
44
# MIT License
55

6-
JETSON_MODEL="jetson-nano"
7-
L4T_TARGET="32.1.0"
6+
JETSON_MODEL="NVIDIA Jetson Nano Developer Kit"
7+
L4T_TARGET="32.2"
88
SOURCE_TARGET="/usr/src"
99
KERNEL_RELEASE="4.9"
1010

1111
# < is more efficient than cat command
1212
# NULL byte at end of board description gets bash upset; strip it out
1313
JETSON_BOARD=$(tr -d '\0' </proc/device-tree/model)
14+
echo "Jetson Model: "$JETSON_BOARD
1415

1516
JETSON_L4T=""
16-
if [ -f /etc/nv_tegra_release ]; then
17-
# L4T string
18-
JETSON_L4T_STRING=$(head -n 1 /etc/nv_tegra_release)
19-
20-
# Load release and revision
21-
JETSON_L4T_RELEASE=$(echo $JETSON_L4T_STRING | cut -f 1 -d ',' | sed 's/\# R//g' | cut -d ' ' -f1)
22-
JETSON_L4T_REVISION=$(echo $JETSON_L4T_STRING | cut -f 2 -d ',' | sed 's/\ REVISION: //g' )
23-
# unset variable
24-
unset JETSON_L4T_STRING
25-
26-
# Write Jetson description
27-
JETSON_L4T="$JETSON_L4T_RELEASE.$JETSON_L4T_REVISION"
28-
fi
29-
echo "Jetson Model: "$JETSON_BOARD
30-
echo "Jetson L4T: "$JETSON_L4T
17+
18+
function check_L4T_version()
19+
{
20+
JETSON_L4T_STRING=$(head -n 1 /etc/nv_tegra_release)
21+
22+
if [ -z $2 ]; then
23+
echo "$LOG Instead, reading L4T version from \"dpkg-query --show nvidia-l4t-core\""
24+
25+
JETSON_L4T_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
26+
local JETSON_L4T_ARRAY=(${JETSON_L4T_STRING//./ })
27+
28+
#echo ${JETSON_L4T_ARRAY[@]}
29+
#echo ${#JETSON_L4T_ARRAY[@]}
30+
31+
JETSON_L4T_RELEASE=${JETSON_L4T_ARRAY[0]}
32+
JETSON_L4T_REVISION=${JETSON_L4T_ARRAY[1]}
33+
else
34+
echo "$LOG reading L4T version from /etc/nv_tegra_release"
35+
36+
JETSON_L4T_RELEASE=$(echo $JETSON_L4T_STRING | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
37+
JETSON_L4T_REVISION=$(echo $JETSON_L4T_STRING | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
38+
fi
39+
40+
JETSON_L4T_VERSION="$JETSON_L4T_RELEASE.$JETSON_L4T_REVISION"
41+
echo "$LOG Jetson BSP Version: L4T R$JETSON_L4T_VERSION"
42+
43+
}
44+
45+
echo "Getting L4T Version"
46+
check_L4T_version
47+
JETSON_L4T="$JETSON_L4T_RELEASE.$JETSON_L4T_REVISION"
48+
echo "Jetson_L4T="$JETSON_L4T
49+
unset JETSON_L4T_STRING
3150

3251
function usage
3352
{

scripts/getKernelSources.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apt-add-repository universe
44
apt-get update
55
apt-get install pkg-config -y
66
# We use 'make menuconfig' to edit the .config file; install dependencies
7-
apt-get install libncurses5-dev
7+
apt-get install libncurses5-dev -y
88
echo "Installing kernel sources in: ""$SOURCE_TARGET"
99
if [ ! -d "$SOURCE_TARGET" ]; then
1010
# Target directory does not exist; create
@@ -15,9 +15,9 @@ fi
1515
cd "$SOURCE_TARGET"
1616
echo "$PWD"
1717

18-
wget -N https://developer.nvidia.com/embedded/dlc/l4t-sources-32-1-jetson-nano
18+
wget -N https://developer.download.nvidia.com/embedded/L4T/r32-2_Release_v1.0/Nano-TX1/public_sources.tbz2
1919
# l4t-sources is a tbz2 file
20-
tar -xvf l4t-sources-32-1-jetson-nano public_sources/kernel_src.tbz2
20+
tar -xvf public_sources.tbz2 public_sources/kernel_src.tbz2
2121
tar -xvf public_sources/kernel_src.tbz2
2222
# Space is tight; get rid of the compressed kernel source
2323
rm -r public_sources
@@ -28,10 +28,12 @@ zcat /proc/config.gz > .config
2828
cp .config config.orig
2929
# Default to the current local version
3030
KERNEL_VERSION=$(uname -r)
31-
# For L4T 32.1.0 the kernel is 4.9.140-tegra ;
31+
# For L4T 32.2 the kernel is 4.9.140-tegra ;
3232
# Everything after '4.9.140' is the local version
3333
# This removes the suffix
3434
LOCAL_VERSION=${KERNEL_VERSION#$"4.9.140"}
35+
# FIX ME
36+
LOCAL_VERSION="-jetsonbot"
3537
# Should be "-tegra"
3638
bash scripts/config --file .config \
3739
--set-str LOCALVERSION $LOCAL_VERSION

scripts/makeKernel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo "Source Target: "$SOURCE_TARGET
88
MAKE_DIRECTORY="$SOURCE_TARGET"kernel/kernel-4.9
99

1010
cd "$SOURCE_TARGET"kernel/kernel-4.9
11-
make prepare
11+
# make prepare
1212
# Get the number of CPUs
1313
NUM_CPU=$(nproc)
1414

0 commit comments

Comments
 (0)