commit 01dd5d62c6c2349fd1ee269fbab9f94d10eecdba Author: Daniel Gröber Date: Mon Jun 6 01:39:25 2016 +0200 Initial diff --git a/doc-ap-reinstall.txt b/doc-ap-reinstall.txt new file mode 100644 index 0000000..81ea13f --- /dev/null +++ b/doc-ap-reinstall.txt @@ -0,0 +1,684 @@ +# Reinstall guide for Openwrt based APs (TL-WR841N/ND) +# ==================================================== + +alias $=true # make sure this file is a valid shell script + +$ wget https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64.tar.bz2 + +$ tar -xf OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64.tar.bz2 + +$ cd OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64/ + +$ sh /doc-ap-reinstall.txt # yes, seriously + +$ make image PROFILE=TLWR841 FILES=files/ PACKAGES="collectd collectd-mod-wireless collectd-mod-interface collectd-mod-load collectd-mod-network -firewall -ip6tables -kmod-ip6tables" + +# Now you should get the binary for flashing at: +# bin/ar71xx/openwrt-ar71xx-generic-tl-wr841n-v10-squashfs-sysupgrade.bin + +# If your ssh key is in the config you can now connect to any LAN port (orange) +# on the AP, trigger a failsafe reset, scp the image into /tmp and flash the AP (see below). +# If it's not just add it to files/etc/dropbear/authorized_keys before running make + +# 1) trigger factory reset (deletes /dev/mtdblock3, i.e. /overlay): +$ firstboot -y +# type 'y' and ENTER +$ reboot -f + +# 2) wait for the router to come back up, do the failsafe mode dance again +# finally and copy the image there: + +$ scp bin/ar71xx/openwrt-ar71xx-generic-tl-wr841n-v10-squashfs-sysupgrade.bin root@192.168.1.1:/tmp + +# 3) finally flash the AP: +$ sysupgrade openwrt-*.bin + +# now connect the WAN port (blue) to the correct patch port and make sure this +# is connected to VLAN 2 on SW0 (ports 29,30,31,32,33,34 are for now) + +# WTF? + +# /bin/sh ignores lines that start with '#' and the 'alias' above makes sure '$' +# is not a command that exists, so everything in this file is ignored up the the +# shar(1) archive, neat huh? + +# ---- shar archive follows ---- +#!/bin/sh +# This is a shell archive (produced by GNU sharutils 4.15.2). +# To extract the files from this archive, save it to some FILE, remove +# everything before the '#!/bin/sh' line above, then type 'sh FILE'. +# +lock_dir=_sh06036 +# Made on 2016-06-06 01:42 CEST by . +# Source directory was '/home/dxld/var/build/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64'. +# +# Existing files will *not* be overwritten, unless '-c' is specified. +# +# This shar contains: +# length mode name +# ------ ---------- ------------------------------------------ +# 611 -rw------- files/etc/collectd.conf +# 286 -rw-r--r-- files/etc/config/dhcp +# 136 -rw-r--r-- files/etc/config/dropbear +# 105 -rw-r--r-- files/etc/config/firewall +# 630 -rw-r--r-- files/etc/config/network +# 1063 -rw-r--r-- files/etc/config/system +# 0 -rw-r--r-- files/etc/config/ubootenv +# 325 -rw-r--r-- files/etc/config/wireless +# 390 -rw-r--r-- files/etc/dropbear/authorized_keys +# 503 -rwxr-xr-x files/etc/uci-defaults/50-config-from-mac +# +MD5SUM=${MD5SUM-md5sum} +f=`${MD5SUM} --version | egrep '^md5sum .*(core|text)utils'` +test -n "${f}" && md5check=true || md5check=false +${md5check} || \ + echo 'Note: not verifying md5sums. Consider installing GNU coreutils.' +if test "X$1" = "X-c" +then keep_file='' +else keep_file=true +fi +echo=echo +save_IFS="${IFS}" +IFS="${IFS}:" +gettext_dir= +locale_dir= +set_echo=false + +for dir in $PATH +do + if test -f $dir/gettext \ + && ($dir/gettext --version >/dev/null 2>&1) + then + case `$dir/gettext --version 2>&1 | sed 1q` in + *GNU*) gettext_dir=$dir + set_echo=true + break ;; + esac + fi +done + +if ${set_echo} +then + set_echo=false + for dir in $PATH + do + if test -f $dir/shar \ + && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) + then + locale_dir=`$dir/shar --print-text-domain-dir` + set_echo=true + break + fi + done + + if ${set_echo} + then + TEXTDOMAINDIR=$locale_dir + export TEXTDOMAINDIR + TEXTDOMAIN=sharutils + export TEXTDOMAIN + echo="$gettext_dir/gettext -s" + fi +fi +IFS="$save_IFS" +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null +then if (echo -n test; echo 1,2,3) | grep n >/dev/null + then shar_n= shar_c=' +' + else shar_n=-n shar_c= ; fi +else shar_n= shar_c='\c' ; fi +f=shar-touch.$$ +st1=200112312359.59 +st2=123123592001.59 +st2tr=123123592001.5 # old SysV 14-char limit +st3=1231235901 + +if touch -am -t ${st1} ${f} >/dev/null 2>&1 && \ + test ! -f ${st1} && test -f ${f}; then + shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' + +elif touch -am ${st2} ${f} >/dev/null 2>&1 && \ + test ! -f ${st2} && test ! -f ${st2tr} && test -f ${f}; then + shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' + +elif touch -am ${st3} ${f} >/dev/null 2>&1 && \ + test ! -f ${st3} && test -f ${f}; then + shar_touch='touch -am $3$4$5$6$2 "$8"' + +else + shar_touch=: + echo + ${echo} 'WARNING: not restoring timestamps. Consider getting and +installing GNU '\''touch'\'', distributed in GNU coreutils...' + echo +fi +rm -f ${st1} ${st2} ${st2tr} ${st3} ${f} +# +if test ! -d ${lock_dir} ; then : +else ${echo} "lock directory ${lock_dir} exists" + exit 1 +fi +if mkdir ${lock_dir} +then ${echo} "x - created lock directory ${lock_dir}." +else ${echo} "x - failed to create lock directory ${lock_dir}." + exit 1 +fi +# ============= files/etc/collectd.conf ============== +if test ! -d 'files'; then + mkdir 'files' +if test $? -eq 0 +then ${echo} "x - created directory files." +else ${echo} "x - failed to create directory files." + exit 1 +fi +fi +if test ! -d 'files/etc'; then + mkdir 'files/etc' +if test $? -eq 0 +then ${echo} "x - created directory files/etc." +else ${echo} "x - failed to create directory files/etc." + exit 1 +fi +fi +if test -n "${keep_file}" && test -f 'files/etc/collectd.conf' +then +${echo} "x - SKIPPING files/etc/collectd.conf (file already exists)" + +else +${echo} "x - extracting files/etc/collectd.conf (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/collectd.conf' && +# Config file for collectd. More info: https://collectd.org/ +# Note: Luci statistics will generate a new config and overwrite this file. +X +#Hostname "localhost" +#FQDNLookup true +BaseDir "/var/run/collectd" +Include "/etc/collectd/conf.d" +PIDFile "/var/run/collectd.pid" +PluginDir "/usr/lib/collectd" +TypesDB "/usr/share/collectd/types.db" +Interval 30 +ReadThreads 2 +X +LoadPlugin interface +LoadPlugin load +#LoadPlugin ping +X + +X IgnoreSelected false +X Interface "lan"" + +X +LoadPlugin network + +X Server "sozial.asozial" "25826" +X Forward false + +X +X +LoadPlugin wireless +SHAR_EOF + (set 20 16 03 14 20 20 43 'files/etc/collectd.conf' + eval "${shar_touch}") && \ + chmod 0600 'files/etc/collectd.conf' +if test $? -ne 0 +then ${echo} "restore of files/etc/collectd.conf failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/collectd.conf': 'MD5 check failed' + ) << \SHAR_EOF +317af4e906f9877fb3942b2c969ec6f8 files/etc/collectd.conf +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/collectd.conf'` -ne 611 && \ + ${echo} "restoration warning: size of 'files/etc/collectd.conf' is not 611" + fi +fi +# ============= files/etc/config/dhcp ============== +if test ! -d 'files/etc'; then + mkdir 'files/etc' +if test $? -eq 0 +then ${echo} "x - created directory files/etc." +else ${echo} "x - failed to create directory files/etc." + exit 1 +fi +fi +if test ! -d 'files/etc/config'; then + mkdir 'files/etc/config' +if test $? -eq 0 +then ${echo} "x - created directory files/etc/config." +else ${echo} "x - failed to create directory files/etc/config." + exit 1 +fi +fi +if test -n "${keep_file}" && test -f 'files/etc/config/dhcp' +then +${echo} "x - SKIPPING files/etc/config/dhcp (file already exists)" + +else +${echo} "x - extracting files/etc/config/dhcp (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/config/dhcp' && +X +config dnsmasq +X option listen 0 +X +config dhcp 'lan' +X option interface 'lan' +X option ignore 1 +X +config dhcp 'wan' +X option interface 'wan' +X option ignore '1' +X +config odhcpd 'odhcpd' +X option maindhcp '0' +X option leasefile '/tmp/hosts/odhcpd' +X option leasetrigger '/usr/sbin/odhcpd-update' +X +SHAR_EOF + (set 20 16 02 18 23 07 05 'files/etc/config/dhcp' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/config/dhcp' +if test $? -ne 0 +then ${echo} "restore of files/etc/config/dhcp failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/config/dhcp': 'MD5 check failed' + ) << \SHAR_EOF +14380207dcdfc80dcf7ad0f874385a4f files/etc/config/dhcp +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/config/dhcp'` -ne 286 && \ + ${echo} "restoration warning: size of 'files/etc/config/dhcp' is not 286" + fi +fi +# ============= files/etc/config/dropbear ============== +if test ! -d 'files/etc/config'; then + mkdir 'files/etc/config' +if test $? -eq 0 +then ${echo} "x - created directory files/etc/config." +else ${echo} "x - failed to create directory files/etc/config." + exit 1 +fi +fi +if test -n "${keep_file}" && test -f 'files/etc/config/dropbear' +then +${echo} "x - SKIPPING files/etc/config/dropbear (file already exists)" + +else +${echo} "x - extracting files/etc/config/dropbear (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/config/dropbear' && +config dropbear +X option PasswordAuth 'off' +X option RootPasswordAuth 'off' +X option Port '22' +# option BannerFile '/etc/banner' +SHAR_EOF + (set 20 16 02 19 01 22 09 'files/etc/config/dropbear' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/config/dropbear' +if test $? -ne 0 +then ${echo} "restore of files/etc/config/dropbear failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/config/dropbear': 'MD5 check failed' + ) << \SHAR_EOF +4e428f3d36b40c3de857bf73d3bc27ce files/etc/config/dropbear +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/config/dropbear'` -ne 136 && \ + ${echo} "restoration warning: size of 'files/etc/config/dropbear' is not 136" + fi +fi +# ============= files/etc/config/firewall ============== +if test -n "${keep_file}" && test -f 'files/etc/config/firewall' +then +${echo} "x - SKIPPING files/etc/config/firewall (file already exists)" + +else +${echo} "x - extracting files/etc/config/firewall (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/config/firewall' && +config defaults +X option syn_flood 1 +X option input ACCEPT +X option output ACCEPT +X option forward ACCEPT +SHAR_EOF + (set 20 16 03 14 20 19 47 'files/etc/config/firewall' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/config/firewall' +if test $? -ne 0 +then ${echo} "restore of files/etc/config/firewall failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/config/firewall': 'MD5 check failed' + ) << \SHAR_EOF +3aca9392cad163a47cd8ed892ad1fbee files/etc/config/firewall +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/config/firewall'` -ne 105 && \ + ${echo} "restoration warning: size of 'files/etc/config/firewall' is not 105" + fi +fi +# ============= files/etc/config/network ============== +if test -n "${keep_file}" && test -f 'files/etc/config/network' +then +${echo} "x - SKIPPING files/etc/config/network (file already exists)" + +else +${echo} "x - extracting files/etc/config/network (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/config/network' && +X +config interface 'loopback' +X option ifname 'lo' +X option proto 'static' +X option ipaddr '127.0.0.1' +X option netmask '255.0.0.0' +X +config interface 'apctl' +X option ifname 'eth1.2' +X option proto 'dhcp' +X +config interface 'lan' +X option type 'bridge' +X option ifname 'eth1' +X option proto 'static' +X +config interface 'recovery' +X option type 'bridge' +X option ifname 'eth0' +X option proto 'static' +X option ipaddr '192.168.1.1' +X option netmask '255.0.0.0' +X +X +config switch +X option name 'switch0' +X option reset '1' +X option enable '1' +X option enable_vlan '1' +X +config switch_vlan +X option device 'switch0' +X option vlan '1' +X option ports '1 2 3 4 0' +SHAR_EOF + (set 20 16 03 14 20 26 56 'files/etc/config/network' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/config/network' +if test $? -ne 0 +then ${echo} "restore of files/etc/config/network failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/config/network': 'MD5 check failed' + ) << \SHAR_EOF +e953d88ed06acffbef2e9086fa727fd7 files/etc/config/network +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/config/network'` -ne 630 && \ + ${echo} "restoration warning: size of 'files/etc/config/network' is not 630" + fi +fi +# ============= files/etc/config/system ============== +if test -n "${keep_file}" && test -f 'files/etc/config/system' +then +${echo} "x - SKIPPING files/etc/config/system (file already exists)" + +else +${echo} "x - extracting files/etc/config/system (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/config/system' && +X +config system +X option hostname 'ITS-AP-unassigned' +X option timezone 'UTC' +X +config timeserver 'ntp' +X list server '0.openwrt.pool.ntp.org' +X list server '1.openwrt.pool.ntp.org' +X list server '2.openwrt.pool.ntp.org' +X list server '3.openwrt.pool.ntp.org' +X option enabled '1' +X option enable_server '0' +X +config led 'led_wan' +X option name 'WAN' +X option sysfs 'tp-link:green:wan' +X option trigger 'netdev' +X option mode 'link tx rx' +X option dev 'eth1' +X +config led 'led_lan1' +X option name 'LAN1' +X option sysfs 'tp-link:green:lan1' +X option trigger 'switch0' +X option port_mask '0x10' +X +config led 'led_lan2' +X option name 'LAN2' +X option sysfs 'tp-link:green:lan2' +X option trigger 'switch0' +X option port_mask '0x08' +X +config led 'led_lan3' +X option name 'LAN3' +X option sysfs 'tp-link:green:lan3' +X option trigger 'switch0' +X option port_mask '0x04' +X +config led 'led_lan4' +X option name 'LAN4' +X option sysfs 'tp-link:green:lan4' +X option trigger 'switch0' +X option port_mask '0x02' +X +config led 'led_wlan' +X option name 'WLAN' +X option sysfs 'tp-link:green:wlan' +X option trigger 'phy0tpt' +SHAR_EOF + (set 20 16 03 14 17 41 57 'files/etc/config/system' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/config/system' +if test $? -ne 0 +then ${echo} "restore of files/etc/config/system failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/config/system': 'MD5 check failed' + ) << \SHAR_EOF +9473b26be0e31d238df7fb716f2b4964 files/etc/config/system +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/config/system'` -ne 1063 && \ + ${echo} "restoration warning: size of 'files/etc/config/system' is not 1063" + fi +fi +# ============= files/etc/config/ubootenv ============== +if test -n "${keep_file}" && test -f 'files/etc/config/ubootenv' +then +${echo} "x - SKIPPING files/etc/config/ubootenv (file already exists)" + +else +${echo} "x - extracting files/etc/config/ubootenv (empty)" + > 'files/etc/config/ubootenv' && + (set 20 16 02 07 15 30 04 'files/etc/config/ubootenv' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/config/ubootenv' +if test $? -ne 0 +then ${echo} "restore of files/etc/config/ubootenv failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/config/ubootenv': 'MD5 check failed' + ) << \SHAR_EOF +d41d8cd98f00b204e9800998ecf8427e files/etc/config/ubootenv +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/config/ubootenv'` -ne 0 && \ + ${echo} "restoration warning: size of 'files/etc/config/ubootenv' is not 0" + fi +fi +# ============= files/etc/config/wireless ============== +if test -n "${keep_file}" && test -f 'files/etc/config/wireless' +then +${echo} "x - SKIPPING files/etc/config/wireless (file already exists)" + +else +${echo} "x - extracting files/etc/config/wireless (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/config/wireless' && +config wifi-device radio0 +X option type mac80211 +X option channel 11 +X option hwmode 11g +X option path 'platform/qca953x_wmac' +X option htmode HT20 +X +config wifi-iface +X option device radio0 +X option network lan +X option mode ap +X option ssid it-syndikat +X option encryption psk2 +X option key '' +SHAR_EOF + (set 20 16 06 06 01 41 58 'files/etc/config/wireless' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/config/wireless' +if test $? -ne 0 +then ${echo} "restore of files/etc/config/wireless failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/config/wireless': 'MD5 check failed' + ) << \SHAR_EOF +06b38e06f26ea56e8a8e5f51a6566ff8 files/etc/config/wireless +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/config/wireless'` -ne 325 && \ + ${echo} "restoration warning: size of 'files/etc/config/wireless' is not 325" + fi +fi +# ============= files/etc/dropbear/authorized_keys ============== +if test ! -d 'files/etc/dropbear'; then + mkdir 'files/etc/dropbear' +if test $? -eq 0 +then ${echo} "x - created directory files/etc/dropbear." +else ${echo} "x - failed to create directory files/etc/dropbear." + exit 1 +fi +fi +if test -n "${keep_file}" && test -f 'files/etc/dropbear/authorized_keys' +then +${echo} "x - SKIPPING files/etc/dropbear/authorized_keys (file already exists)" + +else +${echo} "x - extracting files/etc/dropbear/authorized_keys (text)" + sed 's/^X//' << 'SHAR_EOF' | uudecode && +begin 600 files/etc/dropbear/authorized_keys +MF%#,7EC,D5!04%!1$%104)!04%"05%#,41B=VMS +M>75-,FE652]M4U-18CAF8U14,W-M3T1Y96%Z=%!V<&8Q94\T.61N-$UE8T%C +M534X>G$R9S1$2W5M0S5Q,6)#&%D-$UR-&EX=3!(83A6;S1#3$-F1'AC07A::%EU;$%X;E!D,G4UV>$]Z,5)R>C%4=4\X.79M +M+U9L,5`K:TE&4W1O0G-%955(."M9<75)4'50<6=Q,V0V2"MI538X3DYT8G!9 +M07=-2E,S,'5M-'5H=2]X3R]62&-L0V%F<4]U47994FMJ0DI!4DY0;4UL+T15 +>8VET:$Y#5S)!=D1C=$IS6G!",6P@9'AL9$!%;&D* +` +end +SHAR_EOF + (set 20 16 02 19 01 22 39 'files/etc/dropbear/authorized_keys' + eval "${shar_touch}") && \ + chmod 0644 'files/etc/dropbear/authorized_keys' +if test $? -ne 0 +then ${echo} "restore of files/etc/dropbear/authorized_keys failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/dropbear/authorized_keys': 'MD5 check failed' + ) << \SHAR_EOF +9641a516022df2dc59a071c9d16be7aa files/etc/dropbear/authorized_keys +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/dropbear/authorized_keys'` -ne 390 && \ + ${echo} "restoration warning: size of 'files/etc/dropbear/authorized_keys' is not 390" + fi +fi +# ============= files/etc/uci-defaults/50-config-from-mac ============== +if test ! -d 'files/etc/uci-defaults'; then + mkdir 'files/etc/uci-defaults' +if test $? -eq 0 +then ${echo} "x - created directory files/etc/uci-defaults." +else ${echo} "x - failed to create directory files/etc/uci-defaults." + exit 1 +fi +fi +if test -n "${keep_file}" && test -f 'files/etc/uci-defaults/50-config-from-mac' +then +${echo} "x - SKIPPING files/etc/uci-defaults/50-config-from-mac (file already exists)" + +else +${echo} "x - extracting files/etc/uci-defaults/50-config-from-mac (text)" + sed 's/^X//' << 'SHAR_EOF' > 'files/etc/uci-defaults/50-config-from-mac' && +#!/bin/sh +set -e +X +mac=$(cat /sys/class/net/eth1/address) +X +hostname= +channel= +if [ "$mac" = 60:e3:27:b8:16:ed ]; then +X hostname=cz-ap0 +X channel=6 +elif [ "$mac" = 60:e3:27:b8:09:db ]; then +X hostname=cz-ap1 +X channel=12 +elif [ "$mac" = 60:e3:27:ed:9b:b1 ]; then +X hostname=cz-ap2 +X channel=1 +fi +X +uci set system.@system[0].hostname=$hostname +uci commit system +uci set wireless.radio0.channel=$channel +uci commit wireless +echo $(uci get system.@system[0].hostname) > /proc/sys/kernel/hostname +SHAR_EOF + (set 20 16 03 20 16 53 15 'files/etc/uci-defaults/50-config-from-mac' + eval "${shar_touch}") && \ + chmod 0755 'files/etc/uci-defaults/50-config-from-mac' +if test $? -ne 0 +then ${echo} "restore of files/etc/uci-defaults/50-config-from-mac failed" +fi + if ${md5check} + then ( + ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'files/etc/uci-defaults/50-config-from-mac': 'MD5 check failed' + ) << \SHAR_EOF +689a299be8256d569a668704a26d27c3 files/etc/uci-defaults/50-config-from-mac +SHAR_EOF + +else +test `LC_ALL=C wc -c < 'files/etc/uci-defaults/50-config-from-mac'` -ne 503 && \ + ${echo} "restoration warning: size of 'files/etc/uci-defaults/50-config-from-mac' is not 503" + fi +fi +if rm -fr ${lock_dir} +then ${echo} "x - removed lock directory ${lock_dir}." +else ${echo} "x - failed to remove lock directory ${lock_dir}." + exit 1 +fi +exit 0 diff --git a/doc-ap-reset.txt b/doc-ap-reset.txt new file mode 100644 index 0000000..0d1b9fb --- /dev/null +++ b/doc-ap-reset.txt @@ -0,0 +1,2 @@ +Hold reset button for ~25+ sec. LED goes off then starts flashing fast if you +hold it too long it will start flashing slowly and that's no good. diff --git a/private/FGRR-QRN3.key b/private/FGRR-QRN3.key new file mode 120000 index 0000000..5cee835 --- /dev/null +++ b/private/FGRR-QRN3.key @@ -0,0 +1 @@ +../.git/annex/objects/3M/8M/SHA256E-s184--43e7e49d6e92f833d6e4250a44921943f6f16936f277fabf58b7bbb68c8d4bf4.key/SHA256E-s184--43e7e49d6e92f833d6e4250a44921943f6f16936f277fabf58b7bbb68c8d4bf4.key \ No newline at end of file diff --git a/private/backup-CZ-AP0-2016-02-18.tar.gz b/private/backup-CZ-AP0-2016-02-18.tar.gz new file mode 120000 index 0000000..eb972dc --- /dev/null +++ b/private/backup-CZ-AP0-2016-02-18.tar.gz @@ -0,0 +1 @@ +../.git/annex/objects/1j/Gw/SHA256E-s8920--298c554e3422ac36c5fd60d6ddd7730da6129df0d0fa4b28c1da926caa85e90d.tar.gz/SHA256E-s8920--298c554e3422ac36c5fd60d6ddd7730da6129df0d0fa4b28c1da926caa85e90d.tar.gz \ No newline at end of file diff --git a/private/backup-sozial-2016-02-18.tar.gz b/private/backup-sozial-2016-02-18.tar.gz new file mode 120000 index 0000000..b77c45f --- /dev/null +++ b/private/backup-sozial-2016-02-18.tar.gz @@ -0,0 +1 @@ +../.git/annex/objects/5K/6W/SHA256E-s10462--1e3ecf3f8e052c4295fdb19314d67be2d2beea592ce960f540ac4d3cd714382c.tar.gz/SHA256E-s10462--1e3ecf3f8e052c4295fdb19314d67be2d2beea592ce960f540ac4d3cd714382c.tar.gz \ No newline at end of file diff --git a/private/backup-sozial-2016-03-14.tar.gz b/private/backup-sozial-2016-03-14.tar.gz new file mode 120000 index 0000000..f4d94b2 --- /dev/null +++ b/private/backup-sozial-2016-03-14.tar.gz @@ -0,0 +1 @@ +../.git/annex/objects/F6/mz/SHA256E-s17185--f706b8b80b9721ee8b73fa5b53203b1daac6e7f820d9b2bbf8802689c213627d.tar.gz/SHA256E-s17185--f706b8b80b9721ee8b73fa5b53203b1daac6e7f820d9b2bbf8802689c213627d.tar.gz \ No newline at end of file diff --git a/private/backup-sozial-2016-06-05.tar.gz b/private/backup-sozial-2016-06-05.tar.gz new file mode 120000 index 0000000..19d5229 --- /dev/null +++ b/private/backup-sozial-2016-06-05.tar.gz @@ -0,0 +1 @@ +../.git/annex/objects/mW/M1/SHA256E-s17367--ef5f0d5d7f4b8ea897a2e44f9cf268e195e8d94b15e58ec2be47607046a3d961.tar.gz/SHA256E-s17367--ef5f0d5d7f4b8ea897a2e44f9cf268e195e8d94b15e58ec2be47607046a3d961.tar.gz \ No newline at end of file diff --git a/sozial/doc-reinstall.txt b/sozial/doc-reinstall.txt new file mode 100644 index 0000000..f438550 --- /dev/null +++ b/sozial/doc-reinstall.txt @@ -0,0 +1,59 @@ +# sozial.asozial install guide + +Sozial.asozial is a FW8888 (Intel Atom x86) machine with 6 network interfaces, +eth0 throu eth5 where eth5 is a fiber slot so we're not going to use it for now. + +## Port-eth mapping + +Just works in OpenWRT! They sort the ethX names by MAC like they should :) + +eth0: Port 1 +eth1: Port 2 +eth2: Port 3 +eth3: Port 4 +eth4: Port 5 + +If in doubt: + +$ ethtool -p ethX + +This will blink the status leds on ethX so you can identify it visually. + +## Port Function Assignment + +eth0: Broken causes timeouts and adapter resets occationally +eth1: Broken --''-- +eth2: --free-- +eth3: Uplink SW0, Freifunk +eth3.2: AP Management Plane VLAN (APCTL) +eth4: --free-- + +## Installed stuff + + - kmod-usb-hid + Absolutely essential. No keyboard for VGA console otherwise! + + - collectd - 5.4.2-1 + Statistics collection from APs. + + - collectd-mod-interface - 5.4.2-1 + - collectd-mod-iptables - 5.4.2-1 + - collectd-mod-iwinfo - 5.4.2-1 + - collectd-mod-load - 5.4.2-1 + - collectd-mod-network - 5.4.2-1 + - collectd-mod-ping - 5.4.2-1 + - collectd-mod-rrdtool - 5.4.2-1 + - collectd-mod-wireless + + - sqm-scripts - 1.0.3-1 + For rate limiting and (de)bufferbloat optimization on WAN + + - ip-full - 4.0.0-1 + It's just nice to have. + + - tcpdump + Well you know. + +To install use `opkg update && opkg install `. You need to run +`opkg update` since openwrt stores package lists in RAM so by the time you need +them they're likely not there. diff --git a/sozial/eth0-crash.log b/sozial/eth0-crash.log new file mode 100644 index 0000000..537bf9c --- /dev/null +++ b/sozial/eth0-crash.log @@ -0,0 +1,32 @@ +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.010035] ------------[ cut here ]------------ +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.032627] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:303 0xc138576b() +Mon Mar 14 23:00:55 2016 kern.info kernel: [ 814.063157] NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.091381] Modules linked in: pppoe ppp_async iptable_nat pppox ppp_generic nf_nat_ipv6 nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_id xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT via_velocity via_rhine usbhid slhc sis900 r8169 pcnet32 nf_reject_ipv4 nf_nat_masquerade_ipv4 nf_nat_ftp nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrackMon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.464766] CPU: 0 PID: 0 Comm: swapper Not tainted 3.18.20 #1 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.492993] Hardware name: PhoenixAward 945GSE/945GSE, BIOS 6.00 PG 08/25/2009 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.525431] c140194e c1030133 c14d7964 df40bf54 00000000 c14d54de 0000012f c138576b +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.559901] 00000009 df5cc000 df680780 ffff392b ffffff32 c1030183 00000009 df40bf3c +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.594465] c14d7964 df40bf54 c138576b c14d54de 0000012f c14d7964 df5cc000 e08de401 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.628997] Call Trace: +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.647116] [] ? 0xc140194e +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.669092] [] ? 0xc1030133 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.690998] [] ? 0xc138576b +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.712747] [] ? 0xc1030183 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.734379] [] ? 0xc138576b +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.755921] [] ? 0xc1385660 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.777369] [] ? 0xc1053d41 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.798769] [] ? 0xe0de69d7 [e1000e@e0dd0000+0x1dce4] +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.827004] [] ? 0xc1053f4e +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.848381] [] ? 0xc1031ef5 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.869588] [] ? 0xc1031e60 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.890599] [] ? 0xc10033f9 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.911499] [] ? 0xc103214e +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.934411] [] ? 0xc100322d +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.955361] [] ? 0xc1058417 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.976194] [] ? 0xc1405b69 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 814.996993] [] ? 0xc1050000 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 815.017673] [] ? 0xc134044d +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 815.038232] [] ? 0xc104a595 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 815.058685] [] ? 0xc1547a87 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 815.079028] [] ? 0xc1547560 +Mon Mar 14 23:00:55 2016 kern.warn kernel: [ 815.099175] ---[ end trace d228a7100660f086 ]--- +Mon Mar 14 23:00:55 2016 kern.err kernel: [ 815.128211] e1000 0000:05:0a.0 eth0: Reset adapter diff --git a/vlan-introduction.tex b/vlan-introduction.tex new file mode 100644 index 0000000..e721189 --- /dev/null +++ b/vlan-introduction.tex @@ -0,0 +1,66 @@ +\documentclass{article} + +\usepackage{bbold} +\usepackage{commath} + +\begin{document} + +\section{VLAN Introduction} + +For those unfamilliar with the concept of a VLAN (Virtual LAN) here is a shot +formal specification of what such a thing does. + +A Switch is a 8-tuple \( \mathcal{S} = (\mathbb{A}, \mathbb{P}, \mathbb{V}, t, v, a, \beta, \epsilon) \) +consisting of +\begin{itemize} +\item a finite set of (MAC) addresses \(\mathbb{A}\), +\item a finite set of physical ports \(\mathbb{P}\), +\item a finite set of VLANs \(\mathbb{V}\), +\item a mapping from physical ports and VLANs to two distinct symbols pronounced + ``tagged'' and ``untagged'' repectively + \( t : \mathbb{P} \times \mathbb{V} \rightarrow \{ \tau, \upsilon \} \), +\item a mapping from physical ports and VLANs to VLANs (Port PVID) + \( v : \mathbb{P} \times \mathbb{V} \rightarrow \mathbb{V} \) + with \(v(p, q) \mapsto q\) when \(q \neq \epsilon\), +\item a mapping from addresses and VLANs to physical ports (ARP Table) + \( a : \mathbb{A} \times \mathbb{V} \rightarrow \mathbb{P} \) and +\item the broadcast address \(\beta \in \mathbb{A}\) +\item the empty VLAN tag \(\epsilon \in \mathbb{V}\) +\end{itemize} + +A Frame processed by a Switch \(\mathcal{S}\) +is a tuple \( \mathcal{F}_\mathcal{S} = (d, q) \) +consisting of a destination address \(d \in \mathbb{A} \) and a VLAN tag \( q \in \mathbb{V} \). + +When a Frame \( \mathcal{F}_\mathcal{S}' = (d, q') \) +enters a port \( p \in \mathbb{P}\) +the Switch first ensures the Packet has a VLAN tag for internal processing +assigned by creating a new Frame \( \mathcal{F}_\mathcal{S} = (d, q)\) with \(q = v(p, q')\). + +\subsection{Broadcast processing} + +When the Frame's destination address \( d = \beta \) +the Switch creates a new Frame for each port +\( p \in \{\, p \mid t(p, \_) \,\} \) +in the following manner: + +\begin{equation}\label{eq:egress} +\mathcal{F}_{\mathcal{S}, p}^{e} = +\left\{ + \begin{array}{ll} + (d,q) & \mbox{if } t(p, q) = \tau \\ + (d, \epsilon) & \mbox{if } t(p, q) = \upsilon\\ + \end{array} +\right. +\end{equation} + + +\( \mathcal{F}_{\mathcal{S}, p}^{e} \) +is then transmitted out port \(p\) and processing of this Frame is complete. + +\subsection{Unicast processing} + +When the Frame's destination address \(d\) is not the broadcast address the Switch first determines the egress port \(p = a(d, q)\). Then a new Frame is created as in equation \ref{eq:egress}. \( \mathcal{F}_{\mathcal{S}, p}^{e} \) +is then transmitted out port \(p\) and processing of this Frame is complete. + +\end{document}