Skip to content

Commit 376a8c7

Browse files
Wojciech GładyszWojciech Gładysz
authored andcommitted
specific release patches
1 parent baac855 commit 376a8c7

3 files changed

Lines changed: 26 additions & 19 deletions

File tree

apply_patches.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,29 @@ fi
4545

4646
apply_external_patches() {
4747
if [ $1 = 'apply' ]; then
48-
git -C sources_$JETPACK_VERSION/$2 apply ${PWD}/$2/$JETPACK_VERSION/*
48+
echo WOJTEK: git -C sources_$JETPACK_VERSION/$3 apply ${PWD}/$3/$2/*
49+
git -C sources_$JETPACK_VERSION/$3 apply ${PWD}/$3/$2/*
4950
elif [ $1 = 'reset' ]; then
50-
if [[ -n $(git -C sources_$JETPACK_VERSION/$2 diff --quiet) || -n $(git -C sources_$JETPACK_VERSION/$2 diff --cached --quiet) ]]; then
51-
read -p "Repo sources_$JETPACK_VERSION/$2 has changes that will be hard reset. Continue? (y/N): " confirm
51+
if [[ -n $(git -C sources_$JETPACK_VERSION/$3 diff --quiet) || -n $(git -C sources_$JETPACK_VERSION/$3 diff --cached --quiet) ]]; then
52+
read -p "Repo sources_$JETPACK_VERSION/$3 has changes that will be hard reset. Continue? (y/N): " confirm
5253
if [[ ! "$confirm" == "y" && ! "$confirm" == "Y" ]]; then
5354
exit 1
5455
fi
5556
fi
56-
git -C sources_$JETPACK_VERSION/$2 reset --hard $3
57+
git -C sources_$JETPACK_VERSION/$2 reset --hard $4
5758
fi
5859
}
5960

60-
apply_external_patches $1 $D4XX_SRC_DST $L4T_VERSION
61+
apply_external_patches $1 $2 $D4XX_SRC_DST $L4T_VERSION
6162

6263
if [ -d ${KERNEL_DIR}/${JETPACK_VERSION} ]; then
63-
apply_external_patches $1 $KERNEL_DIR $L4T_VERSION
64+
apply_external_patches $1 $2 $KERNEL_DIR $L4T_VERSION
6465
fi
6566

6667
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
67-
apply_external_patches $1 hardware/nvidia/t23x/nv-public $L4T_VERSION
68+
apply_external_patches $1 $2 hardware/nvidia/t23x/nv-public $L4T_VERSION
6869
else
69-
apply_external_patches $1 hardware/nvidia/platform/t19x/galen/kernel-dts $L4T_VERSION
70+
apply_external_patches $1 $2 hardware/nvidia/platform/t19x/galen/kernel-dts $L4T_VERSION
7071
fi
7172

7273
if [ $1 = 'apply' ]; then
@@ -79,4 +80,5 @@ if [ $1 = 'apply' ]; then
7980
fi
8081
elif [ $1 = 'reset' ]; then
8182
[[ -f $DEVDIR/sources_$JETPACK_VERSION/${D4XX_SRC_DST}/drivers/media/i2c/d4xx.c ]] && rm $DEVDIR/sources_$JETPACK_VERSION/${D4XX_SRC_DST}/drivers/media/i2c/d4xx.c
83+
[[ -f $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi ]] && rm $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi
8284
fi

apply_patches_ext.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ else
3838
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.
41-
if [ -d $1/hardware/nvidia/platform/t19x/galen-industrial-dts ]; then
42-
mv $1/hardware/nvidia/platform/t19x/galen-industrial-dts $1/hardware/nvidia/platform/t19x/galen-industrial
41+
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
4343
fi
4444

4545
apply_external_patches() {
46-
cat ${PWD}/$2/$JETPACK_VERSION/* | patch -p1 --directory=${PWD}/sources_$1/$2
46+
ls -ld ${PWD}/$2/$JETPACK_VERSION
47+
ls -ld ${PWD}/sources_$JETPACK_VERSION/$2
48+
ls ${PWD}/$2/$JETPACK_VERSION
49+
cat ${PWD}/$2/$JETPACK_VERSION/* | patch -p1 --directory=${PWD}/sources_$JETPACK_VERSION/$2
4750
}
4851

4952
apply_external_patches $1 $D4XX_SRC_DST
@@ -57,10 +60,10 @@ else
5760
fi
5861

5962
# For a common driver for JP4 + JP5 we override the i2c driver and ignore the previous that was created from patches
60-
cp $DEVDIR/kernel/realsense/d4xx.c $DEVDIR/sources_$1/${D4XX_SRC_DST}/drivers/media/i2c/
63+
cp $DEVDIR/kernel/realsense/d4xx.c $DEVDIR/sources_$JETPACK_VERSION/${D4XX_SRC_DST}/drivers/media/i2c/
6164
if [[ "$JETPACK_VERSION" == "6.x" ]]; then
6265
# jp6 overlay
63-
cp $DEVDIR/hardware/realsense/tegra234-camera-d4xx-overlay*.dts $DEVDIR/sources_$1/hardware/nvidia/t23x/nv-public/overlay/
66+
cp $DEVDIR/hardware/realsense/tegra234-camera-d4xx-overlay*.dts $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/t23x/nv-public/overlay/
6467
else
65-
cp $DEVDIR/hardware/realsense/$JP5_D4XX_DTSI $DEVDIR/sources_$1/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi
68+
cp $DEVDIR/hardware/realsense/$JP5_D4XX_DTSI $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi
6669
fi

scripts/setup-common

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ if [[ "$JETPACK_VERSION" =~ ^6\.[0-2]$ ]]; then
1818
L4T_VERSION="jetson_36.3"
1919
fi;
2020
JETPACK_VERSION="6.x"
21-
elif [[ $JETPACK_VERSION == "5.1.2" ]]; then
22-
L4T_VERSION="jetson_35.4.1"
23-
KERNEL_DIR="kernel/kernel-5.10"
24-
elif [[ $JETPACK_VERSION == "5.0.2" ]]; then
25-
L4T_VERSION="jetson_35.1"
21+
elif [[ "$JETPACK_VERSION" =~ 5.[0-1].2" ]]; then
2622
KERNEL_DIR="kernel/kernel-5.10"
23+
if [[ $JETPACK_VERSION == "5.1.2" ]]; then
24+
L4T_VERSION="jetson_35.4.1"
25+
elif [[ $JETPACK_VERSION == "5.0.2" ]]; then
26+
L4T_VERSION="jetson_35.1"
27+
fi
28+
JETPACK_VERSION="5.x"
2729
elif [[ $JETPACK_VERSION == "4.6.1" ]]; then
2830
L4T_VERSION="tegra-l4t-r32.7.1"
2931
KERNEL_DIR="kernel/kernel-4.9"

0 commit comments

Comments
 (0)