#!/bin/bash # Go to the correct directory cd ~/ipq806x-nss touch .config # Clean up make clean # Update code in main repo git checkout kernel5.10-nss-qsdk10.0 git fetch origin git reset --hard origin/kernel5.10-nss-qsdk10.0 git clean -f -d git status # Delete bin folder (ACwifidude puts his builds in there) rm -rf ./bin/ # Create new feeds file with my package feed cp feeds.conf.default feeds.conf printf "\nsrc-git stoickish https://github.com/stoickish/openwrt-jitterentropy.git\n" >> feeds.conf # Update feeds ./scripts/feeds clean ./scripts/feeds update -a ./scripts/feeds install -a # Hack in RICSC sqm-scripts feed sed -i 's/PKG_SOURCE_VERSION:=[a-fA-F0-9]\{40\}/PKG_SOURCE_VERSION:=4f3492aa93ad436b9312ce731d3ad45bf5e8a6e1/g' feeds/packages/net/sqm-scripts/Makefile sed -i 's|https://github.com/tohojo/sqm-scripts|https://github.com/ricsc/sqm-scripts|g' feeds/packages/net/sqm-scripts/Makefile sed -i 's/PKG_MIRROR_HASH:=[a-fA-F0-9]\{64\}//g' feeds/packages/net/sqm-scripts/Makefile # Creates a new .config file # Target / build settings printf "CONFIG_TARGET_ipq806x=y\n" > .config printf "CONFIG_TARGET_ipq806x_generic=y\n" >> .config printf "CONFIG_TARGET_MULTI_PROFILE=y\n" >> .config printf "CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_netgear_r7800=y\n" >> .config printf "CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_netgear_xr500=y\n" >> .config printf "CONFIG_DEVEL=y\n" >> .config printf "CONFIG_TOOLCHAINOPTS=y\n" >> .config printf "CONFIG_EXTRA_OPTIMIZATION=\"-fno-caller-saves -fno-plt -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta\"\n" >> .config printf "CONFIG_GCC_USE_GRAPHITE=y\n" >> .config printf "CONFIG_TARGET_OPTIMIZATION=\"-Ofast -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard\"\n" >> .config printf "CONFIG_TARGET_OPTIONS=y\n" >> .config # Disable FW4 as it breaks banip, bcp38 printf "CONFIG_PACKAGE_firewall=y\n" >> .config printf "# CONFIG_PACKAGE_firewall4 is not set\n" >> .config printf "CONFIG_PACKAGE_ip6tables-legacy=y\n" >> .config # Needed by banIP for IPv6 Networks (FW3) # NSS stuff printf "CONFIG_PACKAGE_iptables-mod-physdev=y\n" >> .config printf "CONFIG_PACKAGE_kmod-ipt-physdev=y\n" >> .config printf "CONFIG_PACKAGE_kmod-nss-ifb=y\n" >> .config printf "CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc=y\n" >> .config printf "CONFIG_PACKAGE_kmod-qca-nss-drv-vlan-mgr=y\n" >> .config printf "CONFIG_PACKAGE_kmod-qca-nss-ecm-standard=y\n" >> .config printf "CONFIG_PACKAGE_kmod-qca-nss-gmac=y\n" >> .config printf "CONFIG_PACKAGE_MAC80211_NSS_SUPPORT=y\n" >> .config # My package settings printf "CONFIG_HTOP_LMSENSORS=y\n" >> .config printf "CONFIG_PACKAGE_curl=y\n" >> .config printf "CONFIG_PACKAGE_htop=y\n" >> .config printf "CONFIG_PACKAGE_irqbalance=y\n" >> .config printf "CONFIG_PACKAGE_jitterentropy=y\n" >> .config printf "CONFIG_PACKAGE_lm-sensors=y\n" >> .config printf "CONFIG_PACKAGE_luci-app-banip=y\n" >> .config printf "CONFIG_PACKAGE_luci-app-bcp38=y\n" >> .config printf "CONFIG_PACKAGE_luci-app-https-dns-proxy=y\n" >> .config printf "CONFIG_PACKAGE_luci-app-sqm=y\n" >> .config printf "CONFIG_PACKAGE_luci-ssl=y\n" >> .config printf "CONFIG_PACKAGE_luci-theme-openwrt-2020=y\n" >> .config printf "CONFIG_PACKAGE_nano=y\n" >> .config printf "# CONFIG_PACKAGE_urngd is not set\n" >> .config make defconfig # Download new source packages make download # Build make -j$(nproc) if [ $? -ne 0 ]; then make -j1 V=s fi