Replicating my build from scratch:
Master:
git clone -b kernel5.15-nss-qsdk11 https://github.com/ACwifidude/openwrt.git
Openwrt 23.05:
git clone -b openwrt-23.05-nss-qsdk11 https://github.com/ACwifidude/openwrt.git
Openwrt 22.03:
git clone -b openwrt-22.03-nss-qsdk10.0 https://github.com/ACwifidude/openwrt.git
If you are building for one type of router you can change the first section of the diffconfig on github to just one device if you are building for a particular model (delete all the routers you don’t want to build for, follow the instructions below after the # sign):
# delete the “multi profile” line
# delete the line ending in ""
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_PACKAGES_ipq806x_generic_DEVICE_netgear_r7800=""
My diffconfig file is set up for ath10k-ct driver/firmware. If you want to use ath10k driver/firmware instead - use the diffconfig-ath10k file.
When your diffconfig is to your liking - this is how to prep and build (I have a 4 CPU system, change the last line to the number of CPUs in your system):
./scripts/feeds update -a && ./scripts/feeds install -a && cp diffconfig .config && make defconfig && ./scripts/getver.sh
make -j5
Rebasing with Master, OpenWrt 23.05, or OpenWrt 22.03 (make sure you are in the openwrt folder, rebase with the latest updates - then you can build as per above)
#Remove “rebase” commit (this gives you a clean build environment - it deletes the final bin content and diffconfig files, I’d copy the diffconfig to a separate folder before running this command)
git reset --hard HEAD~1
git remote add upstream https://git.openwrt.org/openwrt/openwrt.git
#Master Rebase:
git fetch upstream && git rebase upstream/master
#OpenWrt 23.05 Rebase:
git fetch upstream && git rebase upstream/openwrt-23.05
#OpenWrt 22.03 Rebase:
git fetch upstream && git rebase upstream/openwrt-22.03
If you need further help the OpenWrt wiki is well written and has further build system usage instructions:
Recommended configuration (build is the master defaults (CPU has been further optimized as per below), you’ll have to do all the rest yourself):
- Firewall Software & Hardware offloading disabled
- Use the default performance CPU governor (this is the build default)
Optionally you can use on demand settings (some report less stability):
echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 600000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
This is how to switch back to the build defaults:
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor; echo performance > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
- Irqbalance disabled, packet steering disabled
uci set irqbalance.irqbalance.enabled=0; uci set network.globals.packet_steering=0; uci commit
- Custom NSS fq_codel startup script if SQM is desired (below is set to 900/900). Recommend setting to 5% below your ISP provided speed and then adjusting from there as per your testing. Maximum is ~900Mbit.
modprobe nss-ifb
ip link set up nssifb
# Shape ingress traffic to 900 Mbit with chained NSSFQ_CODEL
tc qdisc add dev nssifb root handle 1: nsstbl rate 900Mbit burst 1Mb
tc qdisc add dev nssifb parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default
# Shape egress traffic to 900 Mbit with chained NSSFQ_CODEL
tc qdisc add dev eth0 root handle 1: nsstbl rate 900Mbit burst 1Mb
tc qdisc add dev eth0 parent 1: handle 10: nssfq_codel limit 10240 flows 1024 quantum 1514 target 5ms interval 100ms set_default
- 802.11v,k enabled on 5ghz radio for setups with multiple APs (change to your timezone)
wireless settings
uci set wireless.default_radio0.ieee80211v=1; uci set wireless.default_radio0.ieee80211k=1; uci set wireless.default_radio0.bss_transition=1; uci set wireless.default_radio0.wnm_sleep_mode=1; uci set wireless.default_radio0.time_advertisement=2; uci set wireless.default_radio0.time_zone=CST6CDT,M3.2.0,M11.1.0; uci commit
- Make custom DNS internal sites work (if you have custom sites):
ifconfig br-lan promisc
turn custom internal sites off:
ifconfig br-lan -promisc
- kmods don’t install like normal on this build. If you want a custom set of kmods the best solution is to build from scratch (see above). Here is the full listing of packages that are built when I build:
MasterNSS builds:
https://github.com/ACwifidude/openwrt/tree/kernel5.15-nss-qsdk11bin/targets/ipq806x/generic/packages-MasterNSS
MasterNSS-ath10k builds:
Example install of a package (doesn't always work)-
opkg install https://github.com/ACwifidude/openwrt/raw/kernel5.15-nss-qsdk11bin/targets/ipq806x/generic/packages-MasterNSS/kmod-bluetooth_5.10.107-1_arm_cortex-a15_neon-vfpv4.ipk
- Want Ath10k instead of Ath10k-ct?
Load the ath10k version to get both the driver and firmware. If you want to just change the firmware you can switch like this:
opkg update && opkg remove ath10k-firmware-qca9984-ct && opkg install ath10k-firmware-qca9984
- Looking for more of a minimalist / no frills build with the minimum active services running?
Add this script to your startup script on your router to disable “extra” services:
# these services do not run on the router
for i in adblock openvpn sqm; do
if /etc/init.d/"$i" enabled; then
/etc/init.d/"$i" disable
/etc/init.d/"$i" stop
fi
done