blob: c3e7b872575fe25ca683e133132a67846e77a00b [file] [log] [blame]
developerfd40db22021-04-29 10:08:25 +08001#!/bin/bash
2
3MTK_FEEDS_DIR=${1}
4
5OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git packages" | awk -F ";openwrt" '{print $2}'`
6
7if [ -z ${1} ]; then
8 MTK_FEEDS_DIR=feeds/mtk_openwrt_feed
9fi
10
11remove_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
20sdk_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
28sdk_patch
29#cp mtk target to OpenWRT
30cp -fpR ${MTK_FEEDS_DIR}/target ./
31#remove patch if choose to not "keep" patch
32if [ -z ${2} ]; then
33 remove_patches
34fi
35