diff --git a/build_patches/ar23xx/260_fixdmaoffset.patch b/build_patches/ar231x/260_fixdmaoffset.patch similarity index 100% rename from build_patches/ar23xx/260_fixdmaoffset.patch rename to build_patches/ar231x/260_fixdmaoffset.patch diff --git a/build_script.sh b/build_script.sh index 6ba94e0..1de5ba7 100644 --- a/build_script.sh +++ b/build_script.sh @@ -21,14 +21,18 @@ prepare() { cp ./build_patches/tinc/001_fix_a_few_small_memory_leaks.patch ./build_dir/feeds/packages/net/tinc/patches/001_fix_a_few_small_memory_leaks.patch case "$1" in - "dir300" | "fonera") + "dir300") svn export ./build_patches/ar23xx/260_fixdmaoffset.patch ./build_dir/target/linux/atheros/patches-2.6.30/260_fixdmaoffset.patch svn export ./build_patches/dir300/990_fix_wifi_led.patch ./build_dir/package/mac80211/patches/990_fix_wifi_led.patch - #fix bad switch behaveior: - /bin/rm ./build_dir/target/linux/atheros/base-files/etc/uci-defaults/network + ;; + "fonera") + svn export ./build_patches/ar23xx/260_fixdmaoffset.patch ./build_dir/target/linux/atheros/patches-2.6.30/260_fixdmaoffset.patch ;; esac + #fix bad switch behaveior: + /bin/rm ./build_dir/target/linux/atheros/base-files/etc/uci-defaults/network + } configure_build() { diff --git a/root_file_system/default/etc/rc.local b/root_file_system/default/etc/rc.local index 7d91e63..6f94f81 100755 --- a/root_file_system/default/etc/rc.local +++ b/root_file_system/default/etc/rc.local @@ -3,16 +3,10 @@ # batman seems to be to stupid to regocnice the devices # todo: uci.get .. -batctl if add eth0.3 -batctl if add eth0.4 batctl if add wlan0-1 ifconfig eth0 mtu 1528 -ifconfig eth0.3 mtu 1528 -ifconfig eth0.4 mtu 1528 -echo none > /sys/devices/platform/ar231x-wmac.0/leds/ath5k-phy0\:\:rx/trigger -echo phy0tx > /sys/devices/platform/ar231x-wmac.0/leds/ath5k-phy0\:\:tx/trigger toLower() { echo $1 | sed -e "s/A/a/g" -e "s/B/b/g" -e "s/C/c/g" -e "s/D/d/g" -e "s/E/e/g" -e "s/F/f/g" diff --git a/root_file_system/dir300/etc/rc.local b/root_file_system/dir300/etc/rc.local new file mode 100755 index 0000000..7d91e63 --- /dev/null +++ b/root_file_system/dir300/etc/rc.local @@ -0,0 +1,55 @@ +# Put your custom commands here that should be executed once +# the system init finished. By default this file does nothing. + +# batman seems to be to stupid to regocnice the devices +# todo: uci.get .. +batctl if add eth0.3 +batctl if add eth0.4 +batctl if add wlan0-1 + +ifconfig eth0 mtu 1528 +ifconfig eth0.3 mtu 1528 +ifconfig eth0.4 mtu 1528 + +echo none > /sys/devices/platform/ar231x-wmac.0/leds/ath5k-phy0\:\:rx/trigger +echo phy0tx > /sys/devices/platform/ar231x-wmac.0/leds/ath5k-phy0\:\:tx/trigger + +toLower() { + echo $1 | sed -e "s/A/a/g" -e "s/B/b/g" -e "s/C/c/g" -e "s/D/d/g" -e "s/E/e/g" -e "s/F/f/g" +} + +# todo: all devices or only dir300 ? +BRMAC=`ip link | grep br-mesh -A1 | grep link | awk '{ print $2 }'` +BRMAC=`toLower $BRMAC` +WLMAC=`ip link | grep wlan0 -A1 | grep link | awk '{ print $2 }'` +WLMAC=`toLower $WLMAC` +ETMAC=`ip link | grep eth0 -A1 | grep link | awk '{ print $2 }'` +ETMAC=`toLower $ETMAC` + +if [ "$WLMAC" != "" ] && [ "$BRMAC" != "" ] && [ "$BRMAC" = "$ETMAC" ]; then +if [[ "$BRMAC" != "$WLMAC" ]]; then + logger -s "Fixing wrong MAC on br-mesh" + uci set network.mesh.macaddr=$WLMAC + uci commit + ifconfig br-mesh hw ether $WLMAC + ifconfig br-mesh down + ifconfig br-mesh up + #wait before reboot to generate tinc certificates and to be able + #to login over ssh bevore reboot in case of errors +fi +fi + +# todo: find time-server in Freifunk-Network +rdate -s time.fu-berlin.de + +sh /etc/firewall.user + +/etc/init.d/qos disable +/etc/init.d/qos stop + +#busybox-httpd for crawldata +httpd -h /tmp/ + +sh /etc/configurator.sh + +exit 0