blob: ab555dc99481d79eafc6a1dddbc40ca8462d6f15 [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 ./
developer5b9709b2022-04-27 09:16:54 +080035cp -fpR ${MTK_FEEDS_DIR}/package${OPENWRT_VER}/* ./package
developer6f1fc752022-02-10 17:24:44 +080036cp -fpR ${MTK_FEEDS_DIR}/tools ./
developerfd40db22021-04-29 10:08:25 +080037#remove patch if choose to not "keep" patch
38if [ -z ${2} ]; then
39 remove_patches
40fi
41