X-Git-Url: http://pere.pagekite.me/gitweb/homepage.git/blobdiff_plain/89d80f8cd9bb1d6f9ec4b2923e4fe25948ce3d9f..f7a78b2d915249c9f6ef506461e2c90a47d6beba:/blog/index.html diff --git a/blog/index.html b/blog/index.html index eef48f259c..eff43f464c 100644 --- a/blog/index.html +++ b/blog/index.html @@ -19,6 +19,372 @@ +
+
Running TP-Link MR3040 as a batman-adv mesh node using openwrt
+
10th November 2013
+

Continuing my research into mesh networking, I was recommended to +use TP-Link 3040 and 3600 access points as mesh nodes, and the pair I +bought arrived on Friday. Here are my notes on how to set up the +MR3040 as a mesh node using +OpenWrt.

+ +

I started by following the instructions on the OpenWRT wiki for +TL-MR3040, +and downloaded +the +recommended firmware image +(openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin) and +uploaded it into the original web interface. The flashing went fine, +and the machine was available via telnet on the ethernet port. After +logging in and setting the root password, ssh was available and I +could start to set it up as a batman-adv mesh node.

+ +

I started off by reading the instructions from +Wireless +Africa, which had quite a lot of useful information, but +eventually I followed the recipe from the Open Mesh wiki for +using +batman-adv on OpenWrt. A small snag was the fact that the +opkg install kmod-batman-adv command did not work as it +should. The batman-adv kernel module would fail to load because its +dependency crc16 was not already loaded. I +reported the bug to +the openwrt project and hope it will be fixed soon. But the problem +only seem to affect initial testing of batman-adv, as configuration +seem to work when booting from scratch.

+ +

The setup is done using files in /etc/config/. I did not bridge +the Ethernet and mesh interfaces this time, to be able to hook up the +box on my local network and log into it for configuration updates. +The following files were changed and look like this after modifying +them:

+ +

/etc/config/network

+ +
+
+config interface 'loopback'
+        option ifname 'lo'
+        option proto 'static'
+        option ipaddr '127.0.0.1'
+        option netmask '255.0.0.0'
+
+config globals 'globals'
+        option ula_prefix 'fdbf:4c12:3fed::/48'
+
+config interface 'lan'
+        option ifname 'eth0'
+        option type 'bridge'
+        option proto 'dhcp'
+        option ipaddr '192.168.1.1'
+        option netmask '255.255.255.0'
+        option hostname 'tl-mr3040'
+        option ip6assign '60'
+
+config interface 'mesh'
+        option ifname 'adhoc0'
+        option mtu '1528'
+        option proto 'batadv'
+        option mesh 'bat0'
+
+ +

/etc/config/wireless

+
+
+config wifi-device 'radio0'
+        option type 'mac80211'
+        option channel '11'
+        option hwmode '11ng'
+        option path 'platform/ar933x_wmac'
+        option htmode 'HT20'
+        list ht_capab 'SHORT-GI-20'
+        list ht_capab 'SHORT-GI-40'
+        list ht_capab 'RX-STBC1'
+        list ht_capab 'DSSS_CCK-40'
+        option disabled '0'
+
+config wifi-iface 'wmesh'
+        option device 'radio0'
+        option ifname 'adhoc0'
+        option network 'mesh'
+        option encryption 'none'
+        option mode 'adhoc'
+        option bssid '02:BA:00:00:00:01'
+        option ssid 'meshfx@hackeriet'
+
+

/etc/config/batman-adv

+
+
+config 'mesh' 'bat0'
+        option interfaces 'adhoc0'
+        option 'aggregated_ogms'
+        option 'ap_isolation'
+        option 'bonding'
+        option 'fragmentation'
+        option 'gw_bandwidth'
+        option 'gw_mode'
+        option 'gw_sel_class'
+        option 'log_level'
+        option 'orig_interval'
+        option 'vis_mode'
+        option 'bridge_loop_avoidance'
+        option 'distributed_arp_table'
+        option 'network_coding'
+        option 'hop_penalty'
+
+# yet another batX instance
+# config 'mesh' 'bat5'
+#       option 'interfaces' 'second_mesh'
+
+ +

The mesh node is now operational. I have yet to test its range, +but I hope it is good. I have not yet tested the TP-Link 3600 box +still wrapped up in plastic.

+
+
+ + + Tags: english, mesh network, nuug. + + +
+
+
+ +
+
Debian init.d boot script example for rsyslog
+
2nd November 2013
+

If one of the points of switching to a new init system in Debian is +to get rid of huge +init.d scripts, I doubt we need to switch away from sysvinit and +init.d scripts at all. Here is an example init.d script, ie a rewrite +of /etc/init.d/rsyslog:

+ +

+#!/lib/init/init-d-script
+### BEGIN INIT INFO
+# Provides:          rsyslog
+# Required-Start:    $remote_fs $time
+# Required-Stop:     umountnfs $time
+# X-Stop-After:      sendsigs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: enhanced syslogd
+# Description:       Rsyslog is an enhanced multi-threaded syslogd.
+#                    It is quite compatible to stock sysklogd and can be 
+#                    used as a drop-in replacement.
+### END INIT INFO
+DESC="enhanced syslogd"
+DAEMON=/usr/sbin/rsyslogd
+

+ +

Pretty minimalistic to me... For the record, the original sysv-rc +script was 137 lines, and the above is just 15 lines, most of it meta +info/comments.

+ +

How to do this, you ask? Well, one create a new script +/lib/init/init-d-script looking something like this: + +

+#!/bin/sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+
+#
+do_start()
+{
+	# Return
+	#   0 if daemon has been started
+	#   1 if daemon was already running
+	#   2 if daemon could not be started
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+		|| return 1
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+		$DAEMON_ARGS \
+		|| return 2
+	# Add code here, if necessary, that waits for the process to be ready
+	# to handle requests from services started subsequently which depend
+	# on this one.  As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+	# Return
+	#   0 if daemon has been stopped
+	#   1 if daemon was already stopped
+	#   2 if daemon could not be stopped
+	#   other if a failure occurred
+	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+	# Wait for children to finish too if this is a daemon that forks
+	# and if the daemon is only ever run from this initscript.
+	# If the above conditions are not satisfied then add some other code
+	# that waits for the process to drop all resources that could be
+	# needed by services started subsequently.  A last resort is to
+	# sleep for some time.
+	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	[ "$?" = 2 ] && return 2
+	# Many daemons don't delete their pidfiles when they exit.
+	rm -f $PIDFILE
+	return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+	#
+	# If the daemon can reload its configuration without
+	# restarting (for example, when it is sent a SIGHUP),
+	# then implement that here.
+	#
+	start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+	return 0
+}
+
+SCRIPTNAME=$1
+scriptbasename="$(basename $1)"
+echo "SN: $scriptbasename"
+if [ "$scriptbasename" != "init-d-library" ] ; then
+    script="$1"
+    shift
+    . $script
+else
+    exit 0
+fi
+
+NAME=$(basename $DAEMON)
+PIDFILE=/var/run/$NAME.pid
+
+# Exit if the package is not installed
+#[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+case "$1" in
+  start)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  stop)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  status)
+	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+	;;
+  #reload|force-reload)
+	#
+	# If do_reload() is not implemented then leave this commented out
+	# and leave 'force-reload' as an alias for 'restart'.
+	#
+	#log_daemon_msg "Reloading $DESC" "$NAME"
+	#do_reload
+	#log_end_msg $?
+	#;;
+  restart|force-reload)
+	#
+	# If the "reload" option is implemented then remove the
+	# 'force-reload' alias
+	#
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+		# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:
+

+ +

It is based on /etc/init.d/skeleton, and could be improved quite a +lot. I did not really polish the approach, so it might not always +work out of the box, but you get the idea. I did not try very hard to +optimize it nor make it more robust either.

+ +

A better argument for switching init system in Debian than reducing +the size of init scripts (which is a good thing to do anyway), is to +get boot system that is able to handle the kernel events sensibly and +robustly, and do not depend on the boot to run sequentially. The boot +and the kernel have not behaved sequentially in years.

+
+
+ + + Tags: bootsystem, debian, english. + + +
+
+
+ +
+
Browser plugin for SPICE (spice-xpi) uploaded to Debian
+
1st November 2013
+

The SPICE protocol for +remote display access is the preferred solution with oVirt and RedHat +Enterprise Virtualization, and I was sad to discover the other day +that the browser plugin needed to use these systems seamlessly was +missing in Debian. The request +for a package was from 2012-04-10 with no progress since +2013-04-01, so I decided to wrap up a package based on the great work +from Cajus Pollmeier and put it in a collab-maint maintained git +repository to get a package I could use. I would very much like +others to help me maintain the package (or just take over, I do not +mind), but as no-one had volunteered so far, I just uploaded it to +NEW. I hope it will be available in Debian in a few days.

+ +

The source is now available from +http://anonscm.debian.org/gitweb/?p=collab-maint/spice-xpi.git;a=summary.

+
+
+ + + Tags: debian, english. + + +
+
+
+
Teaching vmdebootstrap to create Raspberry Pi SD card images
27th October 2013
@@ -41,7 +407,7 @@ architecture) chroots for Raspberry Pi, I dived into the vmdebootstrap code and adjusted it to be able to build armel images on my amd64 Debian laptop. I ended up giving vmdebootstrap five new options, allowing me to replicate the image creation process I use to make -Debian +Debian Jessie based mesh node images for the Raspberry Pi. First, the --foreign /path/to/binfm_handler option tell vmdebootstrap to call debootstrap with --foreign and to copy the handler into the @@ -528,223 +894,6 @@ me know. :)

-
-
Finally, Debian Edu Wheezy is released today!
-
29th September 2013
-

A few hours ago, the announcement for the first stable release of -Debian Edu Wheezy went out from the Debian publicity team. The -complete announcement text can be found at -the Debian News -section, translated to several languages. Please check it out.

- -

There is one minor known problem that we will fix very soon. One -can not install a amd64 Thin Client Server using PXE, as the /var/ -partition is too small. A workaround is to extend the partition (use -lvresize + resize2fs in tty 2 while installing).

-
-
- - - Tags: debian edu, english. - - -
-
-
- -
-
Videos about the Freedombox project - for inspiration and learning
-
27th September 2013
-

The Freedombox -project have been going on for a while, and have presented the -vision, ideas and solution several places. Here is a little -collection of videos of talks and presentation of the project.

- - - -

A larger list is available from -the -Freedombox Wiki.

- -

On other news, I am happy to report that Freedombox based on Debian -Jessie is coming along quite well, and soon both Owncloud and using -Tor should be available for testers of the Freedombox solution. :) In -a few weeks I hope everything needed to test it is included in Debian. -The withsqlite package is already in Debian, and the plinth package is -pending in NEW. The third and vital part of that puzzle is the -metapackage/setup framework, which is still pending an upload. Join -us on IRC -(#freedombox on irc.debian.org) and -the -mailing list if you want to help make this vision come true.

-
-
- - - Tags: debian, english, freedombox, sikkerhet, surveillance, web. - - -
-
-
- -
-
Third and probably last beta release of Debian Edu Wheezy
-
16th September 2013
-

The third wheezy based beta release of Debian Edu was wrapped up -today. This is the release announcement from Holger Levsen:

- -
-

Hi,

- -

it is my pleasure to announce the third beta release (beta 2 for -short) of Debian Edu / -Skolelinux based on Debian Wheezy!

- -

Please test these images extensivly, if no new problems are found -we plan to do this final Debian Edu Wheezy release this coming -weekend. We are not aware of any major problems or blockers in beta2, -if you find something, please notify us immediately!

- -

(More about the remaining steps for the Edu Wheezy release in -another mail to the edu list tonight or tomorrow...)

- -

Noteworthy changes and software updates for Debian Edu 7.1+edu0~b2 -compared to beta1:

- -
    - -
  • The KDE proxy setup has been adjusted to use the provided wpad.dat. This -also gets Chromium to use this proxy.
  • -
  • Install kdepim-groupware with KDE desktops to make sure korganizer -understand ical/dav sources.
  • -
  • Increased default maximum size of /var/spool/squid and /skole/backup on the -main server.
  • -
  • A source DVD image containing all source packages is now available as well.
  • -
  • Updates for chromium (29.0.1547.57-1~deb7u1), imagemagick -(6.7.7.10-5+deb7u2), php5 (5.4.4-14+deb7u4), libmodplug -(0.8.8.4-3+deb7u1+git20130828), tiff (4.0.2-6+deb7u2), linux-image -(3.2.0-4-486_3.2.46-1+deb7u1).
  • - -
- -

Where to get it:

- -

To download the multiarch netinstall CD release you can use

- - - -

The SHA1SUM of this image is: 3a1c89f4666df80eebcd46c5bf5fedb866f9472f

- -

To download the multiarch USB stick ISO release you can use -

- -

The SHA1SUM of this image is: 702d1718548f401c74bfa6df9f032cc3ee16597e

- -

The Source DVD image has the filename -debian-edu-7.1+edu0~b2-source-DVD.iso and the SHA1SUM -089eed8b3f962db47aae1f6a9685e9bb2fa30ca5 and is available the same way -as the other isos.

- -

How to report bugs

- -

For information how to report bugs please see -
http://wiki.debian.org/DebianEdu/HowTo/ReportBugs

- - -

About Debian Edu and Skolelinux

- -

Debian Edu, also known as Skolelinux, is a Linux distribution based -on Debian providing an out-of-the box environment of a completely -configured school network. Immediately after installation a school -server running all services needed for a school network is set up just -waiting for users and machines being added via GOsa², a comfortable -Web-UI. A netbooting environment is prepared using PXE, so after -initial installation of the main server from CD or USB stick all other -machines can be installed via the network. The provided school server -provides LDAP database and Kerberos authentication service, -centralized home directories, DHCP server, web proxy and many other -services. The desktop contains more than 60 educational software -packages and more are available from the Debian archive, and schools -can choose between KDE, Gnome, LXDE and Xfce desktop environment.

- -

This is the seventh test release based on Debian Wheezy. Basically -this is an updated and slightly improved version compared to the -Squeeze release.

- -

Notes for upgrades from Alpha Prereleases

- -

Alpha based installations should reinstall or downgrade the -versions of gosa and libpam-mklocaluser to the ones used in this beta -release. Both alpha and beta0 based installations should reinstall or -deal with gosa.conf manually; there are two options: (1) Keep -gosa.conf and edit this file as outlined on the mailing list. (2) -Accept the new version of gosa.conf and replace both contained admin -password placeholders with the password hashes found in the old one -(backup copy!). In both cases all users need to change their password -to make sure a password is set for CIFS access to their home -directory.

- - -

cheers, -
Holger

-
-
-
- - - Tags: debian edu, english. - - -
-
-
-

RSS feed