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