blob: 36c0c8d58d8e10f1310939e37b2283c58701628e [file] [log] [blame]
developer3348d652022-04-18 19:33:39 +08001#!/bin/sh
2echo "clone repos"
3git clone --branch openwrt-21.02 https://gerrit.mediatek.inc/openwrt/lede openwrt
4git clone --branch master https://gerrit.mediatek.inc/openwrt/feeds/mtk_openwrt_feeds
5git clone https://gerrit.mediatek.inc/gateway/rdk-b/meta-filogic
6echo "sync openwrt kernel..........."
7remove_patches(){
8 echo "remove conflict patches"
9 for aa in `cat remove.patch.list`
10 do
11 echo "rm $aa"
12 rm -rf ./$aa
13 done
developere76f0952022-07-06 13:30:46 +080014 #remove old legacy mt7622 patch
15 rm -rf ./target/linux/mediatek/patches-5.4/0303-mtd-spinand-disable-on-die-ECC.patch
developer3348d652022-04-18 19:33:39 +080016}
17cp -fpR mtk_openwrt_feeds/target ./openwrt
18cp mtk_openwrt_feeds/remove.patch.list openwrt/
19cd openwrt/
20remove_patches
21cd -
developer8d2cff82022-07-12 11:47:22 +080022
23#flowblock
24#remove openwrt netfiler patch for new flowblock offload
25rm -rf openwrt/target/linux/generic/pending-5.4/64*.patch
26rm -rf openwrt/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch
27rm -rf openwrt/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch
28rm -rf openwrt/target/linux/mediatek/patches-5.4/1002-mtkhnat-add-support-for-virtual-interface-acceleration.patch
29#cp flowblock patch
30cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/target/ ./openwrt
31#find flow patch to create ext patch for rdkb kernel build
32cd openwrt/target/linux/mediatek/patches-5.4/
33mkdir ../flow_patch
34mv 1004-mtketh-*.patch ../flow_patch
35mv 1007-mtketh-*.patch ../flow_patch
36mv 99*.patch ../flow_patch
37cd -
38#end flowblock
39
developer3348d652022-04-18 19:33:39 +080040echo "sync generic kernel..........."
developer19694572022-04-18 19:58:01 +080041cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/generic/
developer3348d652022-04-18 19:33:39 +080042cd openwrt/target/linux/generic/
43./rdkb_inc_helper backport-5.4
44mv backport-5.4.inc backport-5.4
45./rdkb_inc_helper pending-5.4
46mv pending-5.4.inc pending-5.4
47./rdkb_inc_helper hack-5.4
48mv hack-5.4.inc hack-5.4
49cd -
50rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/backport-5.4
51rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/pending-5.4
52rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/hack-5.4
53rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/files
54rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/files-5.4
55cp -rf openwrt/target/linux/generic/backport-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
56cp -rf openwrt/target/linux/generic/pending-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
57cp -rf openwrt/target/linux/generic/hack-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
58cp -rf openwrt/target/linux/generic/files meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
59cp -rf openwrt/target/linux/generic/files-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/
60cp openwrt/target/linux/generic/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/defconfig
61echo "sync medaitek kernel..........."
developer19694572022-04-18 19:58:01 +080062cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/mediatek
developer3348d652022-04-18 19:33:39 +080063cd openwrt/target/linux/mediatek
64./rdkb_inc_helper patches-5.4/
65mv patches-5.4.inc patches-5.4
66sed -i 's/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch/&;apply=no/' patches-5.4/patches-5.4.inc
67sed -i 's/9010-iwconfig-wireless-rate-fix.patch/&;apply=no/' patches-5.4/patches-5.4.inc
68echo "do rework medaitek kernel patch done..........."
69#cp 32bit dts
70mkdir -p files-5.4/arch/arm/boot/dts/
71cp -rf files-5.4/arch/arm64/boot/dts/mediatek/mt7986* files-5.4/arch/arm/boot/dts/
72cd -
73rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4
74rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4
75cp -rf openwrt/target/linux/mediatek/patches-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
76cp -rf openwrt/target/linux/mediatek/files-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
77cp openwrt/target/linux/mediatek/mt7986/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/mt7986.cfg
developer8d2cff82022-07-12 11:47:22 +080078#flowblock patch
79rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch
80cp -rf openwrt/target/linux/mediatek/flow_patch meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
81#end
developer3348d652022-04-18 19:33:39 +080082echo "sync done..........."