2017-12-22 10:08:56 +00:00
#!/bin/sh
2020-10-27 17:32:21 +00:00
#
# Copyright (C) 2017 OVH OverTheBox
# Copyright (C) 2017-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
2017-12-22 10:08:56 +00:00
set -e
umask 0022
unset GREP_OPTIONS SED
2018-07-18 20:36:20 +00:00
_get_repo( ) (
mkdir -p " $1 "
cd " $1 "
[ -d .git ] || git init
if git remote get-url origin >/dev/null 2>/dev/null; then
git remote set-url origin " $2 "
else
git remote add origin " $2 "
fi
2019-08-22 07:03:52 +00:00
git fetch origin -f
git fetch origin --tags -f
2018-07-30 09:19:28 +00:00
git checkout -f " origin/ $3 " -B "build" 2>/dev/null || git checkout " $3 " -B "build"
2018-07-18 20:36:20 +00:00
)
2017-12-22 10:08:56 +00:00
2018-02-02 10:23:20 +00:00
OMR_DIST = ${ OMR_DIST :- openmptcprouter }
2018-01-23 14:56:13 +00:00
OMR_HOST = ${ OMR_HOST :- $( curl -sS ifconfig.co) }
2020-09-24 08:07:49 +00:00
OMR_PORT = ${ OMR_PORT :- 80 }
2018-01-26 21:53:41 +00:00
OMR_KEEPBIN = ${ OMR_KEEPBIN :- no }
2018-02-23 08:46:51 +00:00
OMR_IMG = ${ OMR_IMG :- yes }
2020-04-01 12:47:18 +00:00
#OMR_UEFI=${OMR_UEFI:-yes}
2020-06-09 20:40:38 +00:00
OMR_PACKAGES = ${ OMR_PACKAGES :- full }
2018-04-05 15:16:42 +00:00
OMR_ALL_PACKAGES = ${ OMR_ALL_PACKAGES :- no }
2017-12-22 10:08:56 +00:00
OMR_TARGET = ${ OMR_TARGET :- x86_64 }
OMR_TARGET_CONFIG = " config- $OMR_TARGET "
2021-09-28 13:11:38 +00:00
UPSTREAM = ${ UPSTREAM :- no }
2021-09-29 08:56:05 +00:00
OMR_KERNEL = ${ OMR_KERNEL :- 5 .4 }
2021-04-15 18:24:52 +00:00
SHORTCUT_FE = ${ SHORTCUT_FE :- no }
2020-06-26 19:23:24 +00:00
#OMR_RELEASE=${OMR_RELEASE:-$(git describe --tags `git rev-list --tags --max-count=1` | sed 's/^\([0-9.]*\).*/\1/')}
2020-09-18 14:33:44 +00:00
#OMR_RELEASE=${OMR_RELEASE:-$(git tag --sort=committerdate | tail -1)}
2020-10-31 08:35:50 +00:00
OMR_RELEASE = ${ OMR_RELEASE :- $( git describe --tags ` git rev-list --tags --max-count= 1` | tail -1 | cut -d '-' -f1) }
2020-07-15 13:02:35 +00:00
OMR_REPO = ${ OMR_REPO :- http : // $OMR_HOST : $OMR_PORT /release/ $OMR_RELEASE / $OMR_TARGET }
2017-12-22 10:08:56 +00:00
OMR_FEED_URL = " ${ OMR_FEED_URL :- https : //github.com/ysurac/openmptcprouter-feeds } "
2019-12-18 18:22:08 +00:00
OMR_FEED_SRC = " ${ OMR_FEED_SRC :- develop } "
2017-12-22 10:08:56 +00:00
2020-08-03 14:53:41 +00:00
CUSTOM_FEED_URL = " ${ CUSTOM_FEED_URL } "
2020-04-09 12:57:08 +00:00
OMR_OPENWRT = ${ OMR_OPENWRT :- default }
2021-03-05 15:28:10 +00:00
OMR_FORCE_DSA = ${ OMR_FORCE_DSA :- 0 }
2017-12-22 10:08:56 +00:00
if [ ! -f " $OMR_TARGET_CONFIG " ] ; then
echo " Target $OMR_TARGET not found ! "
2018-05-11 13:14:40 +00:00
#exit 1
2017-12-22 10:08:56 +00:00
fi
2018-04-17 07:35:12 +00:00
if [ " $OMR_TARGET " = "rpi3" ] ; then
2018-04-17 07:49:09 +00:00
OMR_REAL_TARGET = "aarch64_cortex-a53"
2019-06-25 16:01:36 +00:00
elif [ " $OMR_TARGET " = "rpi4" ] ; then
OMR_REAL_TARGET = "aarch64_cortex-a72"
2018-05-18 13:38:15 +00:00
elif [ " $OMR_TARGET " = "rpi2" ] ; then
OMR_REAL_TARGET = "arm_cortex-a7_neon-vfpv4"
2018-12-23 13:10:39 +00:00
elif [ " $OMR_TARGET " = "wrt3200acm" ] ; then
2021-03-23 14:55:55 +00:00
OMR_REAL_TARGET = "arm_cortex-a9_vfpv3-d16"
2018-12-23 13:10:39 +00:00
elif [ " $OMR_TARGET " = "wrt32x" ] ; then
2021-03-23 14:55:55 +00:00
OMR_REAL_TARGET = "arm_cortex-a9_vfpv3-d16"
2021-03-03 12:12:28 +00:00
elif [ " $OMR_TARGET " = "bpi-r1" ] ; then
2021-03-03 20:43:20 +00:00
OMR_REAL_TARGET = "arm_cortex-a7_neon-vfpv4"
2018-08-28 10:14:12 +00:00
elif [ " $OMR_TARGET " = "bpi-r2" ] ; then
OMR_REAL_TARGET = "arm_cortex-a7_neon-vfpv4"
2020-07-10 20:20:19 +00:00
elif [ " $OMR_TARGET " = "bpi-r64" ] ; then
OMR_REAL_TARGET = "aarch64_cortex-a53"
2020-07-20 13:14:13 +00:00
elif [ " $OMR_TARGET " = "espressobin" ] ; then
OMR_REAL_TARGET = "aarch64_cortex-a53"
2019-10-23 15:06:10 +00:00
elif [ " $OMR_TARGET " = "x86" ] ; then
OMR_REAL_TARGET = "i386_pentium4"
2021-05-19 17:27:59 +00:00
elif [ " $OMR_TARGET " = "r2s" ] ; then
OMR_REAL_TARGET = "aarch64_generic"
elif [ " $OMR_TARGET " = "r4s" ] ; then
OMR_REAL_TARGET = "aarch64_generic"
elif [ " $OMR_TARGET " = "ubnt-erx" ] ; then
OMR_REAL_TARGET = "mipsel_24kc"
2018-04-17 06:32:01 +00:00
else
2018-04-17 07:49:09 +00:00
OMR_REAL_TARGET = ${ OMR_TARGET }
2018-04-17 06:32:01 +00:00
fi
2018-01-23 14:56:13 +00:00
#_get_repo source https://github.com/ysurac/openmptcprouter-source "master"
2020-04-09 12:57:08 +00:00
if [ " $OMR_OPENWRT " = "default" ] ; then
2021-10-06 14:33:35 +00:00
if [ " $OMR_KERNEL " = "5.4" ] ; then
# Use OpenWrt 21.02 for 5.4 kernel
2021-11-01 09:29:20 +00:00
_get_repo " $OMR_TARGET /source " https://github.com/openwrt/openwrt "f441be3921c769b732f0148f005d4f1bbace0508"
2022-01-03 19:26:01 +00:00
_get_repo feeds/packages https://github.com/openwrt/packages "ab94e0709a9c796d34d723ddba44380f7b3d8698"
_get_repo feeds/luci https://github.com/openwrt/luci "0818d835cacd9fa75b8685aabe6378ac09b95145"
2021-10-06 14:33:35 +00:00
else
2022-01-03 19:26:01 +00:00
_get_repo " $OMR_TARGET /source " https://github.com/openwrt/openwrt "02de391b086dd2b7a72c2394cfb66cec666a51c1"
_get_repo feeds/packages https://github.com/openwrt/packages "7b2dd3e9efbc20ef4e7f47f60c3db9aaef37c0a5"
_get_repo feeds/luci https://github.com/openwrt/luci "73e21c3b5791ac97aa7b437c8e683cdbea407395"
2021-10-06 14:33:35 +00:00
fi
2020-04-09 12:57:08 +00:00
elif [ " $OMR_OPENWRT " = "master" ] ; then
_get_repo " $OMR_TARGET /source " https://github.com/openwrt/openwrt "master"
_get_repo feeds/packages https://github.com/openwrt/packages "master"
_get_repo feeds/luci https://github.com/openwrt/luci "master"
else
_get_repo " $OMR_TARGET /source " https://github.com/openwrt/openwrt " ${ OMR_OPENWRT } "
_get_repo feeds/packages https://github.com/openwrt/packages " ${ OMR_OPENWRT } "
_get_repo feeds/luci https://github.com/openwrt/luci " ${ OMR_OPENWRT } "
fi
2017-12-22 10:08:56 +00:00
if [ -z " $OMR_FEED " ] ; then
2017-12-22 10:16:59 +00:00
OMR_FEED = feeds/openmptcprouter
2017-12-22 10:08:56 +00:00
_get_repo " $OMR_FEED " " $OMR_FEED_URL " " $OMR_FEED_SRC "
fi
2020-09-22 13:07:54 +00:00
if [ -n " $CUSTOM_FEED_URL " ] && [ -z " $CUSTOM_FEED " ] ; then
2020-08-03 14:53:41 +00:00
CUSTOM_FEED = feeds/${ OMR_DIST }
_get_repo " $CUSTOM_FEED " " $CUSTOM_FEED_URL " "master"
fi
2017-12-22 10:08:56 +00:00
if [ -n " $1 " ] && [ -f " $OMR_FEED / $1 /Makefile " ] ; then
OMR_DIST = $1
shift 1
fi
2018-01-26 21:58:20 +00:00
if [ " $OMR_KEEPBIN " = "no" ] ; then
2018-02-21 14:09:20 +00:00
rm -rf " $OMR_TARGET /source/bin "
2018-01-26 21:58:20 +00:00
fi
2018-12-23 19:39:53 +00:00
rm -rf " $OMR_TARGET /source/files " " $OMR_TARGET /source/tmp "
2018-12-23 13:10:39 +00:00
#rm -rf "$OMR_TARGET/source/target/linux/mediatek/patches-4.14"
2018-02-21 14:09:20 +00:00
cp -rf root/* " $OMR_TARGET /source "
2017-12-22 10:08:56 +00:00
2018-02-21 16:06:07 +00:00
cat >> " $OMR_TARGET /source/package/base-files/files/etc/banner " <<EOF
2017-12-22 10:08:56 +00:00
-----------------------------------------------------
PACKAGE: $OMR_DIST
2020-12-30 17:16:40 +00:00
VERSION: $( git -C " $OMR_FEED " tag --sort= committerdate | tail -1)
2021-05-21 17:54:58 +00:00
TARGET: $OMR_TARGET
ARCH: $OMR_REAL_TARGET
2017-12-22 10:08:56 +00:00
BUILD REPO: $( git config --get remote.origin.url)
BUILD DATE: $( date -u)
-----------------------------------------------------
EOF
2018-02-21 16:06:07 +00:00
cat > " $OMR_TARGET /source/feeds.conf " <<EOF
2017-12-22 10:08:56 +00:00
src-link packages $( readlink -f feeds/packages)
src-link luci $( readlink -f feeds/luci)
src-link openmptcprouter $( readlink -f " $OMR_FEED " )
EOF
2020-08-03 14:53:41 +00:00
if [ -n " $CUSTOM_FEED " ] ; then
echo " src-link ${ OMR_DIST } $( readlink -f ${ CUSTOM_FEED } ) " >> " $OMR_TARGET /source/feeds.conf "
fi
2020-06-10 18:25:34 +00:00
if [ " $OMR_DIST " = "openmptcprouter" ] ; then
cat > " $OMR_TARGET /source/package/system/opkg/files/customfeeds.conf " <<-EOF
src/gz openwrt_luci http://packages.openmptcprouter.com/${ OMR_RELEASE } /${ OMR_REAL_TARGET } /luci
src/gz openwrt_packages http://packages.openmptcprouter.com/${ OMR_RELEASE } /${ OMR_REAL_TARGET } /packages
src/gz openwrt_base http://packages.openmptcprouter.com/${ OMR_RELEASE } /${ OMR_REAL_TARGET } /base
src/gz openwrt_routing http://packages.openmptcprouter.com/${ OMR_RELEASE } /${ OMR_REAL_TARGET } /routing
src/gz openwrt_telephony http://packages.openmptcprouter.com/${ OMR_RELEASE } /${ OMR_REAL_TARGET } /telephony
EOF
2020-09-24 08:07:49 +00:00
elif [ -n " $OMR_PACKAGES_URL " ] ; then
cat > " $OMR_TARGET /source/package/system/opkg/files/customfeeds.conf " <<-EOF
src/gz openwrt_luci ${ OMR_PACKAGES_URL } /${ OMR_RELEASE } /${ OMR_REAL_TARGET } /luci
src/gz openwrt_packages ${ OMR_PACKAGES_URL } /${ OMR_RELEASE } /${ OMR_REAL_TARGET } /packages
src/gz openwrt_base ${ OMR_PACKAGES_URL } /${ OMR_RELEASE } /${ OMR_REAL_TARGET } /base
src/gz openwrt_routing ${ OMR_PACKAGES_URL } /${ OMR_RELEASE } /${ OMR_REAL_TARGET } /routing
src/gz openwrt_telephony ${ OMR_PACKAGES_URL } /${ OMR_RELEASE } /${ OMR_REAL_TARGET } /telephony
EOF
2020-06-10 18:25:34 +00:00
else
cat > " $OMR_TARGET /source/package/system/opkg/files/customfeeds.conf " <<-EOF
src/gz openwrt_luci http://downloads.openwrt.org/snapshots/packages/${ OMR_REAL_TARGET } /luci
src/gz openwrt_packages http://downloads.openwrt.org/snapshots/packages/${ OMR_REAL_TARGET } /packages
src/gz openwrt_base http://downloads.openwrt.org/snapshots/packages/${ OMR_REAL_TARGET } /base
src/gz openwrt_routing http://downloads.openwrt.org/snapshots/packages/${ OMR_REAL_TARGET } /routing
src/gz openwrt_telephony http://downloads.openwrt.org/snapshots/packages/${ OMR_REAL_TARGET } /telephony
EOF
fi
2019-04-22 15:11:52 +00:00
#cat > "$OMR_TARGET/source/package/system/opkg/files/customfeeds.conf" <<EOF
#src/gz openwrt_luci http://downloads.openwrt.org/releases/18.06.0/packages/${OMR_REAL_TARGET}/luci
#src/gz openwrt_packages http://downloads.openwrt.org/releases/18.06.0/packages/${OMR_REAL_TARGET}/packages
#src/gz openwrt_base http://downloads.openwrt.org/releases/18.06.0/packages/${OMR_REAL_TARGET}/base
#src/gz openwrt_routing http://downloads.openwrt.org/releases/18.06.0/packages/${OMR_REAL_TARGET}/routing
#src/gz openwrt_telephony http://downloads.openwrt.org/releases/18.06.0/packages/${OMR_REAL_TARGET}/telephony
#EOF
2018-04-17 06:32:01 +00:00
2022-02-04 21:39:13 +00:00
if [ -f $OMR_TARGET_CONFIG ] ; then
2018-05-18 08:26:49 +00:00
cat " $OMR_TARGET_CONFIG " config -> " $OMR_TARGET /source/.config " <<-EOF
CONFIG_IMAGEOPT = y
CONFIG_VERSIONOPT = y
CONFIG_VERSION_DIST = " $OMR_DIST "
CONFIG_VERSION_REPO = " $OMR_REPO "
2022-02-04 21:39:13 +00:00
CONFIG_VERSION_NUMBER = " $( git -C " $OMR_FEED " describe --tags ` git rev-list --tags --max-count= 1` | tail -1 | cut -d '-' -f1) "
2018-05-18 08:26:49 +00:00
EOF
else
cat config -> " $OMR_TARGET /source/.config " <<-EOF
CONFIG_IMAGEOPT = y
CONFIG_VERSIONOPT = y
CONFIG_VERSION_DIST = " $OMR_DIST "
CONFIG_VERSION_REPO = " $OMR_REPO "
2022-02-04 21:39:13 +00:00
CONFIG_VERSION_NUMBER = " $( git -C " $OMR_FEED " describe --tags ` git rev-list --tags --max-count= 1` | tail -1 | cut -d '-' -f1) - $( git -C " $OMR_FEED " rev-parse --short HEAD) "
2018-05-18 08:26:49 +00:00
EOF
fi
2021-09-27 16:18:30 +00:00
#if [ "$OMR_KERNEL" = "5.14" ]; then
# echo 'CONFIG_KERNEL_GIT_CLONE_URI="https://github.com/multipath-tcp/mptcp_net-next.git"' >> "$OMR_TARGET/source/.config"
# echo 'CONFIG_KERNEL_GIT_REF="78828adaef8fe9b69f9a8c4b60f74b01c5a31c7a"' >> "$OMR_TARGET/source/.config"
#fi
2018-04-05 15:16:42 +00:00
if [ " $OMR_ALL_PACKAGES " = "yes" ] ; then
echo 'CONFIG_ALL=y' >> " $OMR_TARGET /source/.config "
2020-05-14 14:49:19 +00:00
echo 'CONFIG_ALL_NONSHARED=y' >> " $OMR_TARGET /source/.config "
2018-04-05 15:16:42 +00:00
fi
2018-02-14 09:28:01 +00:00
if [ " $OMR_IMG " = "yes" ] && [ " $OMR_TARGET " = "x86_64" ] ; then
2018-02-21 14:09:20 +00:00
echo 'CONFIG_VDI_IMAGES=y' >> " $OMR_TARGET /source/.config "
echo 'CONFIG_VMDK_IMAGES=y' >> " $OMR_TARGET /source/.config "
2019-05-28 19:24:16 +00:00
echo 'CONFIG_VHDX_IMAGES=y' >> " $OMR_TARGET /source/.config "
2018-02-14 09:28:01 +00:00
fi
2017-12-22 10:08:56 +00:00
2020-06-09 20:40:38 +00:00
if [ " $OMR_PACKAGES " = "full" ] ; then
2020-07-21 19:50:18 +00:00
echo " CONFIG_PACKAGE_ ${ OMR_DIST } -full=y " >> " $OMR_TARGET /source/.config "
2020-06-09 20:40:38 +00:00
fi
if [ " $OMR_PACKAGES " = "mini" ] ; then
2020-07-21 19:50:18 +00:00
echo " CONFIG_PACKAGE_ ${ OMR_DIST } -mini=y " >> " $OMR_TARGET /source/.config "
2020-06-09 20:40:38 +00:00
fi
2021-11-24 11:00:33 +00:00
if [ " $SHORTCUT_FE " = "yes" ] && [ " $OMR_KERNEL " = "5.4" ] ; then
2021-04-15 18:24:52 +00:00
echo "# CONFIG_PACKAGE_kmod-fast-classifier is not set" >> " $OMR_TARGET /source/.config "
echo "CONFIG_PACKAGE_kmod-fast-classifier-noload=y" >> " $OMR_TARGET /source/.config "
2021-09-28 13:09:35 +00:00
echo "CONFIG_PACKAGE_kmod-shortcut-fe-cm=y" >> " $OMR_TARGET /source/.config "
echo "CONFIG_PACKAGE_kmod-shortcut-fe=y" >> " $OMR_TARGET /source/.config "
2021-04-15 18:24:52 +00:00
else
echo "# CONFIG_PACKAGE_kmod-fast-classifier is not set" >> " $OMR_TARGET /source/.config "
echo "# CONFIG_PACKAGE_kmod-fast-classifier-noload is not set" >> " $OMR_TARGET /source/.config "
2021-09-28 13:09:35 +00:00
echo "# CONFIG_PACKAGE_kmod-shortcut-fe-cm is not set" >> " $OMR_TARGET /source/.config "
echo "# CONFIG_PACKAGE_kmod-shortcut-fe is not set" >> " $OMR_TARGET /source/.config "
2021-04-15 18:24:52 +00:00
fi
2021-11-24 11:00:33 +00:00
if [ " $OMR_KERNEL " != "5.4" ] && [ " $OMR_TARGET " != "x86_64" ] && [ " $OMR_TARGET " != "x86" ] ; then
2021-10-08 14:30:03 +00:00
echo "# CONFIG_PACKAGE_kmod-r8125 is not set" >> " $OMR_TARGET /source/.config "
echo "# CONFIG_PACKAGE_kmod-r8168 is not set" >> " $OMR_TARGET /source/.config "
fi
2021-04-15 18:24:52 +00:00
2021-03-05 11:53:26 +00:00
if [ " $OMR_TARGET " = "bpi-r1" -a " $OMR_OPENWRT " = "master" ] ; then
# We disable mc in master, because it leads to unknown compilation errors on bpi-r1 target
# No time to check this, now, cause i am focused on make this target work
# Maybe someone can do this later
echo -n "Disabling error causing midnight commander (mc) package..."
sed -i "s/CONFIG_PACKAGE_mc=y/# CONFIG_PACKAGE_mc is not set/" " $OMR_TARGET /source/.config "
sed -i "s/CONFIG_MC_EDITOR=y/# CONFIG_MC_EDITOR is not set/" " $OMR_TARGET /source/.config "
sed -i "s/CONFIG_MC_SUBSHELL=y/# CONFIG_MC_SUBSHELL is not set/" " $OMR_TARGET /source/.config "
sed -i "s/CONFIG_MC_CHARSET=y/# CONFIG_MC_CHARSET is not set/" " $OMR_TARGET /source/.config "
sed -i "s/CONFIG_MC_VFS=y/# CONFIG_MC_VFS is not set/" " $OMR_TARGET /source/.config "
echo "done"
# 2021-03-05 Oliver Welter <oliver@welter.rocks>
fi
if [ " $OMR_TARGET " = "bpi-r1" ] ; then
2021-03-06 15:26:45 +00:00
# Check kernel version
if [ " $OMR_KERNEL " != "5.4" ] ; then
echo "Sorry, but for now kernel 5.4 is the only supported one."
exit 1
fi
2021-03-06 19:42:41 +00:00
# Remove the 310-Revert-ARM-dts-sun7i-Add-BCM53125-switch-nodes-to-th patch
echo -n " Removing unwanted patches from kernel $OMR_KERNEL ... "
rm -f " $OMR_TARGET /source/target/linux/sunxi/patches- $OMR_KERNEL /310-Revert-ARM-dts-sun7i-Add-BCM53125-switch-nodes-to-th.patch " >/dev/null 2>& 1
echo "done"
2021-03-05 15:28:10 +00:00
if [ " $OMR_FORCE_DSA " = "1" ] ; then
# Remove support for swconfig
echo -n "Removing swconfig support from openwrt config..."
2021-03-06 15:26:45 +00:00
for i in DEFAULT_swconfig PACKAGE_swconfig PACKAGE_kmod-swconfig; do
2021-03-05 15:28:10 +00:00
sed -i " s/CONFIG_ ${ i } /# CONFIG_ ${ i } is not set/ " " $OMR_TARGET /source/.config "
done
echo "done"
2021-03-06 15:26:45 +00:00
echo -n " Removing B53 swconfig support from kernel $OMR_KERNEL ... "
2021-03-06 15:10:44 +00:00
for i in SWCONFIG_B53 SWCONFIG_B53_PHY_DRIVER SWCONFIG_LEDS LED_TRIGGER_PHY SWCONFIG_B53_PHY_FIXUP SWCONFIG_B53_SPI_DRIVER SWCONFIG_B53_MMAP_DRIVER SWCONFIG_B53_SRAB_DRIVER; do
2021-03-06 15:26:45 +00:00
sed -i " s/CONFIG_ ${ i } /# CONFIG_ ${ i } is not set/ " " $OMR_TARGET /source/target/linux/sunxi/config- $OMR_KERNEL "
sed -i " s/CONFIG_ ${ i } /# CONFIG_ ${ i } is not set/ " " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL "
2021-03-05 15:28:10 +00:00
done
echo "done"
# Add support for distributed switch architecture
2021-03-06 15:45:48 +00:00
echo -n " Adding B53 DSA support to kernel $OMR_KERNEL ... "
2021-03-06 03:49:54 +00:00
for i in B53 B53_MDIO_DRIVER BRIDGE_VLAN_FILTERING MDIO_BUS_MUX_MULTIPLEXER NET_DSA NET_DSA_TAG_8021Q NET_DSA_TAG_BRCM NET_DSA_TAG_BRCM_PREPEND; do
2021-03-06 15:45:48 +00:00
check_sunxi_config = ` grep " CONFIG_ ${ i } =y " " $OMR_TARGET /source/target/linux/sunxi/config- $OMR_KERNEL " || true `
check_cortexa7_config = ` grep " CONFIG_ ${ i } =y " " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL " || true `
2021-03-06 15:26:45 +00:00
[ " $check_sunxi_config " = "" -a " $check_cortexa7_config " = "" ] && echo " CONFIG_ ${ i } =y " >> " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL "
2021-03-05 15:28:10 +00:00
done
echo "done"
2021-03-06 03:49:54 +00:00
2021-03-09 23:53:42 +00:00
# Create DSA port map file (will be filled on first boot, by uci-defaults and tells the system, that it is in DSA mode)
touch " $OMR_TARGET /source/target/linux/sunxi/base-files/etc/dsa.map "
# Remove the b53 hack in preinit
rm -f " $OMR_TARGET /source/target/linux/sunxi/base-files/lib/preinit/03_b53_hack.sh "
2021-03-05 22:09:04 +00:00
else
2021-03-06 02:42:30 +00:00
# Remove ip-bridge
echo -n "Removing ip-bridge support from openwrt config..."
for i in PACKAGE_ip-bridge; do
sed -i " s/CONFIG_ ${ i } /# CONFIG_ ${ i } is not set/ " " $OMR_TARGET /source/.config "
done
echo "done"
2021-03-05 22:09:04 +00:00
# Remove swconfig parts
2021-03-06 15:26:45 +00:00
echo -n " Removing unneeded B53 swconfig parts from kernel $OMR_KERNEL ... "
2021-03-05 22:09:04 +00:00
for i in SWCONFIG_B53_PHY_FIXUP SWCONFIG_B53_SPI_DRIVER SWCONFIG_B53_MMAP_DRIVER SWCONFIG_B53_SRAB_DRIVER; do
2021-03-06 15:26:45 +00:00
sed -i " s/CONFIG_ ${ i } /# CONFIG_ ${ i } is not set/ " " $OMR_TARGET /source/target/linux/sunxi/config- $OMR_KERNEL "
sed -i " s/CONFIG_ ${ i } /# CONFIG_ ${ i } is not set/ " " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL "
2021-03-05 22:09:04 +00:00
done
echo "done"
2021-03-05 15:28:10 +00:00
fi
2021-03-05 11:53:26 +00:00
# Add led support
2021-03-06 15:26:45 +00:00
echo -n " Adding LED TRIGGER support to kernel $OMR_KERNEL ... "
2021-03-05 15:28:10 +00:00
if [ " $OMR_FORCE_DSA " != "1" ] ; then
for i in SWCONFIG_LEDS LED_TRIGGER_PHY; do
2021-03-06 15:45:48 +00:00
check_sunxi_config = ` grep " CONFIG_ ${ i } =y " " $OMR_TARGET /source/target/linux/sunxi/config- $OMR_KERNEL " || true `
check_cortexa7_config = ` grep " CONFIG_ ${ i } =y " " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL " || true `
2021-03-06 15:26:45 +00:00
[ " $check_sunxi_config " = "" -a " $check_cortexa7_config " = "" ] && echo " CONFIG_ ${ i } =y " >> " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL "
2021-03-05 15:28:10 +00:00
done
fi
2021-03-05 14:22:55 +00:00
for i in TIMER ONESHOT DISK MTD HEARTBEAT BACKLIGHT CPU ACTIVITY GPIO DEFAULT_ON TRANSIENT CAMERA PANIC NETDEV PATTERN AUDIO; do
2021-03-06 15:45:48 +00:00
check_sunxi_config = ` grep " CONFIG_LEDS_TRIGGER_ ${ i } =y " " $OMR_TARGET /source/target/linux/sunxi/config- $OMR_KERNEL " || true `
check_cortexa7_config = ` grep " CONFIG_LEDS_TRIGGER_ ${ i } =y " " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL " || true `
2021-03-06 15:26:45 +00:00
[ " $check_sunxi_config " = "" -a " $check_cortexa7_config " = "" ] && echo " CONFIG_LEDS_TRIGGER_ ${ i } =y " >> " $OMR_TARGET /source/target/linux/sunxi/cortexa7/config- $OMR_KERNEL "
2021-03-05 11:53:26 +00:00
done
2021-03-07 01:49:09 +00:00
echo "done"
2021-03-05 11:53:26 +00:00
fi
2021-03-04 22:47:15 +00:00
2018-02-21 14:09:20 +00:00
cd " $OMR_TARGET /source "
2017-12-22 10:08:56 +00:00
2020-04-01 12:47:18 +00:00
#if [ "$OMR_UEFI" = "yes" ] && [ "$OMR_TARGET" = "x86_64" ]; then
# echo "Checking if UEFI patch is set or not"
# if [ "$(grep 'EFI_IMAGES' target/linux/x86/image/Makefile)" = "" ]; then
# patch -N -p1 -s < ../../patches/uefi.patch
# fi
# echo "Done"
#else
# if [ "$(grep 'EFI_IMAGES' target/linux/x86/image/Makefile)" != "" ]; then
# patch -N -R -p1 -s < ../../patches/uefi.patch
# fi
#fi
2018-02-27 20:54:33 +00:00
2019-06-03 21:21:43 +00:00
#if [ "$OMR_TARGET" = "x86_64" ]; then
# echo "Checking if Hyper-V patch is set or not"
# if ! patch -Rf -N -p1 -s --dry-run < ../../patches/images.patch; then
# patch -N -p1 -s < ../../patches/images.patch
# fi
# echo "Done"
#fi
2019-06-01 06:26:22 +00:00
2019-06-02 08:12:52 +00:00
echo "Checking if No check patch is set or not"
if ! patch -Rf -N -p1 -s --dry-run < ../../patches/nocheck.patch; then
2020-03-28 09:47:41 +00:00
echo "apply..."
2019-06-02 08:12:52 +00:00
patch -N -p1 -s < ../../patches/nocheck.patch
fi
echo "Done"
2019-12-19 08:40:20 +00:00
echo "Checking if Nanqinlang patch is set or not"
if ! patch -Rf -N -p1 -s --dry-run < ../../patches/nanqinlang.patch; then
2020-03-28 09:47:41 +00:00
echo "apply..."
2019-12-19 08:40:20 +00:00
patch -N -p1 -s < ../../patches/nanqinlang.patch
fi
echo "Done"
2021-06-24 15:23:36 +00:00
#echo "Checking if remove_abi patch is set or not"
#if ! patch -Rf -N -p1 -s --dry-run < ../../patches/remove_abi.patch; then
# echo "apply..."
# patch -N -p1 -s < ../../patches/remove_abi.patch
#fi
#echo "Done"
2021-02-17 18:25:29 +00:00
2020-12-08 08:24:17 +00:00
# Add BBR2 patch, only working on 64bits images for now
2021-11-24 11:00:33 +00:00
if [ " $OMR_KERNEL " = "5.4" ] && ( [ " $OMR_TARGET " = "x86_64" ] || [ " $OMR_TARGET " = "bpi-r64" ] || [ " $OMR_TARGET " = "rpi4" ] || [ " $OMR_TARGET " = "espressobin" ] || [ " $OMR_TARGET " = "r2s" ] || [ " $OMR_TARGET " = "r4s" ] || [ " $OMR_TARGET " = "rpi3" ] ) ; then
2020-12-17 08:33:56 +00:00
echo "Checking if BBRv2 patch is set or not"
if ! patch -Rf -N -p1 -s --dry-run < ../../patches/bbr2.patch; then
echo "apply..."
patch -N -p1 -s < ../../patches/bbr2.patch
fi
echo "Done"
2020-11-23 18:46:26 +00:00
fi
2020-03-27 09:19:22 +00:00
echo "Checking if smsc75xx patch is set or not"
if ! patch -Rf -N -p1 -s --dry-run < ../../patches/smsc75xx.patch; then
2020-03-28 09:47:41 +00:00
echo "apply..."
2020-03-27 09:19:22 +00:00
patch -N -p1 -s < ../../patches/smsc75xx.patch
fi
echo "Done"
2020-04-20 14:45:17 +00:00
#echo "Checking if ipt-nat patch is set or not"
#if ! patch -Rf -N -p1 -s --dry-run < ../../patches/ipt-nat6.patch; then
# echo "apply..."
# patch -N -p1 -s < ../../patches/ipt-nat6.patch
#fi
#echo "Done"
2020-03-27 09:19:22 +00:00
2020-04-17 13:04:15 +00:00
#echo "Checking if mvebu patch is set or not"
#if [ ! -d target/linux/mvebu/patches-5.4 ]; then
# echo "apply..."
# patch -N -p1 -s < ../../patches/mvebu-5.14.patch
#fi
#echo "Done"
2020-03-27 09:19:22 +00:00
2021-06-24 15:09:41 +00:00
#echo "Checking if opkg install arguement too long patch is set or not"
#if ! patch -Rf -N -p1 -s --dry-run < ../../patches/package-too-long.patch; then
# echo "apply..."
# patch -N -p1 -s < ../../patches/package-too-long.patch
#fi
#echo "Done"
2020-04-04 14:00:23 +00:00
2020-05-14 15:35:11 +00:00
echo "Download via IPv4"
2020-04-17 13:04:15 +00:00
if ! patch -Rf -N -p1 -s --dry-run < ../../patches/download-ipv4.patch; then
patch -N -p1 -s < ../../patches/download-ipv4.patch
fi
echo "Done"
2021-03-08 13:46:21 +00:00
#echo "Remove check rsync"
#if [ "$(grep rsync include/prereq-build.mk)" != "" ]; then
# patch -N -p1 -s < ../../patches/check-rsync.patch
#fi
#echo "Done"
2020-12-16 16:10:14 +00:00
2020-04-24 19:56:50 +00:00
if [ -f target/linux/mediatek/patches-5.4/0999-hnat.patch ] ; then
rm -f target/linux/mediatek/patches-5.4/0999-hnat.patch
fi
2019-06-02 08:12:52 +00:00
2020-09-22 13:07:54 +00:00
if [ -f target/linux/ipq40xx/patches-5.4/100-GPIO-add-named-gpio-exports.patch ] ; then
rm -f target/linux/ipq40xx/patches-5.4/100-GPIO-add-named-gpio-exports.patch
fi
2021-05-20 08:26:43 +00:00
if [ -f package/boot/uboot-rockchip/patches/100-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch ] ; then
rm -f package/boot/uboot-rockchip/patches/100-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch
fi
2019-03-06 17:21:03 +00:00
#echo "Patch protobuf wrong hash"
#patch -N -R -p1 -s < ../../patches/protobuf_hash.patch
#echo "Done"
2018-12-23 13:10:39 +00:00
#echo "Remove gtime dependency"
#if ! patch -Rf -N -p1 -s --dry-run < ../../patches/gtime.patch; then
# patch -N -p1 -s < ../../patches/gtime.patch
#fi
#echo "Done"
2018-05-10 21:10:49 +00:00
2021-09-30 07:31:47 +00:00
#if [ -f target/linux/generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch ]; then
# rm -f target/linux/generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch
#fi
#if [ -f target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch ]; then
# rm -f target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch
#fi
#if [ -f target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch ]; then
# rm -f target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch
#fi
#if [ -f target/linux/generic/pending-5.4/642-net-8021q-support-hardware-flow-table-offload.patch ]; then
# rm -f target/linux/generic/pending-5.4/642-net-8021q-support-hardware-flow-table-offload.patch
#fi
#if [ -f target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch ]; then
# rm -f target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch
#fi
#if [ -f target/linux/generic/pending-5.4/644-net-pppoe-support-hardware-flow-table-offload.patch ]; then
# rm -f target/linux/generic/pending-5.4/644-net-pppoe-support-hardware-flow-table-offload.patch
#fi
#if [ -f target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch ]; then
# rm -f target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
#fi
#if [ -f target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch ]; then
# rm -f target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
#fi
#if [ -f target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch ]; then
# rm -f target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch
#fi
#if [ -f target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch ]; then
# rm -f target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
#fi
#if [ -f target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch ]; then
# rm -f target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch
#fi
#if [ -f target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch ]; then
# rm -f target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
#fi
2021-09-30 13:29:03 +00:00
if [ -f target/linux/bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch ] ; then
rm -f target/linux/bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch
fi
2021-09-30 07:31:47 +00:00
#if [ -f target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch ]; then
# rm -f target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
#fi
2021-09-28 18:39:46 +00:00
2020-03-11 15:01:27 +00:00
if [ " $OMR_KERNEL " = "5.4" ] ; then
echo "Set to kernel 5.4 for rpi arch"
2021-09-28 17:26:46 +00:00
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.10%KERNEL_PATCHVER:=5.4%g' { } \;
2021-09-28 15:10:54 +00:00
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.4%g' { } \;
2019-05-06 05:48:02 +00:00
echo "Done"
2020-03-11 15:01:27 +00:00
echo "Set to kernel 5.4 for x86 arch"
2021-09-28 15:10:54 +00:00
find target/linux/x86 -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.4%g' { } \;
2019-05-06 05:48:02 +00:00
echo "Done"
2020-03-27 09:19:22 +00:00
echo "Set to kernel 5.4 for mvebu arch (WRT)"
2021-09-28 15:10:54 +00:00
find target/linux/mvebu -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.4%g' { } \;
2020-03-27 09:19:22 +00:00
echo "Done"
2020-03-11 15:01:27 +00:00
echo "Set to kernel 5.4 for mediatek arch (BPI-R2)"
2021-09-28 15:10:54 +00:00
find target/linux/mediatek -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.4%g' { } \;
2019-05-31 16:56:59 +00:00
echo "Done"
2021-10-07 10:38:07 +00:00
if [ -f package/kernel/mac80211/patches/build/firmware-replace-HOTPLUG-with-UEVENT-in-FW_ACTION-defines.patch ] ; then
rm -f package/kernel/mac80211/patches/build/firmware-replace-HOTPLUG-with-UEVENT-in-FW_ACTION-defines.patch
fi
if [ -f package/kernel/rtl8812au-ct/patches/003-wireless-5.8.patch ] ; then
rm -f package/kernel/rtl8812au-ct/patches/003-wireless-5.8.patch
fi
if [ -f target/linux/mvebu/patches-5.4/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch ] ; then
rm -f target/linux/mvebu/patches-5.4/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch
fi
2021-10-07 18:45:02 +00:00
if [ -f target/linux/mvebu/patches-5.4/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch ] ; then
rm -f target/linux/mvebu/patches-5.4/022-arm64-dts-marvell-armada-37xx-Move-PCIe-max-link-spe.patch
fi
2021-11-17 16:40:58 +00:00
echo "CONFIG_VERSION_CODE=5.4" >> ".config"
2019-05-06 05:48:02 +00:00
fi
2021-09-27 16:18:30 +00:00
if [ " $OMR_KERNEL " = "5.10" ] ; then
echo "Set to kernel 5.10 for rpi arch"
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.10%g' { } \;
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.4%KERNEL_PATCHVER:=5.10%g' { } \;
echo "Done"
2021-09-28 17:26:46 +00:00
echo "Set to kernel 5.10 for x86 arch"
2021-09-27 16:18:30 +00:00
find target/linux/x86 -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.10%g' { } \;
echo "Done"
2021-09-28 17:26:46 +00:00
echo "Set to kernel 5.10 for mvebu arch (WRT)"
2021-09-27 16:18:30 +00:00
find target/linux/mvebu -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.10%g' { } \;
echo "Done"
2021-09-28 17:26:46 +00:00
echo "Set to kernel 5.10 for mediatek arch (BPI-R2)"
2021-09-27 16:18:30 +00:00
find target/linux/mediatek -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.10%g' { } \;
echo "Done"
fi
2021-09-06 11:08:45 +00:00
if [ " $OMR_KERNEL " = "5.14" ] ; then
echo "Set to kernel 5.14 for rpi arch"
2021-09-28 15:10:54 +00:00
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.14%g' { } \;
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.10%KERNEL_PATCHVER:=5.14%g' { } \;
2021-12-01 20:12:56 +00:00
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.4%KERNEL_PATCHVER:=5.14%g' { } \;
2021-09-06 11:08:45 +00:00
echo "Done"
echo "Set to kernel 5.14 for x86 arch"
2021-09-27 16:18:30 +00:00
find target/linux/x86 -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.14%g' { } \;
2021-09-06 11:08:45 +00:00
echo "Done"
echo "Set to kernel 5.14 for mvebu arch (WRT)"
2021-09-28 15:10:54 +00:00
find target/linux/mvebu -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.14%g' { } \;
2021-09-06 11:08:45 +00:00
echo "Done"
echo "Set to kernel 5.14 for mediatek arch (BPI-R2)"
2021-09-28 15:10:54 +00:00
find target/linux/mediatek -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.14%g' { } \;
2021-10-18 14:01:57 +00:00
find target/linux/mediatek -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.14%g' { } \;
2021-09-06 11:08:45 +00:00
echo "Done"
2021-09-29 05:58:42 +00:00
echo "Set to kernel 5.14 for rockchip arch (R2S/R4S)"
2021-10-02 06:31:13 +00:00
find target/linux/rockchip -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.4%KERNEL_PATCHVER:=5.14%g' { } \;
2021-09-29 05:58:42 +00:00
echo "Done"
echo "Set to kernel 5.14 for ramips"
find target/linux/ramips -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.14%g' { } \;
echo "Done"
2021-11-01 09:29:20 +00:00
echo "Set to kernel 5.14 for ramips"
find target/linux/ipq806x -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.14%g' { } \;
echo "Done"
2021-10-18 14:01:57 +00:00
#rm -rf target/linux/generic/files/drivers/net/phy/b53
2021-10-03 05:41:33 +00:00
rm -f target/linux/bcm27xx/modules/sound.mk
2021-10-25 19:13:30 +00:00
echo "CONFIG_DEVEL=y" >> ".config"
echo "CONFIG_NEED_TOOLCHAIN=y" >> ".config"
echo "CONFIG_TOOLCHAINOPTS=y" >> ".config"
echo 'CONFIG_BINUTILS_VERSION_2_36_1=y' >> ".config"
echo 'CONFIG_BINUTILS_VERSION="2.36.1' >> ".config"
2021-10-18 14:01:57 +00:00
echo "CONFIG_BINUTILS_USE_VERSION_2_36_1=y" >> ".config"
2021-11-17 16:40:58 +00:00
echo "CONFIG_VERSION_CODE=5.14" >> ".config"
2021-10-18 14:01:57 +00:00
#echo "CONFIG_GCC_USE_VERSION_10=y" >> ".config"
2021-10-25 19:13:30 +00:00
if [ " $TARGET " = "bpi-r2" ] ; then
echo "# CONFIG_VERSION_CODE_FILENAMES is not set" >> ".config"
fi
2021-09-06 11:08:45 +00:00
fi
2021-11-24 11:00:33 +00:00
if [ " $OMR_KERNEL " = "5.15" ] ; then
echo "Set to kernel 5.15 for rpi arch"
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.15%g' { } \;
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.10%KERNEL_PATCHVER:=5.15%g' { } \;
2021-12-01 20:12:56 +00:00
find target/linux/bcm27xx -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.4%KERNEL_PATCHVER:=5.15%g' { } \;
2021-11-24 11:00:33 +00:00
echo "Done"
echo "Set to kernel 5.15 for x86 arch"
find target/linux/x86 -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.15%g' { } \;
echo "Done"
echo "Set to kernel 5.15 for mvebu arch (WRT)"
find target/linux/mvebu -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.15%g' { } \;
echo "Done"
echo "Set to kernel 5.15 for mediatek arch (BPI-R2)"
find target/linux/mediatek -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.15%g' { } \;
find target/linux/mediatek -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.15%g' { } \;
echo "Done"
echo "Set to kernel 5.15 for rockchip arch (R2S/R4S)"
find target/linux/rockchip -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER=5.4%KERNEL_PATCHVER:=5.15%g' { } \;
echo "Done"
echo "Set to kernel 5.15 for ramips"
find target/linux/ramips -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.4%KERNEL_PATCHVER:=5.15%g' { } \;
echo "Done"
echo "Set to kernel 5.15 for ramips"
find target/linux/ipq806x -type f -name Makefile -exec sed -i 's%KERNEL_PATCHVER:=5.10%KERNEL_PATCHVER:=5.15%g' { } \;
echo "Done"
#rm -rf target/linux/generic/files/drivers/net/phy/b53
rm -f target/linux/bcm27xx/modules/sound.mk
echo "CONFIG_DEVEL=y" >> ".config"
echo "CONFIG_NEED_TOOLCHAIN=y" >> ".config"
echo "CONFIG_TOOLCHAINOPTS=y" >> ".config"
echo 'CONFIG_BINUTILS_VERSION_2_36_1=y' >> ".config"
2021-12-16 20:28:23 +00:00
echo 'CONFIG_BINUTILS_VERSION="2.36.1"' >> ".config"
2021-11-24 11:00:33 +00:00
echo "CONFIG_BINUTILS_USE_VERSION_2_36_1=y" >> ".config"
2021-12-16 20:28:23 +00:00
#echo "CONFIG_GCC_USE_VERSION_10=y" >> ".config"
#echo "CONFIG_GCC_VERSION_10=y" >> ".config"
#echo 'CONFIG_GCC_VERSION="10.3.0"' >> ".config"
2021-11-24 11:00:33 +00:00
echo "CONFIG_VERSION_CODE=5.15" >> ".config"
#echo "CONFIG_GCC_USE_VERSION_10=y" >> ".config"
if [ " $TARGET " = "bpi-r2" ] ; then
echo "# CONFIG_VERSION_CODE_FILENAMES is not set" >> ".config"
fi
fi
2019-04-22 15:11:52 +00:00
2020-07-10 20:20:19 +00:00
#rm -rf feeds/packages/libs/libwebp
2020-10-14 13:32:54 +00:00
cd "../.."
2020-06-11 06:35:21 +00:00
rm -rf feeds/luci/modules/luci-mod-network
2020-09-10 19:08:15 +00:00
[ -d feeds/${ OMR_DIST } /luci-mod-status ] && rm -rf feeds/luci/modules/luci-mod-status
2020-09-23 14:57:41 +00:00
[ -d feeds/${ OMR_DIST } /luci-app-statistics ] && rm -rf feeds/luci/applications/luci-app-statistics
2021-08-15 17:37:35 +00:00
[ -d feeds/${ OMR_DIST } /luci-proto-modemmanager ] && rm -rf feeds/luci/protocols/luci-proto-modemmanager
2022-02-04 18:54:59 +00:00
[ -d feeds/${ OMR_DIST } /netifd ] && rm -rf package/network/config/netifd
2022-02-04 18:56:29 +00:00
[ -d feeds/${ OMR_DIST } /iperf3 ] && rm -rf feeds/packages/net/iperf3
2020-06-11 06:35:21 +00:00
2020-10-14 13:32:54 +00:00
echo "Add Occitan translation support"
if ! patch -Rf -N -p1 -s --dry-run < patches/luci-occitan.patch; then
patch -N -p1 -s < patches/luci-occitan.patch
#sh feeds/luci/build/i18n-add-language.sh oc
fi
[ -d $OMR_FEED /luci-base/po/oc ] && cp -rf $OMR_FEED /luci-base/po/oc feeds/luci/modules/luci-base/po/
echo "Done"
cd " $OMR_TARGET /source "
echo "Update feeds index"
2017-12-22 10:08:56 +00:00
cp .config .config.keep
scripts/feeds clean
scripts/feeds update -a
2020-04-02 12:14:51 +00:00
2020-04-09 13:01:48 +00:00
#cd -
#echo "Checking if fullconenat-luci patch is set or not"
##if ! patch -Rf -N -p1 -s --dry-run < patches/fullconenat-luci.patch; then
# echo "apply..."
# patch -N -p1 -s < patches/fullconenat-luci.patch
#fi
#echo "Done"
#cd "$OMR_TARGET/source"
2020-04-02 12:14:51 +00:00
2018-04-05 15:16:42 +00:00
if [ " $OMR_ALL_PACKAGES " = "yes" ] ; then
2020-05-14 14:49:19 +00:00
scripts/feeds install -a -d m -p packages
scripts/feeds install -a -d m -p luci
2018-04-05 15:16:42 +00:00
fi
2020-08-03 14:53:41 +00:00
if [ -n " $CUSTOM_FEED " ] ; then
scripts/feeds install -a -d m -p openmptcprouter
scripts/feeds install -a -d y -f -p ${ OMR_DIST }
else
scripts/feeds install -a -d y -f -p openmptcprouter
fi
2017-12-22 10:08:56 +00:00
cp .config.keep .config
2021-06-17 06:09:30 +00:00
scripts/feeds install kmod-macremapper
2018-02-27 20:54:33 +00:00
echo "Done"
2017-12-22 10:08:56 +00:00
2018-05-11 13:14:40 +00:00
if [ ! -f " ../../ $OMR_TARGET_CONFIG " ] ; then
echo " Target $OMR_TARGET not found ! You have to configure and compile your kernel manually. "
exit 1
fi
2021-09-28 17:26:46 +00:00
echo " Building $OMR_DIST for the target $OMR_TARGET with kernel $OMR_KERNEL "
2017-12-22 10:08:56 +00:00
make defconfig
2018-04-17 06:32:01 +00:00
make IGNORE_ERRORS = m " $@ "
2018-02-27 20:54:33 +00:00
echo "Done"