[][openwrt][common][bsp][Reorganize files]
[Description]
Change the organization of file and patches to follow the rules of the
next gen autobuild framework.
[Release-log]
N/A
Change-Id: I61a85c4e2fdb0bac45ad53f138298e51768910af
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8513568
diff --git a/prepare_sdk.sh b/prepare_sdk.sh
index 4f94756..208f570 100755
--- a/prepare_sdk.sh
+++ b/prepare_sdk.sh
@@ -3,16 +3,16 @@
MTK_FEEDS_DIR=${1}
if [ -f feeds.conf.default_ori ]; then
- OPENWRT_VER=`cat ./feeds.conf.default_ori | grep "src-git packages" | awk -F ";openwrt" '{print $2}'`
+ OPENWRT_VER=`cat ./feeds.conf.default_ori | grep "src-git packages" | awk -F ";openwrt-" '{print $2}'`
if [ -z ${OPENWRT_VER} ]; then
- OPENWRT_VER=`cat ./feeds.conf.default_ori | grep "src-git-full packages" | awk -F ";openwrt" '{print $2}'`
+ OPENWRT_VER=`cat ./feeds.conf.default_ori | grep "src-git-full packages" | awk -F ";openwrt-" '{print $2}'`
fi
else
- OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git packages" | awk -F ";openwrt" '{print $2}'`
+ OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git packages" | awk -F ";openwrt-" '{print $2}'`
if [ -z ${OPENWRT_VER} ]; then
- OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git-full packages" | awk -F ";openwrt" '{print $2}'`
+ OPENWRT_VER=`cat ./feeds.conf.default | grep "src-git-full packages" | awk -F ";openwrt-" '{print $2}'`
fi
fi
@@ -22,26 +22,33 @@
remove_patches(){
echo "remove conflict patches"
- for aa in `cat ${MTK_FEEDS_DIR}/remove.patch.list`
+ for aa in `cat ${MTK_FEEDS_DIR}/${OPENWRT_VER}/remove_list-mtwifi.txt`
do
echo "rm $aa"
rm -rf ./$aa
done
}
-sdk_patch(){
- files=`find ${MTK_FEEDS_DIR}/openwrt_patches${OPENWRT_VER} -name "*.patch" | sort`
- for file in $files
- do
+# $1: Directory containing patches
+apply_patches() {
+ local patches=`find ${1} -name "*.patch" | sort`
+
+ for file in $patches; do
+ echo -e "\nApplying ${file}"
patch -f -p1 -i ${file} || exit 1
done
}
+sdk_patch(){
+ apply_patches "${MTK_FEEDS_DIR}/${OPENWRT_VER}/patches-base"
+ apply_patches "${MTK_FEEDS_DIR}/${OPENWRT_VER}/patches-feeds"
+}
+
sdk_patch
#cp mtk target to OpenWRT
-cp -fpR ${MTK_FEEDS_DIR}/target ./
-cp -fpR ${MTK_FEEDS_DIR}/package${OPENWRT_VER}/* ./package
+cp -fpR ${MTK_FEEDS_DIR}/${OPENWRT_VER}/files/* ./
cp -fpR ${MTK_FEEDS_DIR}/tools ./
+
#remove patch if choose to not "keep" patch
if [ -z ${2} ]; then
remove_patches