Skip to content

Commit 2d711d3

Browse files
committed
support for native build
1 parent 7ecd119 commit 2d711d3

3 files changed

Lines changed: 33 additions & 20 deletions

File tree

apply_patches.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ apply_external_patches() {
5050
if [ $1 = 'apply' ]; then
5151
ls -Ld sources_$JETPACK_VERSION/$3
5252
ls -Lw1 ${PWD}/$3/$2
53-
git -C sources_$JETPACK_VERSION/$3 apply -vq ${PWD}/$3/$2/*
53+
git -C sources_$JETPACK_VERSION/$3 apply ${PWD}/$3/$2/*
5454
elif [ $1 = 'reset' ]; then
5555
if [[ -n $(git -C sources_$JETPACK_VERSION/$3 diff --quiet) || -n $(git -C sources_$JETPACK_VERSION/$3 diff --cached --quiet) ]]; then
5656
read -p "Repo sources_$JETPACK_VERSION/$3 has changes that will be hard reset. Continue? (y/N): " confirm

build_all.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@ if [[ -n "$2" ]]; then
2424
SRCS=$(realpath $2)
2525
fi
2626

27-
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
28-
export CROSS_COMPILE=$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/aarch64-buildroot-linux-gnu-
29-
elif [[ "$JETPACK_VERSION" == "5.x" ]]; then
30-
export CROSS_COMPILE=$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/aarch64-buildroot-linux-gnu-
31-
elif [[ "$JETPACK_VERSION" == "4.6.1" ]]; then
32-
export CROSS_COMPILE=$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/aarch64-linux-gnu-
27+
if [[ $(uname -m) == aarch64 ]]; then
28+
echo
29+
echo Native build
30+
echo
31+
else
32+
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
33+
export CROSS_COMPILE=$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/aarch64-buildroot-linux-gnu-
34+
elif [[ "$JETPACK_VERSION" == "5.x" ]]; then
35+
export CROSS_COMPILE=$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/aarch64-buildroot-linux-gnu-
36+
elif [[ "$JETPACK_VERSION" == "4.6.1" ]]; then
37+
export CROSS_COMPILE=$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/aarch64-linux-gnu-
38+
fi
3339
fi
40+
3441
export LOCALVERSION=-tegra
3542
export TEGRA_KERNEL_OUT=$DEVDIR/images/$JETPACK_VERSION
3643
mkdir -p $TEGRA_KERNEL_OUT

setup_workspace.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,30 @@ fi
3232
export DEVDIR=$(cd `dirname $0` && pwd)
3333

3434
. $DEVDIR/scripts/setup-common "$1"
35-
echo "Setup JetPack $JETPACK_VERSION to sources_$JETPACK_VERSION"
35+
echo "Setup JetPack $1 to sources_$JETPACK_VERSION"
3636

3737
# Display NVIDIA license
3838
DisplayNvidiaLicense ""
3939

4040
# Install L4T gcc if not installed
41-
if [[ ! -d "$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/" ]]; then
42-
mkdir -p $DEVDIR/l4t-gcc/$JETPACK_VERSION
43-
cd $DEVDIR/l4t-gcc/$JETPACK_VERSION
44-
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
45-
wget --quiet --show-progress https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v3.0/toolchain/aarch64--glibc--stable-2022.08-1.tar.bz2 -O aarch64--glibc--stable-final.tar.bz2
46-
tar xf aarch64--glibc--stable-final.tar.bz2 --strip-components 1
47-
elif [[ "$JETPACK_VERSION" == "5.x" ]]; then
48-
wget --quiet --show-progress https://developer.nvidia.com/embedded/jetson-linux/bootlin-toolchain-gcc-93 -O aarch64--glibc--stable-final.tar.gz
49-
tar xf aarch64--glibc--stable-final.tar.gz
50-
elif [[ "$JETPACK_VERSION" == "4.6.1" ]]; then
51-
wget --quiet --show-progress http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
52-
tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz --strip-components 1
41+
if [[ $(uname -m) == aarch64 ]]; then
42+
echo
43+
echo Native build
44+
echo
45+
else
46+
if [[ ! -d "$DEVDIR/l4t-gcc/$JETPACK_VERSION/bin/" ]]; then
47+
mkdir -p $DEVDIR/l4t-gcc/$JETPACK_VERSION
48+
cd $DEVDIR/l4t-gcc/$JETPACK_VERSION
49+
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
50+
wget --quiet --show-progress https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v3.0/toolchain/aarch64--glibc--stable-2022.08-1.tar.bz2 -O aarch64--glibc--stable-final.tar.bz2
51+
tar xf aarch64--glibc--stable-final.tar.bz2 --strip-components 1
52+
elif [[ "$JETPACK_VERSION" == "5.x" ]]; then
53+
wget --quiet --show-progress https://developer.nvidia.com/embedded/jetson-linux/bootlin-toolchain-gcc-93 -O aarch64--glibc--stable-final.tar.gz
54+
tar xf aarch64--glibc--stable-final.tar.gz
55+
elif [[ "$JETPACK_VERSION" == "4.6.1" ]]; then
56+
wget --quiet --show-progress http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
57+
tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz --strip-components 1
58+
fi
5359
fi
5460
fi
5561

0 commit comments

Comments
 (0)