developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" |
| 2 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/backport-5.4:" |
| 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/pending-5.4:" |
| 4 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/generic/hack-5.4:" |
| 5 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/patches-5.4:" |
developer | 3262bf8 | 2022-07-12 11:37:54 +0800 | [diff] [blame] | 6 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/flow_patch:" |
developer | da660eb | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 7 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}/mediatek/nf_hnat:" |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 8 | |
developer | 9c03829 | 2022-07-06 15:03:09 +0800 | [diff] [blame] | 9 | KBRANCH ?= "linux-5.4.y" |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 10 | |
developer | 30584bd | 2023-01-30 13:12:50 +0800 | [diff] [blame] | 11 | LINUX_VERSION ?= "5.4.230" |
| 12 | SRCREV_machine ?= "90245959a5b936ee013266e5d1e6a508ed69274e" |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 13 | KMETA = "kernel-meta" |
| 14 | SRCREV_meta ?= "feeb59687bc0f054af837a5061f8d413ec7c93e9" |
| 15 | |
| 16 | DEPENDS_append = " kern-tools-native xz-native bc-native" |
| 17 | |
| 18 | SRC_URI = " \ |
developer | 9c03829 | 2022-07-06 15:03:09 +0800 | [diff] [blame] | 19 | git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git;protocol=https;branch=${KBRANCH};name=machine \ |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 20 | git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=${KMETA} \ |
| 21 | file://generic \ |
| 22 | file://mediatek \ |
| 23 | file://generic/defconfig \ |
| 24 | file://001-rdkb-eth-mtk-change-ifname-for.patch;apply=no \ |
developer | 7557232 | 2022-06-01 19:25:09 +0800 | [diff] [blame] | 25 | file://003-rdkb-mtd-kernel-ubi-relayout.patch;apply=no \ |
developer | 9fd4d19 | 2023-01-30 17:05:27 +0800 | [diff] [blame] | 26 | file://004-rdkb-hnat-bind-ifname.patch;apply=no \ |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 27 | " |
developer | 86fe061 | 2022-10-18 16:32:50 +0800 | [diff] [blame] | 28 | SRC_URI_append_mt7988 += " \ |
| 29 | file://mediatek/mt7988.cfg \ |
| 30 | " |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 31 | SRC_URI_append_mt7986 += " \ |
| 32 | file://mediatek/mt7986.cfg \ |
| 33 | " |
| 34 | SRC_URI_append_mt7986-32bit += " \ |
developer | 53810fa | 2022-04-19 10:14:08 +0800 | [diff] [blame] | 35 | file://mediatek/patches-32bit-5.4/mt7986-32bit.cfg \ |
| 36 | file://mediatek/patches-32bit-5.4/401-pinctrl-add-mt7986-driver-32bit.patch \ |
| 37 | file://mediatek/patches-32bit-5.4/999-add_armv7_support_for_panther.patch \ |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 38 | " |
developer | c436bdc | 2022-04-22 16:48:46 +0800 | [diff] [blame] | 39 | SRC_URI_append += " \ |
| 40 | file://rdkb_cfg/iptables.cfg \ |
| 41 | file://rdkb_cfg/turris_rdkb.cfg \ |
| 42 | file://rdkb_cfg/openvswitch.cfg \ |
developer | da660eb | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 43 | ${@bb.utils.contains('DISTRO_FEATURES', 'mt76', 'file://rdkb_cfg/mac80211.cfg', 'file://rdkb_cfg/nf_hnat.cfg', d)} \ |
developer | c436bdc | 2022-04-22 16:48:46 +0800 | [diff] [blame] | 44 | file://rdkb_cfg/prplmesh.cfg \ |
developer | 50c864c | 2022-05-30 16:13:51 +0800 | [diff] [blame] | 45 | file://rdkb_cfg/filogic_rdkb.cfg \ |
developer | 7df0edd | 2023-01-18 09:21:27 +0800 | [diff] [blame] | 46 | ${@bb.utils.contains('DISTRO_FEATURES','emmc','file://rdkb_cfg/emmc.cfg','',d)} \ |
developer | c436bdc | 2022-04-22 16:48:46 +0800 | [diff] [blame] | 47 | " |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 48 | require ${PN}-${PV}/generic/backport-5.4/backport-5.4.inc |
| 49 | |
| 50 | require ${PN}-${PV}/generic/pending-5.4/pending-5.4.inc |
| 51 | SRC_URI_remove = " \ |
| 52 | file://530-jffs2_make_lzma_available.patch \ |
| 53 | " |
| 54 | require ${PN}-${PV}/generic/hack-5.4/hack-5.4.inc |
| 55 | SRC_URI_remove = " \ |
| 56 | file://531-debloat_lzma.patch \ |
| 57 | " |
| 58 | require ${PN}-${PV}/mediatek/patches-5.4/patches-5.4.inc |
developer | a05a7ec | 2022-12-19 19:45:32 +0800 | [diff] [blame] | 59 | |
developer | 53810fa | 2022-04-19 10:14:08 +0800 | [diff] [blame] | 60 | SRC_URI_remove_mt7986-32bit = " \ |
| 61 | file://401-pinctrl-add-mt7986-driver.patch \ |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 62 | " |
developer | 03e474f | 2023-02-15 13:25:01 +0800 | [diff] [blame] | 63 | SRC_URI_append_secureboot += " \ |
| 64 | file://0404-mtdsplit-dm-verity.patch;apply=no \ |
| 65 | file://0800-dm-verity-redo-hash-for-safexel-sha256.patch;apply=no \ |
| 66 | file://0801-dm-support-get-device-by-part-uuid-and-label.patch;apply=no \ |
| 67 | file://0802-dm-expose-create-parameter-to-sysfs.patch;apply=no \ |
| 68 | " |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 69 | require linux-mediatek.inc |
| 70 | |
| 71 | do_patch_prepend () { |
| 72 | cp -Rfp ${WORKDIR}/generic/files/* ${S}/ |
| 73 | cp -Rfp ${WORKDIR}/generic/files-5.4/* ${S}/ |
| 74 | cp -Rfp ${WORKDIR}/mediatek/files-5.4/* ${S}/ |
| 75 | } |
| 76 | |
| 77 | do_filogic_patches() { |
| 78 | cd ${S} |
developer | ddae150 | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 79 | DISTRO_FlowBlock_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','flow_offload','true','false',d)}" |
developer | da660eb | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 80 | DISTRO_logan_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','logan','true','false',d)}" |
developer | 03e474f | 2023-02-15 13:25:01 +0800 | [diff] [blame] | 81 | DISTRO_secure_boot_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','secure_boot','true','false',d)}" |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 82 | if [ ! -e patch_applied ]; then |
| 83 | patch -p1 < ${WORKDIR}/001-rdkb-eth-mtk-change-ifname-for.patch |
developer | 7557232 | 2022-06-01 19:25:09 +0800 | [diff] [blame] | 84 | patch -p1 < ${WORKDIR}/003-rdkb-mtd-kernel-ubi-relayout.patch |
developer | 53810fa | 2022-04-19 10:14:08 +0800 | [diff] [blame] | 85 | patch -p1 < ${WORKDIR}/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch |
developer | a05a7ec | 2022-12-19 19:45:32 +0800 | [diff] [blame] | 86 | patch -p1 < ${WORKDIR}/738-mt7531-gsw-internal_phy_calibration.patch |
| 87 | patch -p1 < ${WORKDIR}/739-mt7531-gsw-port5_external_phy_init.patch |
| 88 | patch -p1 < ${WORKDIR}/753-net-mt753x-phy-coverity-scan.patch |
developer | 53810fa | 2022-04-19 10:14:08 +0800 | [diff] [blame] | 89 | patch -p1 < ${WORKDIR}/9010-iwconfig-wireless-rate-fix.patch |
developer | 03e474f | 2023-02-15 13:25:01 +0800 | [diff] [blame] | 90 | if [ $DISTRO_secure_boot_ENABLED = 'true' ]; then |
| 91 | patch -p1 < ${WORKDIR}/0404-mtdsplit-dm-verity.patch |
| 92 | patch -p1 < ${WORKDIR}/0800-dm-verity-redo-hash-for-safexel-sha256.patch |
| 93 | patch -p1 < ${WORKDIR}/0801-dm-support-get-device-by-part-uuid-and-label.patch |
| 94 | patch -p1 < ${WORKDIR}/0802-dm-expose-create-parameter-to-sysfs.patch |
| 95 | fi |
developer | ddae150 | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 96 | if [ $DISTRO_FlowBlock_ENABLED = 'true' ]; then |
| 97 | for i in ${WORKDIR}/mediatek/flow_patch/*.patch; do patch -p1 < $i; done |
| 98 | fi |
developer | da660eb | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 99 | if [ $DISTRO_logan_ENABLED = 'true' ]; then |
developer | 4451b97 | 2023-01-04 18:51:23 +0800 | [diff] [blame] | 100 | for i in ${WORKDIR}/mediatek/nf_hnat/6*.patch; do patch -p1 < $i; done |
| 101 | for i in ${WORKDIR}/mediatek/nf_hnat/10*.patch; do patch -p1 < $i; done |
developer | 9fd4d19 | 2023-01-30 17:05:27 +0800 | [diff] [blame] | 102 | patch -p1 < ${WORKDIR}/004-rdkb-hnat-bind-ifname.patch |
developer | da660eb | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 103 | fi |
developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame] | 104 | touch patch_applied |
| 105 | fi |
| 106 | } |
| 107 | |
| 108 | addtask filogic_patches after do_patch before do_compile |
developer | da660eb | 2023-01-04 17:20:43 +0800 | [diff] [blame] | 109 | |
| 110 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('DISTRO_FEATURES','logan','mtkhnat nf_flow_table_hw','',d)}" |