developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | echo "clone repos" |
| 3 | git clone --branch openwrt-21.02 https://gerrit.mediatek.inc/openwrt/lede openwrt |
| 4 | git clone --branch master https://gerrit.mediatek.inc/openwrt/feeds/mtk_openwrt_feeds |
| 5 | git clone https://gerrit.mediatek.inc/gateway/rdk-b/meta-filogic |
| 6 | echo "sync openwrt kernel..........." |
| 7 | remove_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 |
developer | e76f095 | 2022-07-06 13:30:46 +0800 | [diff] [blame] | 14 | #remove old legacy mt7622 patch |
| 15 | rm -rf ./target/linux/mediatek/patches-5.4/0303-mtd-spinand-disable-on-die-ECC.patch |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 16 | } |
| 17 | cp -fpR mtk_openwrt_feeds/target ./openwrt |
| 18 | cp mtk_openwrt_feeds/remove.patch.list openwrt/ |
| 19 | cd openwrt/ |
| 20 | remove_patches |
| 21 | cd - |
developer | 8d2cff8 | 2022-07-12 11:47:22 +0800 | [diff] [blame] | 22 | |
| 23 | #flowblock |
developer | b465422 | 2023-01-04 17:24:09 +0800 | [diff] [blame] | 24 | #move openwrt nf_hnat patch for new flowblock offload |
| 25 | mkdir openwrt/target/linux/mediatek/nf_hnat |
| 26 | |
| 27 | mv openwrt/target/linux/generic/pending-5.4/64*.patch openwrt/target/linux/mediatek/nf_hnat/ |
| 28 | mv openwrt/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch openwrt/target/linux/mediatek/nf_hnat/ |
| 29 | mv openwrt/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch openwrt/target/linux/mediatek/nf_hnat/ |
| 30 | mv openwrt/target/linux/mediatek/patches-5.4/1002-mtkhnat-add-support-for-virtual-interface-acceleration.patch openwrt/target/linux/mediatek/nf_hnat/ |
| 31 | |
developer | 8d2cff8 | 2022-07-12 11:47:22 +0800 | [diff] [blame] | 32 | #cp flowblock patch |
| 33 | cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/target/ ./openwrt |
| 34 | #find flow patch to create ext patch for rdkb kernel build |
| 35 | cd openwrt/target/linux/mediatek/patches-5.4/ |
| 36 | mkdir ../flow_patch |
| 37 | mv 1004-mtketh-*.patch ../flow_patch |
| 38 | mv 1007-mtketh-*.patch ../flow_patch |
| 39 | mv 99*.patch ../flow_patch |
| 40 | cd - |
| 41 | #end flowblock |
| 42 | |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 43 | echo "sync generic kernel..........." |
developer | 1969457 | 2022-04-18 19:58:01 +0800 | [diff] [blame] | 44 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/generic/ |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 45 | cd openwrt/target/linux/generic/ |
| 46 | ./rdkb_inc_helper backport-5.4 |
| 47 | mv backport-5.4.inc backport-5.4 |
| 48 | ./rdkb_inc_helper pending-5.4 |
| 49 | mv pending-5.4.inc pending-5.4 |
| 50 | ./rdkb_inc_helper hack-5.4 |
| 51 | mv hack-5.4.inc hack-5.4 |
| 52 | cd - |
| 53 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/backport-5.4 |
| 54 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/pending-5.4 |
| 55 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/hack-5.4 |
| 56 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/files |
| 57 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/files-5.4 |
| 58 | cp -rf openwrt/target/linux/generic/backport-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic |
| 59 | cp -rf openwrt/target/linux/generic/pending-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic |
| 60 | cp -rf openwrt/target/linux/generic/hack-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic |
| 61 | cp -rf openwrt/target/linux/generic/files meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic |
| 62 | cp -rf openwrt/target/linux/generic/files-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/ |
| 63 | cp openwrt/target/linux/generic/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/generic/defconfig |
| 64 | echo "sync medaitek kernel..........." |
developer | 1969457 | 2022-04-18 19:58:01 +0800 | [diff] [blame] | 65 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/mediatek |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 66 | cd openwrt/target/linux/mediatek |
| 67 | ./rdkb_inc_helper patches-5.4/ |
| 68 | mv patches-5.4.inc patches-5.4 |
| 69 | sed -i 's/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
developer | 9566d1c | 2022-12-19 19:52:56 +0800 | [diff] [blame] | 70 | sed -i 's/738-mt7531-gsw-internal_phy_calibration.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 71 | sed -i 's/739-mt7531-gsw-port5_external_phy_init.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 72 | sed -i 's/753-net-mt753x-phy-coverity-scan.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 73 | sed -i 's/9010-iwconfig-wireless-rate-fix.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 74 | echo "do rework medaitek kernel patch done..........." |
| 75 | #cp 32bit dts |
| 76 | mkdir -p files-5.4/arch/arm/boot/dts/ |
| 77 | cp -rf files-5.4/arch/arm64/boot/dts/mediatek/mt7986* files-5.4/arch/arm/boot/dts/ |
| 78 | cd - |
| 79 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4 |
| 80 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4 |
| 81 | cp -rf openwrt/target/linux/mediatek/patches-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek |
| 82 | cp -rf openwrt/target/linux/mediatek/files-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek |
developer | 938e897 | 2022-10-19 19:08:13 +0800 | [diff] [blame] | 83 | #cp platform kernel config |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 84 | cp openwrt/target/linux/mediatek/mt7986/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/mt7986.cfg |
developer | 938e897 | 2022-10-19 19:08:13 +0800 | [diff] [blame] | 85 | cp openwrt/target/linux/mediatek/mt7988/config-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/mt7988.cfg |
developer | 8d2cff8 | 2022-07-12 11:47:22 +0800 | [diff] [blame] | 86 | #flowblock patch |
| 87 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch |
| 88 | cp -rf openwrt/target/linux/mediatek/flow_patch meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek |
| 89 | #end |
developer | b465422 | 2023-01-04 17:24:09 +0800 | [diff] [blame] | 90 | #nf_hnat patch |
| 91 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/nf_hnat |
| 92 | cp -rf openwrt/target/linux/mediatek/nf_hnat meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek |
| 93 | #end |
developer | 1bde8b4 | 2022-11-03 11:29:29 +0800 | [diff] [blame] | 94 | |
developer | f96e2f3 | 2022-11-16 13:50:27 +0800 | [diff] [blame] | 95 | #update kernel version |
developer | b4605f4 | 2022-12-05 13:10:59 +0800 | [diff] [blame] | 96 | ver=`grep "LINUX_KERNEL_HASH-5" openwrt/include/kernel-5.4 | cut -c 19-25` |
developer | f96e2f3 | 2022-11-16 13:50:27 +0800 | [diff] [blame] | 97 | sed -i 's/LINUX_VERSION ?=.*/LINUX_VERSION ?= "'${ver}'"/g' meta-filogic/recipes-kernel/linux/linux-mediatek_5.4.bb |
| 98 | #end |
| 99 | |
developer | 1bde8b4 | 2022-11-03 11:29:29 +0800 | [diff] [blame] | 100 | echo "Update switch tool ...... " |
| 101 | cp -rf mtk_openwrt_feeds/feed/switch/src meta-filogic/recipes-devtools/switch/files/ |
| 102 | |
developer | 566f91f | 2022-11-03 15:58:17 +0800 | [diff] [blame] | 103 | echo "Update mii_mgr tool ...... " |
| 104 | cp -rf mtk_openwrt_feeds/feed/mii_mgr/src meta-filogic/recipes-devtools/mii-mgr/files/ |
| 105 | |
developer | 700bcc3 | 2022-11-03 17:45:25 +0800 | [diff] [blame] | 106 | echo "Update regs tool ...... " |
| 107 | cp -rf mtk_openwrt_feeds/feed/regs/src meta-filogic/recipes-devtools/regs/files/ |
| 108 | |
| 109 | echo "Update mtk-factory-rw tool ...... " |
| 110 | cp -rf mtk_openwrt_feeds/feed/mtk_factory_rw/files/ meta-filogic/recipes-devtools/mtk-factory-rw/ |
| 111 | |
developer | dc64228 | 2023-02-02 16:21:17 +0800 | [diff] [blame] | 112 | echo "Update smp-m76 script" |
| 113 | cp -f mtk_openwrt_feeds/target/linux/mediatek/base-files/sbin/smp-mt76.sh meta-filogic/recipes-devtools/smp/files/ |
| 114 | |
developer | f1063ab | 2023-03-09 11:02:02 +0800 | [diff] [blame] | 115 | echo "Update ftnl tools" |
| 116 | cp -rf mtk_openwrt_feeds/feed/flowtable/src meta-filogic/recipes-devtools/flowtable/files/ |
| 117 | |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 118 | echo "sync done..........." |
developer | 2892fee | 2023-01-13 11:45:56 +0800 | [diff] [blame] | 119 | |
| 120 | #don't sync this kernl file,so remove it.it is download form logan repo |
| 121 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/include/uapi/ |
| 122 | #save sync mtk_openwrt_feeds log |
| 123 | cd mtk_openwrt_feeds/ && git log --oneline -n 15 > mtk_openwrt_feeds.log |