developer | fd40db2 | 2021-04-29 10:08:25 +0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | MTK_FEEDS_DIR=${1} |
| 4 | |
| 5 | OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git packages" | awk -F ";openwrt" '{print $2}'` |
| 6 | |
| 7 | if [ -z ${1} ]; then |
| 8 | MTK_FEEDS_DIR=feeds/mtk_openwrt_feed |
| 9 | fi |
| 10 | |
| 11 | remove_patches(){ |
| 12 | echo "remove conflict patches" |
| 13 | for aa in `cat ${MTK_FEEDS_DIR}/remove.patch.list` |
| 14 | do |
| 15 | echo "rm $aa" |
| 16 | rm -rf ./$aa |
| 17 | done |
| 18 | } |
| 19 | |
| 20 | sdk_patch(){ |
| 21 | files=`find ${MTK_FEEDS_DIR}/openwrt_patches${OPENWRT_VER} -name "*.patch" | sort` |
| 22 | for file in $files |
| 23 | do |
| 24 | patch -f -p1 -i ${file} || exit 1 |
| 25 | done |
| 26 | } |
| 27 | |
| 28 | sdk_patch |
| 29 | #cp mtk target to OpenWRT |
| 30 | cp -fpR ${MTK_FEEDS_DIR}/target ./ |
| 31 | #remove patch if choose to not "keep" patch |
| 32 | if [ -z ${2} ]; then |
| 33 | remove_patches |
| 34 | fi |
| 35 | |