Skip to content

Commit 3b79c4a

Browse files
authored
remove ARK_JETSON_KERNEL_DIR as bashrc ENV var (#19)
1 parent 67739a4 commit 3b79c4a

File tree

6 files changed

+16
-20
lines changed

6 files changed

+16
-20
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This repository contains instructions and scripts for flashing your Jetson **Ori
77
# Installing the OS
88
Run the **setup.sh** script to download and build the Jetson Orin Nano / NX Jetpack 6 kernel.
99

10-
The script will configure the default user, password, and hostname as `jetson`. The script will also add `ARK_JETSON_KERNEL_DIR` to your **~/.bashrc** for ease of use later.
10+
The script will configure the default user, password, and hostname as `jetson`.
1111
```
1212
./setup.sh
1313
```
@@ -42,7 +42,7 @@ https://github.com/ARK-Electronics/ARK-OS
4242
#### Flashing the QSPI bootloader
4343
You can flash just the QSPI bootloader and install a pre-flashed NVME afterwards ([NVIDIA Docs](https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/FlashingSupport.html#examples)). If you are upgrading from Jetpack5 to Jetpack6 you must reflash the QSPI bootloader.
4444
```
45-
cd $ARK_JETSON_KERNEL_DIR/prebuilt/Linux_for_Tegra/
45+
cd prebuilt/Linux_for_Tegra/
4646
sudo ./flash.sh --no-systemimg -c bootloader/generic/cfg/flash_t234_qspi.xml jetson-orin-nano-devkit nvme0n1p1
4747
```
4848

@@ -55,9 +55,9 @@ The following steps have been automated for you in **build_kernel.sh**.
5555
Navigate to the root of the kernel sources and build the kernel, modules, and dtbs
5656
```
5757
export CROSS_COMPILE=$HOME/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
58-
export KERNEL_HEADERS=$ARK_JETSON_KERNEL_DIR/source_build/Linux_for_Tegra/source/kernel/kernel-jammy-src
59-
export INSTALL_MOD_PATH=$ARK_JETSON_KERNEL_DIR/prebuilt/Linux_for_Tegra/rootfs/
60-
cd $ARK_JETSON_KERNEL_DIR/source_build/Linux_for_Tegra/source
58+
export KERNEL_HEADERS=$PWD/source_build/Linux_for_Tegra/source/kernel/kernel-jammy-src
59+
export INSTALL_MOD_PATH=$PWD/prebuilt/Linux_for_Tegra/rootfs/
60+
cd source_build/Linux_for_Tegra/source
6161
make -C kernel && make modules && make dtbs
6262
```
6363
Install the kernel rootfs into the prebuilt directory
@@ -70,26 +70,26 @@ cp kernel/kernel-jammy-src/arch/arm64/boot/Image ../../../prebuilt/Linux_for_Teg
7070
```
7171
And copy the dtbs if you've made changes to the device tree
7272
```
73-
$ARK_JETSON_KERNEL_DIR/copy_dtbs_to_prebuilt.sh
73+
copy_dtbs_to_prebuilt.sh
7474
```
7575
Navigate back to prebuilt workspace and flash the image
7676
````
77-
cd $ARK_JETSON_KERNEL_DIR/prebuilt/Linux_for_Tegra/
77+
cd prebuilt/Linux_for_Tegra/
7878
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" -c ./tools/kernel_flash/flash_l4t_t234_nvme.xml --erase-all --showlogs --network usb0 jetson-orin-nano-devkit nvme0n1p1
7979
````
8080

8181
## Building the camera overlay DTBS
8282
The camera overlays can be built and installed onto the Jetson without needing to reflash.
8383
```
8484
export CROSS_COMPILE=$HOME/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
85-
export KERNEL_HEADERS=$ARK_JETSON_KERNEL_DIR/source_build/Linux_for_Tegra/source/kernel/kernel-jammy-src
86-
cd $ARK_JETSON_KERNEL_DIR/source_build/Linux_for_Tegra/source/
85+
export KERNEL_HEADERS=$PWD/source_build/Linux_for_Tegra/source/kernel/kernel-jammy-src
86+
cd source_build/Linux_for_Tegra/source/
8787
make dtbs
8888
```
8989

9090
Copy the overlay DTB to the Jetson via Micro-USB
9191
```
92-
DTB_PATH="$ARK_JETSON_KERNEL_DIR/source_build/Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs/"
92+
DTB_PATH="$PWD/source_build/Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs/"
9393
OVERLAY_DTB=<your_overlay>
9494
scp $DTB_PATH/$OVERLAY_DTB jetson@192.168.55.1:~
9595
```
@@ -143,4 +143,4 @@ https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/HR/JetsonModuleAdap
143143
**Orin Nano 8GB-DRAM** : tegra234-p3768-0000+p3767-**0003**-nv.dtb <br>
144144
**Orin Nano 4GB-DRAM** : tegra234-p3768-0000+p3767-**0004**-nv.dtb <br>
145145

146-
The device tree files for Jetson Orin Nano/NX can be found in the kernel source directory at **Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public**. We maintain a [repository](https://github.com/ARK-Electronics/ark_jetson_orin_nano_nx_device_tree ) with these files which is cloned into **$ARK_JETSON_KERNEL_DIR/source_build** in the source build setup script. If you want to modify the device tree you will need to modify the files in this repo and and copy them into the correct location in the source build. <br>
146+
The device tree files for Jetson Orin Nano/NX can be found in the kernel source directory at **Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public**. We maintain a [repository](https://github.com/ARK-Electronics/ark_jetson_orin_nano_nx_device_tree ) with these files which is cloned into **source_build/** in the source build setup script. If you want to modify the device tree you will need to modify the files in this repo and and copy them into the correct location in the source build. <br>

build_kernel.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
START_TIME=$(date +%s)
44

55
sudo -v
6+
export ARK_JETSON_KERNEL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
67
export CROSS_COMPILE=$HOME/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
78
export KERNEL_HEADERS=$ARK_JETSON_KERNEL_DIR/source_build/Linux_for_Tegra/source/kernel/kernel-jammy-src
89
export INSTALL_MOD_PATH=$ARK_JETSON_KERNEL_DIR/prebuilt/Linux_for_Tegra/rootfs/

configure_user.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ USER="jetson"
44
PASSWORD="jetson"
55
HOST="jetson"
66

7+
export ARK_JETSON_KERNEL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
78
sudo $ARK_JETSON_KERNEL_DIR/prebuilt/Linux_for_Tegra/tools/l4t_create_default_user.sh -u $USER -p $PASSWORD -n $HOST -a --accept-license

copy_dtbs_to_prebuilt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
export ARK_JETSON_KERNEL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
23
SOURCE_BUILD_PATH="$ARK_JETSON_KERNEL_DIR/source_build/Linux_for_Tegra/"
34
DTBS_SOURCE_PATH="$SOURCE_BUILD_PATH/source/kernel-devicetree/generic-dts/dtbs/"
45
PREBUILT_PATH="$ARK_JETSON_KERNEL_DIR/prebuilt/Linux_for_Tegra"

flash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ while ! lsusb | grep -q "NVIDIA Corp. APX"; do
99
done
1010

1111
pushd .
12-
cd $ARK_JETSON_KERNEL_DIR/prebuilt/Linux_for_Tegra/
12+
cd prebuilt/Linux_for_Tegra/
1313
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
1414
-p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" -c ./tools/kernel_flash/flash_l4t_t234_nvme.xml \
1515
--erase-all --showlogs --network usb0 jetson-orin-nano-devkit nvme0n1p1

setup.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,7 @@ sudo_refresh_loop &
4949
SUDO_PID=$!
5050
START_TIME=$(date +%s)
5151

52-
# Add to bashrc if necessary
53-
BASHRC="$HOME/.bashrc"
54-
exists=$(cat $BASHRC | grep "ARK_JETSON_KERNEL_DIR")
55-
if [ -z "$exists" ]; then
56-
echo "export ARK_JETSON_KERNEL_DIR=$PWD" >> $BASHRC
57-
export ARK_JETSON_KERNEL_DIR=$PWD
58-
fi
59-
52+
export ARK_JETSON_KERNEL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6053
export L4T_RELEASE_PACKAGE=$(basename $BSP_URL)
6154
export SAMPLE_FS_PACKAGE=$(basename $ROOT_FS_URL)
6255
export BOARD="jetson-orin-nano-devkit"

0 commit comments

Comments
 (0)