Skip to content

Commit 37c5285

Browse files
committed
path added to apply_patches_ext.sh according to 6.0 setup instructions
1 parent 2d711d3 commit 37c5285

4 files changed

Lines changed: 27 additions & 11 deletions

File tree

README_JP6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ tar xjf kernel_oot_modules_src.tbz2
8282
tar xjf nvidia_kernel_display_driver_source.tbz2
8383
cd ../..
8484
85-
./apply_patches_ext.sh ./Linux_for_Tegra/source 6.2
85+
./apply_patches_ext.sh 6.2 Linux_for_Tegra/source
8686
8787
# build kernel, dtb and D457 driver
8888
./build_all.sh 6.2 ./Linux_for_Tegra/source

apply_patches.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,20 @@ if [[ $1 == reset && -d sources_$JETPACK_VERSION/hardware/nvidia/platform/t19x/g
4747
fi
4848

4949
apply_external_patches() {
50+
git -C sources_$JETPACK_VERSION/$3 status > /dev/null
5051
if [ $1 = 'apply' ]; then
51-
ls -Ld sources_$JETPACK_VERSION/$3
52+
if ! git -C sources_$JETPACK_VERSION/$3 diff --quiet || ! git -C sources_$JETPACK_VERSION/$3 diff --cached --quiet; then
53+
read -p "Repo sources_$JETPACK_VERSION/$3 has changes that may disturb applying patches. Continue (y/N)? " confirm
54+
if [[ ! "$confirm" == "y" && ! "$confirm" == "Y" ]]; then
55+
exit 1
56+
fi
57+
fi
58+
ls -Ld ${PWD}/$3/$2
5259
ls -Lw1 ${PWD}/$3/$2
5360
git -C sources_$JETPACK_VERSION/$3 apply ${PWD}/$3/$2/*
5461
elif [ $1 = 'reset' ]; then
55-
if [[ -n $(git -C sources_$JETPACK_VERSION/$3 diff --quiet) || -n $(git -C sources_$JETPACK_VERSION/$3 diff --cached --quiet) ]]; then
56-
read -p "Repo sources_$JETPACK_VERSION/$3 has changes that will be hard reset. Continue? (y/N): " confirm
62+
if ! git -C sources_$JETPACK_VERSION/$3 diff --quiet || ! git -C sources_$JETPACK_VERSION/$3 diff --cached --quiet; then
63+
read -p "Repo sources_$JETPACK_VERSION/$3 has changes that will be hard reset. Continue (y/N)? " confirm
5764
if [[ ! "$confirm" == "y" && ! "$confirm" == "Y" ]]; then
5865
exit 1
5966
fi

apply_patches_ext.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -e
55

66
if [[ $# < 1 ]]; then
7-
echo "apply_patches_ext.sh [--one-cam | --dual-cam] [JetPack_version]"
7+
echo "apply_patches_ext.sh [--one-cam | --dual-cam] [JetPack_version] [JetPack_source]"
88
exit 1
99
fi
1010

@@ -43,21 +43,30 @@ if [ -d $JETPACK_VERSION/hardware/nvidia/platform/t19x/galen-industrial-dts ]; t
4343
fi
4444

4545
apply_external_patches() {
46+
TARGET=sources_$JETPACK_VERSION
47+
[[ -n $3 ]] && TARGET=$3
48+
git -C $PWD/$TARGET/$2 status > /dev/null
49+
if ! git -C $PWD/$TARGET/$2 diff --quiet || ! git -C $PWD/$TARGET/$2 diff --cached --quiet; then
50+
read -p "Repo $PWD/$TARGET/$2 has changes that may disturb applying patches. Continue (y/N)? " confirm
51+
if [[ ! "$confirm" == "y" && ! "$confirm" == "Y" ]]; then
52+
exit 1
53+
fi
54+
fi
4655
ls -Ld ${PWD}/$2/$1
4756
ls -Lw1 ${PWD}/$2/$1
48-
cat ${PWD}/$2/$1/* | patch --quiet -p1 --directory=${PWD}/sources_$JETPACK_VERSION/$2
57+
cat ${PWD}/$2/$1/* | patch --quiet -p1 --directory=${PWD}/$TARGET/$2
4958
}
5059

51-
apply_external_patches $1 $D4XX_SRC_DST
60+
apply_external_patches $1 $D4XX_SRC_DST $2
5261

5362
if [ -d sources_$JETPACK_VERSION/$KERNEL_DIR ]; then
54-
apply_external_patches $1 $KERNEL_DIR
63+
apply_external_patches $1 $KERNEL_DIR $2
5564
fi
5665

5766
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
58-
apply_external_patches $JETPACK_VERSION hardware/nvidia/t23x/nv-public
67+
apply_external_patches $JETPACK_VERSION hardware/nvidia/t23x/nv-public $2
5968
else
60-
apply_external_patches $1 hardware/nvidia/platform/t19x/galen/kernel-dts
69+
apply_external_patches $1 hardware/nvidia/platform/t19x/galen/kernel-dts $2
6170
fi
6271

6372
# For a common driver for JP4 + JP5 we override the i2c driver and ignore the previous that was created from patches

scripts/setup-common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export L4T_VERSION="jetson_35.1"
55
export KERNEL_DIR="kernel/kernel-5.10"
66

77
if [[ -z "$1" ]]; then
8-
JETPACK_VERSION="6.2"
8+
JETPACK_VERSION="5.0.2"
99
fi
1010

1111
if [[ "$JETPACK_VERSION" =~ ^6\.[0-2]$ ]]; then

0 commit comments

Comments
 (0)