blob: 4f9475641bd18edd5e68257e326776c23ae5abaf [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}'`
developerf0dc8bc2022-08-29 17:24:20 +08007
8 if [ -z ${OPENWRT_VER} ]; then
9 OPENWRT_VER=`cat ./feeds.conf.default_ori | grep "src-git-full packages" | awk -F ";openwrt" '{print $2}'`
10 fi
developer21871ba2021-11-05 17:00:05 +080011else
12 OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git packages" | awk -F ";openwrt" '{print $2}'`
developerf0dc8bc2022-08-29 17:24:20 +080013
14 if [ -z ${OPENWRT_VER} ]; then
15 OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git-full packages" | awk -F ";openwrt" '{print $2}'`
16 fi
developer21871ba2021-11-05 17:00:05 +080017fi
developerfd40db22021-04-29 10:08:25 +080018
19if [ -z ${1} ]; then
20 MTK_FEEDS_DIR=feeds/mtk_openwrt_feed
21fi
22
23remove_patches(){
24 echo "remove conflict patches"
25 for aa in `cat ${MTK_FEEDS_DIR}/remove.patch.list`
26 do
27 echo "rm $aa"
28 rm -rf ./$aa
29 done
30}
31
32sdk_patch(){
33 files=`find ${MTK_FEEDS_DIR}/openwrt_patches${OPENWRT_VER} -name "*.patch" | sort`
34 for file in $files
35 do
36 patch -f -p1 -i ${file} || exit 1
37 done
38}
39
40sdk_patch
41#cp mtk target to OpenWRT
42cp -fpR ${MTK_FEEDS_DIR}/target ./
developerf0769042022-04-27 09:16:54 +080043cp -fpR ${MTK_FEEDS_DIR}/package${OPENWRT_VER}/* ./package
developer78a29012022-02-10 17:24:44 +080044cp -fpR ${MTK_FEEDS_DIR}/tools ./
developerfd40db22021-04-29 10:08:25 +080045#remove patch if choose to not "keep" patch
46if [ -z ${2} ]; then
47 remove_patches
48fi
49