first commit

This commit is contained in:
jeka
2023-12-09 14:42:54 +05:00
parent 9466633fb0
commit b7cdc29448
9 changed files with 32 additions and 192 deletions

32
configs/archer-c6-v3 Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/sh
# Archer C7 v2 configuration for openwrt-image-buildomatic
# Running OpenWRT image builder 18.06 on Ubuntu 20.04 requires at least:
# sudo apt install python2 libncurses5-dev
#RELEASE=${RELEASE_18_06}
#RELEASE=${RELEASE_19_07}
#RELEASE=${RELEASE_21_02}
RELEASE=${RELEASE_23_05}
if [ -z "${RELEASE}" ]; then echo "RELEASE is empty"; return 1; fi
# See targets here: https://downloads.openwrt.org/snapshots/targets
#
# device can be built with one of two TARGETs:
# ar71xx/generic is usable for releases 17.01, 18.06, 19.07
# ath79/generic is usable for releases 19.07, 21.02
if echo "${RELEASE}" | grep -q "18.06"; then
TARGET=ramips/mt7621
PROFILE="tplink_archer-c6-v3"
else
TARGET=ramips/mt7621
PROFILE="tplink_archer-c6-v3"
fi
# This package list works for releases 18.06, 19.07 and 21.02
PACKAGES="luci"
FILES="archer-c6-v3-files"
DISABLED_SERVICES=""

View File

@@ -1,51 +0,0 @@
#!/bin/sh
# Archer C7 v2 configuration for openwrt-image-buildomatic
# Running OpenWRT image builder 18.06 on Ubuntu 20.04 requires at least:
# sudo apt install python2 libncurses5-dev
#RELEASE=${RELEASE_18_06}
#RELEASE=${RELEASE_19_07}
RELEASE=${RELEASE_21_02}
if [ -z "${RELEASE}" ]; then echo "RELEASE is empty"; return 1; fi
# See targets here: https://downloads.openwrt.org/snapshots/targets
#
# device can be built with one of two TARGETs:
# ar71xx/generic is usable for releases 17.01, 18.06, 19.07
# ath79/generic is usable for releases 19.07, 21.02
if echo "${RELEASE}" | grep -q "18.06"; then
TARGET=ar71xx/generic
PROFILE="archer-c7-v2"
else
TARGET=ath79/generic
PROFILE="tplink_archer-c7-v2"
fi
# This package list works for releases 18.06, 19.07 and 21.02
PACKAGES="
luci htop \
"
# List of packages that are typically interesting but aren't being installed
# because I just want a minimal install only with web UI
# (the NOT_INSTALLED variable is completely ignored by the oi-build script)
NOT_INSTALLED="
luci-theme-bootstrap luci-theme-openwrt
luci-app-uhttpd
luci-app-wireguard kmod-wireguard wireguard-tools qrencode
luci-app-fwknopd fwknopd
luci-app-sqm sqm-scripts sqm-scripts-extra
luci-app-statistics
collectd collectd-mod-cpu collectd-mod-irq collectd-mod-thermal
collectd-mod-network collectd-mod-iwinfo collectd-mod-ping
collectd-mod-processes collectd-mod-exec
iptables-mod-geoip
-ip-tiny ip-full
zoneinfo-europe
"
FILES=""
DISABLED_SERVICES=""

View File

@@ -1,61 +0,0 @@
#!/bin/sh
# Raspberry PI 4 configuration for openwrt-image-buildomatic
# Which target CPU to build image for.
# See targets here: https://downloads.openwrt.org/snapshots/targets
TARGET=bcm27xx/bcm2711
# Currently there is only the "rpi-4" build profile for this TARGET
PROFILE="rpi-4"
RELEASE=${RELEASE_22_03}
# Define this if you want a larger file writable system
# The default for RPi4 is 104 (MB)
# Here we set it to 4096 (MB) which is almost 4GB.
# Alas, the larger it is, the longer time it takes to create the image:
# 1GB takes 1m54s, 2GB takes 2m14s, 4GB takes 2m56s
# which amounts to approx 20s extra build time per GB
# You must lower the value if your SD-card is smaller than that (surely not)
CONFIG_TARGET_ROOTFS_PARTSIZE=4096
# See https://openwrt.org/packages/start
#
# - irqbalance package distributes hardware interrupts across
# processors on a multiprocessor system in order to increase performance.
# - bcm27xx-eeprom package provides rpi-eeprom-update, rpi-eeprom-config
# commands for the RPi-4 eeprom
# - netperf installs /usr/bin/netserver and is used by various speedtest scripts
# See https://forum.openwrt.org/t/package-to-run-speed-test-on-router/16016
PACKAGES="
${packages_usb_eth}
${packages_luci_apps}
${packages_usb_storage}
${packages_python}
${packages_lxc}
bcm27xx-eeprom
irqbalance
ethtool
netperf speedtest-netperf iperf3
nmap netdiscover arp-scan arp-scan-database
ss iftop whois
iptables-mod-geoip
igmpproxy
msmtp
-dnsmasq dnsmasq-full
-ip-tiny ip-full
zoneinfo-europe
procps-ng procps-ng-watch procps-ng-pgrep procps-ng-ps procps-ng-top procps-ng-free
curl wget rsync file htop lsof less mc tree usbutils bash diffutils libreadline
strace
openssh-sftp-server
"
# disabled packages
# openssh-server
FILES="rpi-4-files"
DISABLED_SERVICES="\
adblock acme banip bcp38 collectd ddns fwknopd https-dns-proxy \
igmpproxy netserver sqm unbound vpn-policy-routing"

View File

@@ -1,43 +0,0 @@
#!/bin/sh /etc/rc.common
uci_banirq=irqbalance.irqbalance.banirq
cpu_irq_eth=2
move_eth0_irq() {
# Move eth0 IRQs to CPU1 (numbered 1-4 when writing)
# And ban irqbalance from messing with it
# The USB3 Ethernet IRQs cannot be moved and must stay on CPU0
irqs_eth0=$(sed -rn "s/^\s*([0-9]+):.*eth0$/\1/p" /proc/interrupts)
for n in ${irqs_eth0}; do
echo ${cpu_irq_eth} > /proc/irq/${n}/smp_affinity
if ! uci get ${uci_banirq} | grep -q ${n}; then
uci add_list ${uci_banirq}=${n}
fi
done
uci commit irqbalance
logger -t "irq_eth_pin" "Moved eth0 IRQs ${irqs_eth0} to cpu${cpu_irq_eth}"
logger -t "irq_eth_pin" "See all interrupts with: cat /proc/interrupts"
}
move_softirqs() {
# Move softirqs for network traffic to CPU2 and CPU3
# Maybe not a brilliant idea because the softirqs are probably better off
# being processed on the CPU that got the original IRQ
# (and that is exactly the default when the value is 0)
# NOTE: it appears that the openwrt 20.02-rc1 kernel has a bug that
# returns "No such file or directory" for /sys/class/net/eth1/queues/xps_cpus
for ifname in eth0; do # eth1
for f in $(find /sys/class/net/${ifname}/queues -name xps_cpus -o -name rps_cpus); do
if [ -f ${f} ]; then
echo "${f} = $(cat ${f})"
echo c >${f}
fi
done
done
}
start_service() {
move_eth0_irq
}

View File

@@ -1 +0,0 @@
../init.d/irq-eth-pin

View File

@@ -1,5 +0,0 @@
#!/bin/sh
# see https://github.com/openwrt/luci/issues/5073
file=/www/luci-static/resources/view/fwknopd.js
sed -i "s/s:option/s.option/" ${file}

View File

@@ -1,9 +0,0 @@
#!/bin/sh
# add some commonly used aliases
file=/etc/profile
grep -q "alias l" ${file} ||
cat <<EOF >> ${file}
alias l='ls -lF'
alias la='ls -alF'
EOF

View File

@@ -1,11 +0,0 @@
#!/bin/sh
# Read all about UCI defaults at
# https://openwrt.org/docs/guide-developer/uci-defaults
# Note that scripts in /etc/uci-defaults will get executed at *every* first
# boot (i.e. after both factory install as well as upgrades),
# possibly overwriting already existing values!
# scripts in this dir should *not* be executable
exit 0

View File

@@ -1,11 +0,0 @@
#!/bin/sh
# Delete ALL collected statistics and restart luci-statistics and collectd
# Useful after changing RRD config values of /etc/config/luci_statistics
/etc/init.d/luci_statistics stop
/etc/init.d/collectd stop
rm -rf /tmp/collectd.conf /tmp/rrd/*
/etc/init.d/collectd start
/etc/init.d/luci_statistics start