blob: 449e36d241e7490bcf91e5e4a516baee831c7918 [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/
30mv openwrt/target/linux/mediatek/patches-5.4/1002-mtkhnat-add-support-for-virtual-interface-acceleration.patch openwrt/target/linux/mediatek/nf_hnat/
31
developer8d2cff82022-07-12 11:47:22 +080032#cp flowblock patch
33cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/target/ ./openwrt
34#find flow patch to create ext patch for rdkb kernel build
35cd openwrt/target/linux/mediatek/patches-5.4/
36mkdir ../flow_patch
37mv 1004-mtketh-*.patch ../flow_patch
38mv 1007-mtketh-*.patch ../flow_patch
39mv 99*.patch ../flow_patch
40cd -
41#end flowblock
42
developer3348d652022-04-18 19:33:39 +080043echo "sync generic kernel..........."
developer19694572022-04-18 19:58:01 +080044cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/generic/
developer3348d652022-04-18 19:33:39 +080045cd openwrt/target/linux/generic/
46./rdkb_inc_helper backport-5.4
47mv backport-5.4.inc backport-5.4
48./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
developer9566d1c2022-12-19 19:52:56 +080070sed -i 's/738-mt7531-gsw-internal_phy_calibration.patch/&;apply=no/' patches-5.4/patches-5.4.inc
71sed -i 's/739-mt7531-gsw-port5_external_phy_init.patch/&;apply=no/' patches-5.4/patches-5.4.inc
72sed -i 's/753-net-mt753x-phy-coverity-scan.patch/&;apply=no/' patches-5.4/patches-5.4.inc
developer3348d652022-04-18 19:33:39 +080073sed -i 's/9010-iwconfig-wireless-rate-fix.patch/&;apply=no/' patches-5.4/patches-5.4.inc
74echo "do rework medaitek kernel patch done..........."
75#cp 32bit dts
76mkdir -p files-5.4/arch/arm/boot/dts/
77cp -rf files-5.4/arch/arm64/boot/dts/mediatek/mt7986* files-5.4/arch/arm/boot/dts/
78cd -
79rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4
80rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4
81cp -rf openwrt/target/linux/mediatek/patches-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
82cp -rf openwrt/target/linux/mediatek/files-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
developer938e8972022-10-19 19:08:13 +080083#cp platform kernel config
developer3348d652022-04-18 19:33:39 +080084cp 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 +080085cp 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 +080086#flowblock patch
87rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch
88cp -rf openwrt/target/linux/mediatek/flow_patch meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
89#end
developerb4654222023-01-04 17:24:09 +080090#nf_hnat patch
91rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/nf_hnat
92cp -rf openwrt/target/linux/mediatek/nf_hnat meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
93#end
developer1bde8b42022-11-03 11:29:29 +080094
developerf96e2f32022-11-16 13:50:27 +080095#update kernel version
developerb4605f42022-12-05 13:10:59 +080096ver=`grep "LINUX_KERNEL_HASH-5" openwrt/include/kernel-5.4 | cut -c 19-25`
developerf96e2f32022-11-16 13:50:27 +080097sed -i 's/LINUX_VERSION ?=.*/LINUX_VERSION ?= "'${ver}'"/g' meta-filogic/recipes-kernel/linux/linux-mediatek_5.4.bb
98#end
99
developer1bde8b42022-11-03 11:29:29 +0800100echo "Update switch tool ...... "
101cp -rf mtk_openwrt_feeds/feed/switch/src meta-filogic/recipes-devtools/switch/files/
102
developer566f91f2022-11-03 15:58:17 +0800103echo "Update mii_mgr tool ...... "
104cp -rf mtk_openwrt_feeds/feed/mii_mgr/src meta-filogic/recipes-devtools/mii-mgr/files/
105
developer700bcc32022-11-03 17:45:25 +0800106echo "Update regs tool ...... "
107cp -rf mtk_openwrt_feeds/feed/regs/src meta-filogic/recipes-devtools/regs/files/
108
109echo "Update mtk-factory-rw tool ...... "
110cp -rf mtk_openwrt_feeds/feed/mtk_factory_rw/files/ meta-filogic/recipes-devtools/mtk-factory-rw/
111
developerdc642282023-02-02 16:21:17 +0800112echo "Update smp-m76 script"
113cp -f mtk_openwrt_feeds/target/linux/mediatek/base-files/sbin/smp-mt76.sh meta-filogic/recipes-devtools/smp/files/
114
developerf1063ab2023-03-09 11:02:02 +0800115echo "Update ftnl tools"
116cp -rf mtk_openwrt_feeds/feed/flowtable/src meta-filogic/recipes-devtools/flowtable/files/
117
developer3348d652022-04-18 19:33:39 +0800118echo "sync done..........."
developer2892fee2023-01-13 11:45:56 +0800119
120#don't sync this kernl file,so remove it.it is download form logan repo
121rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/include/uapi/
122#save sync mtk_openwrt_feeds log
123cd mtk_openwrt_feeds/ && git log --oneline -n 15 > mtk_openwrt_feeds.log