blob: 39ea54dedad91e4f460b83cfa77dab58acd5d23c [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
developerb4654222023-01-04 17:24:09 +080024#move openwrt nf_hnat patch for new flowblock offload
25mkdir openwrt/target/linux/mediatek/nf_hnat
26
27mv openwrt/target/linux/generic/pending-5.4/64*.patch openwrt/target/linux/mediatek/nf_hnat/
28mv openwrt/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch openwrt/target/linux/mediatek/nf_hnat/
29mv openwrt/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch openwrt/target/linux/mediatek/nf_hnat/
developer46436b02023-06-08 13:31:19 +080030mv openwrt/target/linux/mediatek/patches-5.4/999-2708-mtkhnat-add-support-for-virtual-interface-acceleration.patch openwrt/target/linux/mediatek/nf_hnat/
developer6b93e802023-06-12 11:29:14 +080031mv openwrt/target/linux/mediatek/patches-5.4/999-2726-mtkhnat-tnl-interface-offload-check.patch openwrt/target/linux/mediatek/nf_hnat/
developerb4654222023-01-04 17:24:09 +080032
developer8d2cff82022-07-12 11:47:22 +080033#cp flowblock patch
34cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/target/ ./openwrt
35#find flow patch to create ext patch for rdkb kernel build
36cd openwrt/target/linux/mediatek/patches-5.4/
37mkdir ../flow_patch
developer46436b02023-06-08 13:31:19 +080038mv 999-30*.patch ../flow_patch
developer8d2cff82022-07-12 11:47:22 +080039cd -
40#end flowblock
41
developer3348d652022-04-18 19:33:39 +080042echo "sync generic kernel..........."
developer19694572022-04-18 19:58:01 +080043cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/generic/
developer3348d652022-04-18 19:33:39 +080044cd openwrt/target/linux/generic/
45./rdkb_inc_helper backport-5.4
46mv backport-5.4.inc backport-5.4
developer46436b02023-06-08 13:31:19 +080047sed -i 's/999-2702-v5.9-net-phy-add-support-for-a-common-probe-between-shared-PHYs.patch/&;apply=no/' backport-5.4/backport-5.4.inc
developer3348d652022-04-18 19:33:39 +080048./rdkb_inc_helper pending-5.4
49mv pending-5.4.inc pending-5.4
50./rdkb_inc_helper hack-5.4
51mv hack-5.4.inc hack-5.4
52cd -
53rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/backport-5.4
54rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/pending-5.4
55rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/hack-5.4
56rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/files
57rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/files-5.4
58cp -rf openwrt/target/linux/generic/backport-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
59cp -rf openwrt/target/linux/generic/pending-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
60cp -rf openwrt/target/linux/generic/hack-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
61cp -rf openwrt/target/linux/generic/files meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic
62cp -rf openwrt/target/linux/generic/files-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/
63cp openwrt/target/linux/generic/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/defconfig
64echo "sync medaitek kernel..........."
developer19694572022-04-18 19:58:01 +080065cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/mediatek
developer3348d652022-04-18 19:33:39 +080066cd openwrt/target/linux/mediatek
67./rdkb_inc_helper patches-5.4/
68mv patches-5.4.inc patches-5.4
69sed -i 's/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch/&;apply=no/' patches-5.4/patches-5.4.inc
developer46436b02023-06-08 13:31:19 +080070sed -i 's/999-2713-mt7531-gsw-internal_phy_calibration.patch/&;apply=no/' patches-5.4/patches-5.4.inc
71sed -i 's/999-2714-mt7531-gsw-port5_external_phy_init.patch/&;apply=no/' patches-5.4/patches-5.4.inc
72sed -i 's/999-2721-net-mt753x-phy-coverity-scan.patch/&;apply=no/' patches-5.4/patches-5.4.inc
73sed -i 's/999-1710-net-phy-add-phylink-pcs-support.patch/&;apply=no/' patches-5.4/patches-5.4.inc
74sed -i 's/999-1712-net-phy-add-phylink-rate-matching-support.patch/&;apply=no/' patches-5.4/patches-5.4.inc
75sed -i 's/999-2725-iwconfig-wireless-rate-fix.patch/&;apply=no/' patches-5.4/patches-5.4.inc
developer3348d652022-04-18 19:33:39 +080076echo "do rework medaitek kernel patch done..........."
77#cp 32bit dts
78mkdir -p files-5.4/arch/arm/boot/dts/
79cp -rf files-5.4/arch/arm64/boot/dts/mediatek/mt7986* files-5.4/arch/arm/boot/dts/
80cd -
81rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4
82rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4
83cp -rf openwrt/target/linux/mediatek/patches-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
84cp -rf openwrt/target/linux/mediatek/files-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
developer938e8972022-10-19 19:08:13 +080085#cp platform kernel config
developer3348d652022-04-18 19:33:39 +080086cp openwrt/target/linux/mediatek/mt7986/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/mt7986.cfg
developer938e8972022-10-19 19:08:13 +080087cp openwrt/target/linux/mediatek/mt7988/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/mt7988.cfg
developer8d2cff82022-07-12 11:47:22 +080088#flowblock patch
89rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch
90cp -rf openwrt/target/linux/mediatek/flow_patch meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
91#end
developerb4654222023-01-04 17:24:09 +080092#nf_hnat patch
93rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/nf_hnat
94cp -rf openwrt/target/linux/mediatek/nf_hnat meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
95#end
developer1bde8b42022-11-03 11:29:29 +080096
developerf96e2f32022-11-16 13:50:27 +080097#update kernel version
developerb4605f42022-12-05 13:10:59 +080098ver=`grep "LINUX_KERNEL_HASH-5" openwrt/include/kernel-5.4 | cut -c 19-25`
developerf96e2f32022-11-16 13:50:27 +080099sed -i 's/LINUX_VERSION ?=.*/LINUX_VERSION ?= "'${ver}'"/g' meta-filogic/recipes-kernel/linux/linux-mediatek_5.4.bb
100#end
101
developer1bde8b42022-11-03 11:29:29 +0800102echo "Update switch tool ...... "
103cp -rf mtk_openwrt_feeds/feed/switch/src meta-filogic/recipes-devtools/switch/files/
104
developer566f91f2022-11-03 15:58:17 +0800105echo "Update mii_mgr tool ...... "
106cp -rf mtk_openwrt_feeds/feed/mii_mgr/src meta-filogic/recipes-devtools/mii-mgr/files/
107
developer700bcc32022-11-03 17:45:25 +0800108echo "Update regs tool ...... "
109cp -rf mtk_openwrt_feeds/feed/regs/src meta-filogic/recipes-devtools/regs/files/
110
111echo "Update mtk-factory-rw tool ...... "
112cp -rf mtk_openwrt_feeds/feed/mtk_factory_rw/files/ meta-filogic/recipes-devtools/mtk-factory-rw/
113
developerdc642282023-02-02 16:21:17 +0800114echo "Update smp-m76 script"
115cp -f mtk_openwrt_feeds/target/linux/mediatek/base-files/sbin/smp-mt76.sh meta-filogic/recipes-devtools/smp/files/
116
developerf1063ab2023-03-09 11:02:02 +0800117echo "Update ftnl tools"
118cp -rf mtk_openwrt_feeds/feed/flowtable/src meta-filogic/recipes-devtools/flowtable/files/
119
developer3348d652022-04-18 19:33:39 +0800120echo "sync done..........."
developer2892fee2023-01-13 11:45:56 +0800121
122#don't sync this kernl file,so remove it.it is download form logan repo
123rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/include/uapi/
124#save sync mtk_openwrt_feeds log
125cd mtk_openwrt_feeds/ && git log --oneline -n 15 > mtk_openwrt_feeds.log