|
4 | 4 | set -e |
5 | 5 |
|
6 | 6 | 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]" |
8 | 8 | exit 1 |
9 | 9 | fi |
10 | 10 |
|
@@ -43,21 +43,30 @@ if [ -d $JETPACK_VERSION/hardware/nvidia/platform/t19x/galen-industrial-dts ]; t |
43 | 43 | fi |
44 | 44 |
|
45 | 45 | 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 |
46 | 55 | ls -Ld ${PWD}/$2/$1 |
47 | 56 | 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 |
49 | 58 | } |
50 | 59 |
|
51 | | -apply_external_patches $1 $D4XX_SRC_DST |
| 60 | +apply_external_patches $1 $D4XX_SRC_DST $2 |
52 | 61 |
|
53 | 62 | if [ -d sources_$JETPACK_VERSION/$KERNEL_DIR ]; then |
54 | | - apply_external_patches $1 $KERNEL_DIR |
| 63 | + apply_external_patches $1 $KERNEL_DIR $2 |
55 | 64 | fi |
56 | 65 |
|
57 | 66 | 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 |
59 | 68 | 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 |
61 | 70 | fi |
62 | 71 |
|
63 | 72 | # For a common driver for JP4 + JP5 we override the i2c driver and ignore the previous that was created from patches |
|
0 commit comments