]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - scripts/rt-patch.sh
arm64: config: Enable CDC-ACM driver in kernel
[hercules2020/nv-tegra/linux-4.4.git] / scripts / rt-patch.sh
1 #!/bin/bash
2
3 # The script helps to apply/revert RT patches to/from
4 # K4.4 kernel source
5
6 any_failure=0
7 apply_rt_patches()
8 {
9         file_list=`find ../rt-patches -name \*.patch -type f | sort`
10         for p in $file_list; do
11                 # set flag in case of failure and continue
12                 patch -s -d .. -p1 < $p || any_failure=1
13         done
14         ./config --file ../arch/arm64/configs/tegra_t186ref_gnu_linux_defconfig --enable PREEMPT_RT_FULL  --disable CPU_IDLE_TEGRA18X  --disable CPU_FREQ_GOV_INTERACTIVE || any_failure=1
15
16 }
17
18 revert_rt_patches()
19 {
20         file_list=`find ../rt-patches -name \*.patch -type f | sort -r`
21         for p in $file_list; do
22                 # set flag in case of failure and continue
23                 patch -s -R -d .. -p1 < $p || any_failure=1
24         done
25         #  CPU_FREQ_GOV_INTERACTIVE need to keep disable for Automotive
26         ./config --file ../arch/arm64/configs/tegra_t186ref_gnu_linux_defconfig --disable PREEMPT_RT_FULL  --enable CPU_IDLE_TEGRA18X  --disable CPU_FREQ_GOV_INTERACTIVE || any_failure=1
27 }
28
29 usage()
30 {
31         echo Usages:
32         echo 1. ${0} apply-patches : Apply RT patches
33         echo 2. ${0} revert-patches : Revert RT patches
34         any_failure=1
35 }
36
37 # script starts from here
38 dir_run_from=`dirname ${0}`
39 pushd $dir_run_from &>/dev/null
40
41 if [ "$1" == "apply-patches" ]; then
42         apply_rt_patches
43 elif [ "$1" == "revert-patches" ]; then
44         revert_rt_patches
45 else
46         echo "Wrong argument"
47         usage
48 fi
49
50 popd &>/dev/null
51
52 exit $any_failure