Skip to content
Snippets Groups Projects
Commit 1417588d authored by Stefan Laudemann's avatar Stefan Laudemann
Browse files

Adds the ne package ffpb-node-tuning to ffpb-packages.

As its name states, this packages applies some config optimizations
(like tweaking kernal knobs via sysctl) on the nodes.
For the most knobs Gluon sticks for OpenWRT defaults for good reasons,
as some values need to be set according to the environment of the
nodes (e.g. the network's size). As OpenWRT basically aims at provid-
ing a stable system for standalone WiFi access-points, the system's
default configuration may not be appropriate anymore the larger the
network grows, though.
parent 6596f78f
No related branches found
No related tags found
No related merge requests found
include $(TOPDIR)/rules.mk
PKG_NAME:=ffpb-node-tuning
PKG_VERSION:=1
PKG_RELEASE:=$(GLUON_VERSION).$(GLUON_SITE_CODE)-$(GLUON_RELEASE).$(GLUON_CONFIG_VERSION)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/ffpb-node-tuning
SECTION:=ffpb
CATEGORY:=Gluon
TITLE:=Freifunk Paderborn Node Tuning-Settings
DEPENDS:=+gluon-core +busybox
MAINTAINER:=Freifunk Paderborn <maschinenraum@paderborn.freifunk.net>
URL:=https://git.c3pb.de/freifunk-pb/ffpb-packages
SOURCE:=git@git.c3pb.de:freifunk-pb/ffpb-packages.git
endef
define Package/ffpb-node-tuning/description
As its name states, this packages applies some config optimizations (like
tweaking kernal knobs via sysctl) on the nodes.
For the most knobs Gluon sticks for OpenWRT defaults for good reasons, as
some values need to be set according to the environment of the nodes (e.g.
the network's size). As OpenWRT basically aims at providing a stable system
for standalone WiFi access-points, the system's default configuration may
not be appropriate anymore the larger the network grows, though.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/ffpb-node-tuning/postinst
#!/bin/sh
mkdir -p "$${IPKG_INSTROOT}/lib/gluon/version/"
cd "$${IPKG_INSTROOT}/lib/gluon/version/"
echo $(PKG_VERSION)-$(PKG_RELEASE) > node-tuning
exit 0
endef
define Package/ffpb-node-tuning/install
$(INSTALL_DIR) $(1)/etc/uci-defaults/
$(INSTALL_DIR) $(1)/lib/gluon/upgrade/node-tuning/invariant/
$(INSTALL_BIN) ./files/etc/uci-defaults/zz~-ffpb-upgrade $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files//lib/gluon/upgrade/node-tuning/invariant/010-arp_caches $(1)/lib/gluon/upgrade/node-tuning/invariant/
$(INSTALL_BIN) ./files//lib/gluon/upgrade/node-tuning/invariant/099-apply_settings $(1)/lib/gluon/upgrade/node-tuning/invariant/
endef
$(eval $(call BuildPackage,ffpb-node-tuning))
#!/bin/sh
UPGRADE_DIR=/lib/gluon/upgrade
VERSION_DIR=/lib/gluon/version
version_of() {
opkg status "ffpb-$1" | awk '/^Version: / { print $2 }'
}
oldversion_of() {
cat "$VERSION_DIR"/"$1" 2>/dev/null
}
do_dir() {
[ -d "$1" ] || return
local s
for s in "$1"/*; do "$s"; done
}
do_component() {
local component="$1"
local version="$(version_of "$component")"
[ "$version" ] || return
(
cd "$component"
local oldversion="$(oldversion_of "$component")"
if [ -z "$oldversion" ]; then
do_dir initial
fi
do_dir invariant
cd ..
)
}
cd "$UPGRADE_DIR"
do_component core
for component in *; do
[ "$component" != 'core' ] || continue
do_component "$component"
done
#!/usr/bin/lua
local sysctl = require 'gluon.sysctl'
sysctl.set('net.ipv4.neigh.default.gc_thresh1', 192)
sysctl.set('net.ipv4.neigh.default.gc_thresh2', 640)
sysctl.set('net.ipv4.neigh.default.gc_thresh3', 1280)
sysctl.set('net.ipv6.neigh.default.gc_thresh1', 512)
sysctl.set('net.ipv6.neigh.default.gc_thresh2', 1024)
sysctl.set('net.ipv6.neigh.default.gc_thresh3', 1536)
#!/usr/bin/lua
os.execute('sync; sysctl -qp')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment