Skip to content

Commit 9639bf0

Browse files
committed
git action handling reworked, readme files reviewed
1 parent abc6a3f commit 9639bf0

11 files changed

Lines changed: 87 additions & 76 deletions

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ Please follow the [instruction](https://docs.nvidia.com/sdk-manager/install-with
3030
# JetPack build
3131

3232
- [JetPack 6.x](./README_JP6.md#build-environment-prerequisites)
33-
- [JetPack 5.1.2](./README_JP5.md#build-kernel-dtb-and-d457-driver)
34-
- [JetPack 5.0.2](./README_JP5.md#build-kernel-dtb-and-d457-driver)
33+
- [JetPack 5.x.2](./README_JP5.md#build-kernel-dtb-and-d457-driver)
3534
- [JetPack 4.6.1](./README_JP4.md#build-kernel-dtb-and-d457-driver)
3635

3736
### Verify driver after installation

README_JP4.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The system shall include:
1212
1313
### Links
1414
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
15-
- Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.0](./README_JP6.md) setup guide
15+
- Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
1616
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
1717
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
1818
- Build Tools manual page [Build Manual page](./README_tools.md)
@@ -54,7 +54,7 @@ cd ../../..
5454
sudo apt install build-essential bc flex bison
5555
5656
# apply patches
57-
./apply_patches_ext.sh ./Linux_for_Tegra/source/public 4.6.1
57+
./apply_patches_ext.sh 4.6.1 ./Linux_for_Tegra/source/public
5858
5959
# remove BUILD_NUMBER env dependency kernel vermagic
6060
sed -i s/'UTS_RELEASE=\$(KERNELRELEASE)-ab\$(BUILD_NUMBER)'/'UTS_RELEASE=\$(KERNELRELEASE)'/g ./Linux_for_Tegra/source/public/kernel/kernel-4.9/Makefile
@@ -170,4 +170,4 @@ echo 1 | sudo tee /sys/bus/i2c/drivers/max9295/30-0040/refresh_setting
170170
echo 1 | sudo tee /sys/bus/i2c/drivers/max9296/30-0048/refresh_setting
171171
```
172172
**NOTE**
173-
- It's recommended to save the original kernel image as backup boot option in `/boot/extlinux/extlinux.conf`.
173+
- It's recommended to save the original kernel image as backup boot option in `/boot/extlinux/extlinux.conf`.

README_JP5.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The system shall include:
1212
1313
### Links
1414
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
15-
- Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.0](./README_JP6.md) setup guide
15+
- Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
1616
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
1717
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
1818
- Build Tools manual page [Build Manual page](./README_tools.md)
@@ -37,8 +37,8 @@ Download Jetson Linux source code tarball from
3737

3838
## JetPack 5.1.2
3939
```
40-
mkdir -p l4t-gcc/5.1.2
41-
cd ./l4t-gcc/5.1.2
40+
mkdir -p l4t-gcc/5.x
41+
cd ./l4t-gcc/5.x
4242
wget https://developer.nvidia.com/embedded/jetson-linux/bootlin-toolchain-gcc-93 -O aarch64--glibc--stable-final.tar.gz
4343
tar xf aarch64--glibc--stable-final.tar.gz
4444
cd ../..
@@ -49,8 +49,8 @@ tar xjf kernel_src.tbz2
4949
```
5050
## JetPack 5.0.2
5151
```
52-
mkdir -p l4t-gcc/5.0.2
53-
cd ./l4t-gcc/5.0.2
52+
mkdir -p l4t-gcc/5.x
53+
cd ./l4t-gcc/5.x
5454
wget https://developer.nvidia.com/embedded/jetson-linux/bootlin-toolchain-gcc-93 -O aarch64--glibc--stable-final.tar.gz
5555
tar xf aarch64--glibc--stable-final.tar.gz --strip-components 1
5656
cd ../..
@@ -68,7 +68,7 @@ cd ../../..
6868
sudo apt install build-essential bc flex bison
6969
7070
# apply patches
71-
./apply_patches_ext.sh ./Linux_for_Tegra/source/public 5.0.2
71+
./apply_patches_ext.sh 5.0.2 ./Linux_for_Tegra/source/public
7272
7373
# build kernel, dtb and D457 driver
7474
./build_all.sh 5.0.2 ./Linux_for_Tegra/source/public
@@ -108,21 +108,21 @@ Building with `build_all.sh`
108108

109109
The necessary files are:
110110

111-
- kernel image `images/<JetPack_version>/arch/arm64/boot/Image`
112-
- dtb `images/5.0.2/arch/arm64/boot/dts/nvidia/tegra194-p2888-0001-p2822-0000.dtb`
113-
- D457 driver `images/5.0.2/drivers/media/i2c/d4xx.ko`
114-
- UVC Video driver `images/5.0.2/drivers/media/usb/uvc/uvcvideo.ko`
115-
- V4L2 Core Video driver `images/5.0.2/drivers/media/v4l2-core/videobuf-core.ko`
116-
- V4L2 VMalloc Video driver `images/5.0.2/drivers/media/v4l2-core/videobuf-vmalloc.ko`
111+
- kernel image `images/5.x/arch/arm64/boot/Image`
112+
- dtb `images/5.x/arch/arm64/boot/dts/nvidia/tegra194-p2888-0001-p2822-0000.dtb`
113+
- D457 driver `images/5.x/drivers/media/i2c/d4xx.ko`
114+
- UVC Video driver `images/5.x/drivers/media/usb/uvc/uvcvideo.ko`
115+
- V4L2 Core Video driver `images/5.x/drivers/media/v4l2-core/videobuf-core.ko`
116+
- V4L2 VMalloc Video driver `images/5.x/drivers/media/v4l2-core/videobuf-vmalloc.ko`
117117

118118
Copy build results from Host to Jetson target `10.0.0.116` user `nvidia`
119119
```
120-
scp ./images/5.0.2/arch/arm64/boot/Image nvidia@10.0.0.116:~/
121-
scp ./images/5.0.2/arch/arm64/boot/dts/nvidia/tegra194-p2888-0001-p2822-0000.dtb nvidia@10.0.0.116:~/
122-
scp ./images/5.0.2/drivers/media/i2c/d4xx.ko nvidia@10.0.0.116:~/
123-
scp ./images/5.0.2/drivers/media/usb/uvc/uvcvideo.ko nvidia@10.0.0.116:~/
124-
scp ./images/5.0.2/drivers/media/v4l2-core/videobuf-core.ko nvidia@10.0.0.116:~/
125-
scp ./images/5.0.2/drivers/media/v4l2-core/videobuf-vmalloc.ko nvidia@10.0.0.116:~/
120+
scp ./images/5.x/arch/arm64/boot/Image nvidia@10.0.0.116:~/
121+
scp ./images/5.x/arch/arm64/boot/dts/nvidia/tegra194-p2888-0001-p2822-0000.dtb nvidia@10.0.0.116:~/
122+
scp ./images/5.x/drivers/media/i2c/d4xx.ko nvidia@10.0.0.116:~/
123+
scp ./images/5.x/drivers/media/usb/uvc/uvcvideo.ko nvidia@10.0.0.116:~/
124+
scp ./images/5.x/drivers/media/v4l2-core/videobuf-core.ko nvidia@10.0.0.116:~/
125+
scp ./images/5.x/drivers/media/v4l2-core/videobuf-vmalloc.ko nvidia@10.0.0.116:~/
126126
```
127127

128128
Copy them to the right places on Jetson target:

README_JP6.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
The Intel® RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.
55
The system shall include:
66
* NVIDIA® Jetson™ platform Supported JetPack versions are:
7-
[6.2 production release](https://developer.nvidia.com/embedded/jetpack-sdk-62)
8-
[6.1 production release](https://developer.nvidia.com/embedded/jetpack-sdk-61)
9-
[6.0 production release](https://developer.nvidia.com/embedded/jetpack-sdk-60)
7+
- [6.2 production release](https://developer.nvidia.com/embedded/jetpack-sdk-62)
8+
- [6.1 production release](https://developer.nvidia.com/embedded/jetpack-sdk-61)
9+
- [6.0 production release](https://developer.nvidia.com/embedded/jetpack-sdk-60)
1010
* RealSense™ [De-Serialize board](https://store.intelrealsense.com/buy-intel-realsense-des457.html)
1111
* Jetson AGX Orin™ Passive adapter board from [Leopard Imaging® LI-JTX1-SUB-ADPT](https://leopardimaging.com/product/accessories/adapters-carrier-boards/for-nvidia-jetson/li-jtx1-sub-adpt/)
1212
* RS MIPI camera [D457](https://store.intelrealsense.com/buy-intel-realsense-depth-camera-d457.html)
@@ -93,6 +93,7 @@ Note: dev_dbg() log support will not be enabled by default. If needed, run the `
9393
```
9494

9595
## Archive JetPack 6.x build results (optional) on build host
96+
Assuning 6.0 build the kernel version is 5.15.136-tegra. For 6.1 and 6.2 build the kernel version is 5.15.148-tegra.
9697
- kernel image : `images/6.x/rootfs/boot/Image`
9798
- dtb: `images/6.x/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb`
9899
- dtb overlay: `images/6.x/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo`

README_driver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Links
66
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
7-
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.0](./README_JP6.md) setup guide
7+
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
88
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
99
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
1010
- Build Tools manual page [Build Manual page](./README_tools.md)

README_tools.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Links
66
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
7-
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.0](./README_JP6.md) setup guide
7+
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
88
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
99
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
1010
- Build Tools manual page [Build Manual page](./README_tools.md)
@@ -25,9 +25,8 @@ This script prepare all necessary tools and sources to build JetPack BSP.
2525

2626
The following directories will be created:
2727
- JetPack 4.6.1: `sources_4.6.1`
28-
- JetPack 5.0.2: `sources_5.0.2`
29-
- JetPack 5.1.2: `sources_5.1.2`
30-
- JetPack 6.0: `sources_6.0`
28+
- JetPack 5.x.2: `sources_5.x`
29+
- JetPack 6.x: `sources_6.x`
3130
```
3231
./setup_workspace.sh [JetPack_version]
3332
```
@@ -41,7 +40,7 @@ Apply D457 patches for kernel image, dtb and D457 driver.
4140
```
4241
./apply_patches.sh [--one-cam | --dual-cam] apply [JetPack_version]
4342
```
44-
Reset D457 patches for kernel image, dtb and D457 driver.
43+
Reset D457 patches (and any other changes) for kernel image, dtb and D457 driver.
4544
```
4645
./apply_patches.sh reset [JetPack_version]
4746
```
@@ -58,15 +57,15 @@ When setup_workspace.sh was not used, using sources direct download method (exam
5857

5958
Apply D457 patches for external build the kernel image, dtb and D457 driver.
6059
```
61-
./apply_patches_ext.sh [--one-cam | --dual-cam] ./Linux_for_tegra/source/public [JetPack_version]
60+
./apply_patches_ext.sh [--one-cam | --dual-cam] [JetPack_version] [./Linux_for_tegra/source/public]
6261
```
6362
Example: for JP5.0.2, source path is ./Linux_for_tegra/source :
6463
```
65-
./apply_patches_ext.sh ./Linux_for_tegra/source 5.0.2
64+
./apply_patches_ext.sh 5.0.2 ./Linux_for_tegra/source
6665
```
6766

6867
# build_all.sh
69-
build kernel and modules only
68+
Build kernel and modules only
7069
```
7170
./build_all.sh [JetPack_version] [JetPack_source_dir]
7271
```
@@ -80,9 +79,8 @@ Example: build JetPack 5.0.2 workspace created by direct source download
8079
```
8180
The following directories will be created:
8281
- JetPack 4.6.1: `images/4.6.1`
83-
- JetPack 5.0.2: `images/5.0.2`
84-
- JetPack 5.1.2: `images/5.1.2`
85-
- JetPack 6.0: `images/6.0`
82+
- JetPack 5.x.2: `images/5.x`
83+
- JetPack 6.x: `images/6.x`
8684

8785
# build_all_deb.sh
8886
Build kernel Debian packages for JetPack 5.0.2 or 4.6.1
@@ -103,4 +101,4 @@ Example:
103101

104102
- Each JetPack version's kernel may be different, the user needs to change the kernel version in file names and paths accordingly, for example for JetPack 4.6.1 the version is `4.9.253-d457` or `4.9.253-tegra`, depending on the build method applied.
105103
- For JetPack 4.6.1, the dtb file is not included in the deb package. User needs to manually copy `images/4.6.1/arch/arm64/boot/dts/tegra194-p2888-0001-p2822-0000.dtb` file to board and edit `extlinux.conf` to point to it.
106-
- It's recommended to save the original kernel image as backup boot option in `/boot/extlinux/extlinux.conf`.
104+
- It's recommended to save the original kernel image as backup boot option in `/boot/extlinux/extlinux.conf`.

apply_patches_ext.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fi
3939
# NVIDIA SDK Manager's JetPack 4.6.1 source_sync.sh doesn't set the right folder name, it mismatches with the direct tar
4040
# package source code. Correct the folder name.
4141
if [ -d $JETPACK_VERSION/hardware/nvidia/platform/t19x/galen-industrial-dts ]; then
42-
mv $1/hardware/nvidia/platform/t19x/galen-industrial-dts $JETPACK_VERSION/hardware/nvidia/platform/t19x/galen-industrial
42+
mv $JETPACK_VERSION/hardware/nvidia/platform/t19x/galen-industrial-dts $JETPACK_VERSION/hardware/nvidia/platform/t19x/galen-industrial
4343
fi
4444

4545
apply_external_patches() {

scripts/source_sync_4.6.1.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,22 @@ function DownloadAndSync {
171171

172172
if [ -d "${LDK_SOURCE_DIR}" ]; then
173173
echo "Directory for $WHAT, ${LDK_SOURCE_DIR}, already exists!"
174-
pushd "${LDK_SOURCE_DIR}" > /dev/null
175-
if ! git status 2>&1 >/dev/null; then
174+
if ! git -C $LDK_SOURCE_DIR status 2>&1 >/dev/null; then
176175
echo "But the directory is not a git repository -- clean it up first"
177176
echo ""
178177
popd > /dev/null
178+
return 1
179+
fi
180+
if ! git -C $LDK_SOURCE_DIR fetch --all 2>&1 >/dev/null; then
181+
echo "$2 source sync failed"
179182
return 2
180183
fi
181-
git fetch --all 2>&1 >/dev/null
182-
popd > /dev/null
183184
else
184185
echo "Downloading default $WHAT source..."
185186

186187
if ! git clone -n "$REPO_URL" ${LDK_SOURCE_DIR} 2>&1 >/dev/null; then
187188
echo "$2 source sync failed"
188-
return 1
189+
return 3
189190
fi
190191

191192
echo "The default $WHAT source is downloaded in: ${LDK_SOURCE_DIR}"
@@ -207,13 +208,13 @@ function DownloadAndSync {
207208
else
208209
echo "$2 could not sync to tag $TAG!"
209210
echo
210-
return 3
211+
return 4
211212
fi
212213
else
213214
echo "Couldn't find tag $TAG"
214215
echo "$2 source sync to tag $TAG failed!"
215216
echo
216-
return 4
217+
return 5
217218
fi
218219
fi
219220
echo
@@ -315,9 +316,11 @@ for ((i=0; i < NSOURCES; i++)); do
315316
if DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "https://${REPO}" "${TAG}" "${OPT}"; then
316317
true
317318
else
318-
if [[ $? == 1 ]]; then
319+
if [[ $? == 3 ]]; then
319320
echo "Trying git protocol"
320321
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"
322+
else
323+
exit 1
321324
fi
322325
fi
323326
fi

scripts/source_sync_5.0.2.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function Usages {
115115
echo "Available general options are,"
116116
echo " -h : help"
117117
echo " -d [DIR] : root of source is DIR"
118-
echo " -t [TAG] : Git tag that will be used to sync all the sources"
118+
echo " -t [TAG] : git tag that will be used to sync all the sources"
119119
echo ""
120120
echo "By default, all sources are downloaded."
121121
echo "Only specified sources are downloaded, if one or more of the following options are mentioned."
@@ -182,21 +182,22 @@ function DownloadAndSync {
182182

183183
if [ -d "${LDK_SOURCE_DIR}" ]; then
184184
echo "Directory for $WHAT, ${LDK_SOURCE_DIR}, already exists!"
185-
pushd "${LDK_SOURCE_DIR}" > /dev/null
186-
if ! git status 2>&1 >/dev/null; then
185+
if ! git -C $LDK_SOURCE_DIR status 2>&1 >/dev/null; then
187186
echo "But the directory is not a git repository -- clean it up first"
188187
echo ""
189188
popd > /dev/null
189+
return 1
190+
fi
191+
if ! git -C $LDK_SOURCE_DIR fetch --all 2>&1 >/dev/null; then
192+
echo "$2 source sync failed"
190193
return 2
191194
fi
192-
git fetch --all 2>&1 >/dev/null
193-
popd > /dev/null
194195
else
195196
echo "Downloading default $WHAT source..."
196197

197198
if ! git clone -n "$REPO_URL" ${LDK_SOURCE_DIR} 2>&1 >/dev/null; then
198-
echo "$2 source sync failed!"
199-
return 1
199+
echo "$2 source sync failed"
200+
return 3
200201
fi
201202

202203
echo "The default $WHAT source is downloaded in: ${LDK_SOURCE_DIR}"
@@ -218,20 +219,20 @@ function DownloadAndSync {
218219
else
219220
echo "$2 could not sync to tag $TAG!"
220221
echo
221-
return 3
222+
return 4
222223
fi
223224
else
224225
echo "Couldn't find tag $TAG"
225226
echo "$2 source sync to tag $TAG failed!"
226227
echo
227-
return 4
228+
return 5
228229
fi
229230
fi
230231
echo
231232
}
232233

233234
# prepare processing ....
234-
GETOPT=":ehd:t:"
235+
GETOPT=":hd:t:"
235236

236237
OIFS="$IFS"
237238
IFS=$(echo -en "\n\b")
@@ -326,9 +327,11 @@ for ((i=0; i < NSOURCES; i++)); do
326327
if DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "https://${REPO}" "${TAG}" "${OPT}"; then
327328
true
328329
else
329-
if [[ $? == 1 ]]; then
330+
if [[ $? == 3 ]]; then
330331
echo "Trying git protocol"
331332
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"
333+
else
334+
exit 1
332335
fi
333336
fi
334337
fi

0 commit comments

Comments
 (0)