3939
4040# NVIDIA SDK Manager's JetPack 4.6.1 source_sync.sh doesn't set the right folder name, it mismatches with the direct tar
4141# package source code. Correct the folder name.
42- if [ -d sources_$JETPACK_VERSION /hardware/nvidia/platform/t19x/galen-industrial-dts ]; then
42+ if [[ $1 == apply && -d sources_$JETPACK_VERSION /hardware/nvidia/platform/t19x/galen-industrial-dts ] ]; then
4343 mv sources_$JETPACK_VERSION /hardware/nvidia/platform/t19x/galen-industrial-dts sources_$JETPACK_VERSION /hardware/nvidia/platform/t19x/galen-industrial
4444fi
45+ if [[ $1 == reset && -d sources_$JETPACK_VERSION /hardware/nvidia/platform/t19x/galen-industrial ]]; then
46+ rm -rfv sources_$JETPACK_VERSION /hardware/nvidia/platform/t19x/galen-industrial > /dev/null
47+ fi
4548
4649apply_external_patches () {
4750 if [ $1 = ' apply' ]; then
48- echo WOJTEK: git -C sources_$JETPACK_VERSION /$3 apply ${PWD} /$3 /$2 /*
49- git -C sources_$JETPACK_VERSION /$3 apply ${PWD} /$3 /$2 /*
51+ ls -Ld sources_$JETPACK_VERSION /$3
52+ ls -Lw1 ${PWD} /$3 /$2
53+ git -C sources_$JETPACK_VERSION /$3 apply -vq ${PWD} /$3 /$2 /*
5054 elif [ $1 = ' reset' ]; then
5155 if [[ -n $( git -C sources_$JETPACK_VERSION /$3 diff --quiet) || -n $( git -C sources_$JETPACK_VERSION /$3 diff --cached --quiet) ]]; then
5256 read -p " Repo sources_$JETPACK_VERSION /$3 has changes that will be hard reset. Continue? (y/N): " confirm
5357 if [[ ! " $confirm " == " y" && ! " $confirm " == " Y" ]]; then
5458 exit 1
5559 fi
5660 fi
57- git -C sources_$JETPACK_VERSION /$2 reset --hard $4
61+ echo -n $( ls -d sources_$JETPACK_VERSION /$3 ) :\
62+ git -C sources_$JETPACK_VERSION /$3 reset --hard $4
5863 fi
5964}
6065
6166apply_external_patches $1 $2 $D4XX_SRC_DST $L4T_VERSION
6267
63- if [ -d ${KERNEL_DIR} / ${JETPACK_VERSION} ]; then
68+ if [ -d sources_ $JETPACK_VERSION / $KERNEL_DIR ]; then
6469 apply_external_patches $1 $2 $KERNEL_DIR $L4T_VERSION
6570fi
6671
6772if [[ " $JETPACK_VERSION " == " 6.x" ]]; then
68- apply_external_patches $1 $2 hardware/nvidia/t23x/nv-public $L4T_VERSION
73+ apply_external_patches $1 $JETPACK_VERSION hardware/nvidia/t23x/nv-public $L4T_VERSION
6974else
7075 apply_external_patches $1 $2 hardware/nvidia/platform/t19x/galen/kernel-dts $L4T_VERSION
7176fi
@@ -81,4 +86,5 @@ if [ $1 = 'apply' ]; then
8186elif [ $1 = ' reset' ]; then
8287 [[ -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
8388 [[ -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
89+ true
8490fi
0 commit comments