blob: a3b8fadff054f36b06eabb2205f2b0bbc6f8ffdd [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
developer938e8972022-10-19 19:08:13 +080077#cp platform kernel config
developer3348d652022-04-18 19:33:39 +080078cp 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 +080079cp 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 +080080#flowblock patch
81rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch
82cp -rf openwrt/target/linux/mediatek/flow_patch meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek
83#end
developer1bde8b42022-11-03 11:29:29 +080084
developerf96e2f32022-11-16 13:50:27 +080085#update kernel version
developerb4605f42022-12-05 13:10:59 +080086ver=`grep "LINUX_KERNEL_HASH-5" openwrt/include/kernel-5.4 | cut -c 19-25`
developerf96e2f32022-11-16 13:50:27 +080087sed -i 's/LINUX_VERSION ?=.*/LINUX_VERSION ?= "'${ver}'"/g' meta-filogic/recipes-kernel/linux/linux-mediatek_5.4.bb
88#end
89
developer1bde8b42022-11-03 11:29:29 +080090echo "Update switch tool ...... "
91cp -rf mtk_openwrt_feeds/feed/switch/src meta-filogic/recipes-devtools/switch/files/
92
developer566f91f2022-11-03 15:58:17 +080093echo "Update mii_mgr tool ...... "
94cp -rf mtk_openwrt_feeds/feed/mii_mgr/src meta-filogic/recipes-devtools/mii-mgr/files/
95
developer700bcc32022-11-03 17:45:25 +080096echo "Update regs tool ...... "
97cp -rf mtk_openwrt_feeds/feed/regs/src meta-filogic/recipes-devtools/regs/files/
98
99echo "Update mtk-factory-rw tool ...... "
100cp -rf mtk_openwrt_feeds/feed/mtk_factory_rw/files/ meta-filogic/recipes-devtools/mtk-factory-rw/
101
developer3348d652022-04-18 19:33:39 +0800102echo "sync done..........."