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/ |
developer | 46436b0 | 2023-06-08 13:31:19 +0800 | [diff] [blame] | 30 | mv openwrt/target/linux/mediatek/patches-5.4/999-2708-mtkhnat-add-support-for-virtual-interface-acceleration.patch openwrt/target/linux/mediatek/nf_hnat/ |
developer | 6b93e80 | 2023-06-12 11:29:14 +0800 | [diff] [blame] | 31 | mv openwrt/target/linux/mediatek/patches-5.4/999-2726-mtkhnat-tnl-interface-offload-check.patch openwrt/target/linux/mediatek/nf_hnat/ |
developer | b465422 | 2023-01-04 17:24:09 +0800 | [diff] [blame] | 32 | |
developer | 8d2cff8 | 2022-07-12 11:47:22 +0800 | [diff] [blame] | 33 | #cp flowblock patch |
| 34 | cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/target/ ./openwrt |
| 35 | #find flow patch to create ext patch for rdkb kernel build |
| 36 | cd openwrt/target/linux/mediatek/patches-5.4/ |
| 37 | mkdir ../flow_patch |
developer | 46436b0 | 2023-06-08 13:31:19 +0800 | [diff] [blame] | 38 | mv 999-30*.patch ../flow_patch |
developer | 8d2cff8 | 2022-07-12 11:47:22 +0800 | [diff] [blame] | 39 | cd - |
| 40 | #end flowblock |
| 41 | |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 42 | echo "sync generic kernel..........." |
developer | 1969457 | 2022-04-18 19:58:01 +0800 | [diff] [blame] | 43 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper openwrt/target/linux/generic/ |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 44 | cd openwrt/target/linux/generic/ |
| 45 | ./rdkb_inc_helper backport-5.4 |
| 46 | mv backport-5.4.inc backport-5.4 |
developer | 46436b0 | 2023-06-08 13:31:19 +0800 | [diff] [blame] | 47 | sed -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 |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 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 | 46436b0 | 2023-06-08 13:31:19 +0800 | [diff] [blame] | 70 | sed -i 's/999-2713-mt7531-gsw-internal_phy_calibration.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 71 | sed -i 's/999-2714-mt7531-gsw-port5_external_phy_init.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 72 | sed -i 's/999-2721-net-mt753x-phy-coverity-scan.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 73 | sed -i 's/999-1710-net-phy-add-phylink-pcs-support.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 74 | sed -i 's/999-1712-net-phy-add-phylink-rate-matching-support.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
| 75 | sed -i 's/999-2725-iwconfig-wireless-rate-fix.patch/&;apply=no/' patches-5.4/patches-5.4.inc |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 76 | echo "do rework medaitek kernel patch done..........." |
| 77 | #cp 32bit dts |
| 78 | mkdir -p files-5.4/arch/arm/boot/dts/ |
| 79 | cp -rf files-5.4/arch/arm64/boot/dts/mediatek/mt7986* files-5.4/arch/arm/boot/dts/ |
| 80 | cd - |
| 81 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4 |
| 82 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4 |
| 83 | cp -rf openwrt/target/linux/mediatek/patches-5.4 meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek |
| 84 | 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] | 85 | #cp platform kernel config |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 86 | 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] | 87 | 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] | 88 | #flowblock patch |
| 89 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch |
| 90 | cp -rf openwrt/target/linux/mediatek/flow_patch meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek |
| 91 | #end |
developer | b465422 | 2023-01-04 17:24:09 +0800 | [diff] [blame] | 92 | #nf_hnat patch |
| 93 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/nf_hnat |
| 94 | cp -rf openwrt/target/linux/mediatek/nf_hnat meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek |
| 95 | #end |
developer | 1bde8b4 | 2022-11-03 11:29:29 +0800 | [diff] [blame] | 96 | |
developer | f96e2f3 | 2022-11-16 13:50:27 +0800 | [diff] [blame] | 97 | #update kernel version |
developer | b4605f4 | 2022-12-05 13:10:59 +0800 | [diff] [blame] | 98 | 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] | 99 | sed -i 's/LINUX_VERSION ?=.*/LINUX_VERSION ?= "'${ver}'"/g' meta-filogic/recipes-kernel/linux/linux-mediatek_5.4.bb |
| 100 | #end |
| 101 | |
developer | 1bde8b4 | 2022-11-03 11:29:29 +0800 | [diff] [blame] | 102 | echo "Update switch tool ...... " |
| 103 | cp -rf mtk_openwrt_feeds/feed/switch/src meta-filogic/recipes-devtools/switch/files/ |
| 104 | |
developer | 566f91f | 2022-11-03 15:58:17 +0800 | [diff] [blame] | 105 | echo "Update mii_mgr tool ...... " |
| 106 | cp -rf mtk_openwrt_feeds/feed/mii_mgr/src meta-filogic/recipes-devtools/mii-mgr/files/ |
| 107 | |
developer | 700bcc3 | 2022-11-03 17:45:25 +0800 | [diff] [blame] | 108 | echo "Update regs tool ...... " |
| 109 | cp -rf mtk_openwrt_feeds/feed/regs/src meta-filogic/recipes-devtools/regs/files/ |
| 110 | |
| 111 | echo "Update mtk-factory-rw tool ...... " |
| 112 | cp -rf mtk_openwrt_feeds/feed/mtk_factory_rw/files/ meta-filogic/recipes-devtools/mtk-factory-rw/ |
| 113 | |
developer | dc64228 | 2023-02-02 16:21:17 +0800 | [diff] [blame] | 114 | echo "Update smp-m76 script" |
| 115 | cp -f mtk_openwrt_feeds/target/linux/mediatek/base-files/sbin/smp-mt76.sh meta-filogic/recipes-devtools/smp/files/ |
| 116 | |
developer | f1063ab | 2023-03-09 11:02:02 +0800 | [diff] [blame] | 117 | echo "Update ftnl tools" |
| 118 | cp -rf mtk_openwrt_feeds/feed/flowtable/src meta-filogic/recipes-devtools/flowtable/files/ |
| 119 | |
developer | 3348d65 | 2022-04-18 19:33:39 +0800 | [diff] [blame] | 120 | echo "sync done..........." |
developer | 2892fee | 2023-01-13 11:45:56 +0800 | [diff] [blame] | 121 | |
| 122 | #don't sync this kernl file,so remove it.it is download form logan repo |
| 123 | rm -rf meta-filogic/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/include/uapi/ |
| 124 | #save sync mtk_openwrt_feeds log |
| 125 | cd mtk_openwrt_feeds/ && git log --oneline -n 15 > mtk_openwrt_feeds.log |