1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries from November
2013</title>
5 <description>Entries from November
2013</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Lets make a wireless community network in Oslo!
</title>
11 <link>http://people.skolelinux.org/pere/blog/Lets_make_a_wireless_community_network_in_Oslo_.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Lets_make_a_wireless_community_network_in_Oslo_.html
</guid>
13 <pubDate>Wed,
13 Nov
2013 21:
00:
00 +
0100</pubDate>
14 <description><p
>Today NUUG and Hackeriet announced
15 <a href=
"http://www.nuug.no/news/Bli_med___bygge_dugnadsnett_for_alle_i_Oslo.shtml
">our
16 plans to join forces and create a wireless community network in
17 Oslo
</a
>. The workshop to help people get started will take place
18 Thursday
2013-
11-
28, but we already are collecting the geolocation of
19 people joining forces to make this happen. We have
20 <a href=
"https://github.com/petterreinholdtsen/meshfx-node/blob/master/oslo-nodes.geojson
">9
21 locations plotted on the map
</a
>, but we will need more before we have
22 a connected mesh spread across Oslo. If this sound interesting to
23 you, please join us at the workshop. If you are too impatient to wait
24 15 days, please join us on the IRC channel
25 <a href=
"irc://irc.freenode.net/%
23nuug
">#nuug on irc.freenode.net
</a
>
26 right away. :)
</p
>
31 <title>Running TP-Link MR3040 as a batman-adv mesh node using openwrt
</title>
32 <link>http://people.skolelinux.org/pere/blog/Running_TP_Link_MR3040_as_a_batman_adv_mesh_node_using_openwrt.html
</link>
33 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Running_TP_Link_MR3040_as_a_batman_adv_mesh_node_using_openwrt.html
</guid>
34 <pubDate>Sun,
10 Nov
2013 23:
00:
00 +
0100</pubDate>
35 <description><p
>Continuing my research into mesh networking, I was recommended to
36 use TP-Link
3040 and
3600 access points as mesh nodes, and the pair I
37 bought arrived on Friday. Here are my notes on how to set up the
38 MR3040 as a mesh node using
39 <a href=
"http://www.openwrt.org/
">OpenWrt
</a
>.
</p
>
41 <p
>I started by following the instructions on the OpenWRT wiki for
42 <a href=
"http://wiki.openwrt.org/toh/tp-link/tl-mr3040
">TL-MR3040
</a
>,
44 <a href=
"http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin
">the
45 recommended firmware image
</a
>
46 (openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin) and
47 uploaded it into the original web interface. The flashing went fine,
48 and the machine was available via telnet on the ethernet port. After
49 logging in and setting the root password, ssh was available and I
50 could start to set it up as a batman-adv mesh node.
</p
>
52 <p
>I started off by reading the instructions from
53 <a href=
"http://wirelessafrica.meraka.org.za/wiki/index.php?title=Antoine
's_Research
">Wireless
54 Africa
</a
>, which had quite a lot of useful information, but
55 eventually I followed the recipe from the Open Mesh wiki for
56 <a href=
"http://www.open-mesh.org/projects/batman-adv/wiki/Batman-adv-openwrt-config
">using
57 batman-adv on OpenWrt
</a
>. A small snag was the fact that the
58 <tt
>opkg install kmod-batman-adv
</tt
> command did not work as it
59 should. The batman-adv kernel module would fail to load because its
60 dependency crc16 was not already loaded. I
61 <a href=
"https://dev.openwrt.org/ticket/
14452">reported the bug
</a
> to
62 the openwrt project and hope it will be fixed soon. But the problem
63 only seem to affect initial testing of batman-adv, as configuration
64 seem to work when booting from scratch.
</p
>
66 <p
>The setup is done using files in /etc/config/. I did not bridge
67 the Ethernet and mesh interfaces this time, to be able to hook up the
68 box on my local network and log into it for configuration updates.
69 The following files were changed and look like this after modifying
72 <p
><tt
>/etc/config/network
</tt
></p
>
76 config interface
'loopback
'
77 option ifname
'lo
'
78 option proto
'static
'
79 option ipaddr
'127.0.0.1'
80 option netmask
'255.0.0.0'
82 config globals
'globals
'
83 option ula_prefix
'fdbf:
4c12:
3fed::/
48'
85 config interface
'lan
'
86 option ifname
'eth0
'
87 option type
'bridge
'
88 option proto
'dhcp
'
89 option ipaddr
'192.168.1.1'
90 option netmask
'255.255.255.0'
91 option hostname
'tl-mr3040
'
92 option ip6assign
'60'
94 config interface
'mesh
'
95 option ifname
'adhoc0
'
96 option mtu
'1528'
97 option proto
'batadv
'
98 option mesh
'bat0
'
101 <p
><tt
>/etc/config/wireless
</tt
></p
>
104 config wifi-device
'radio0
'
105 option type
'mac80211
'
106 option channel
'11'
107 option hwmode
'11ng
'
108 option path
'platform/ar933x_wmac
'
109 option htmode
'HT20
'
110 list ht_capab
'SHORT-GI-
20'
111 list ht_capab
'SHORT-GI-
40'
112 list ht_capab
'RX-STBC1
'
113 list ht_capab
'DSSS_CCK-
40'
114 option disabled
'0'
116 config wifi-iface
'wmesh
'
117 option device
'radio0
'
118 option ifname
'adhoc0
'
119 option network
'mesh
'
120 option encryption
'none
'
121 option mode
'adhoc
'
122 option bssid
'02:BA:
00:
00:
00:
01'
123 option ssid
'meshfx@hackeriet
'
125 <p
><tt
>/etc/config/batman-adv
</tt
></p
>
128 config
'mesh
' 'bat0
'
129 option interfaces
'adhoc0
'
130 option
'aggregated_ogms
'
131 option
'ap_isolation
'
132 option
'bonding
'
133 option
'fragmentation
'
134 option
'gw_bandwidth
'
135 option
'gw_mode
'
136 option
'gw_sel_class
'
137 option
'log_level
'
138 option
'orig_interval
'
139 option
'vis_mode
'
140 option
'bridge_loop_avoidance
'
141 option
'distributed_arp_table
'
142 option
'network_coding
'
143 option
'hop_penalty
'
145 # yet another batX instance
146 # config
'mesh
' 'bat5
'
147 # option
'interfaces
' 'second_mesh
'
150 <p
>The mesh node is now operational. I have yet to test its range,
151 but I hope it is good. I have not yet tested the TP-Link
3600 box
152 still wrapped up in plastic.
</p
>
157 <title>Debian init.d boot script example for rsyslog
</title>
158 <link>http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</link>
159 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</guid>
160 <pubDate>Sat,
2 Nov
2013 22:
40:
00 +
0100</pubDate>
161 <description><p
>If one of the points of switching to a new init system in Debian is
162 <a href=
"http://thomas.goirand.fr/blog/?p=
147">to get rid of huge
163 init.d scripts
</a
>, I doubt we need to switch away from sysvinit and
164 init.d scripts at all. Here is an example init.d script, ie a rewrite
165 of /etc/init.d/rsyslog:
</p
>
168 #!/lib/init/init-d-script
171 # Required-Start: $remote_fs $time
172 # Required-Stop: umountnfs $time
173 # X-Stop-After: sendsigs
174 # Default-Start:
2 3 4 5
175 # Default-Stop:
0 1 6
176 # Short-Description: enhanced syslogd
177 # Description: Rsyslog is an enhanced multi-threaded syslogd.
178 # It is quite compatible to stock sysklogd and can be
179 # used as a drop-in replacement.
181 DESC=
"enhanced syslogd
"
182 DAEMON=/usr/sbin/rsyslogd
183 </pre
></p
>
185 <p
>Pretty minimalistic to me... For the record, the original sysv-rc
186 script was
137 lines, and the above is just
15 lines, most of it meta
187 info/comments.
</p
>
189 <p
>How to do this, you ask? Well, one create a new script
190 /lib/init/init-d-script looking something like this:
195 # Define LSB log_* functions.
196 # Depend on lsb-base (
>=
3.2-
14) to ensure that this file is present
197 # and status_of_proc is working.
198 . /lib/lsb/init-functions
201 # Function that starts the daemon/service
207 #
0 if daemon has been started
208 #
1 if daemon was already running
209 #
2 if daemon could not be started
210 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test
> /dev/null \
212 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
215 # Add code here, if necessary, that waits for the process to be ready
216 # to handle requests from services started subsequently which depend
217 # on this one. As a last resort, sleep for some time.
221 # Function that stops the daemon/service
226 #
0 if daemon has been stopped
227 #
1 if daemon was already stopped
228 #
2 if daemon could not be stopped
229 # other if a failure occurred
230 start-stop-daemon --stop --quiet --retry=TERM/
30/KILL/
5 --pidfile $PIDFILE --name $NAME
231 RETVAL=
"$?
"
232 [
"$RETVAL
" =
2 ]
&& return
2
233 # Wait for children to finish too if this is a daemon that forks
234 # and if the daemon is only ever run from this initscript.
235 # If the above conditions are not satisfied then add some other code
236 # that waits for the process to drop all resources that could be
237 # needed by services started subsequently. A last resort is to
238 # sleep for some time.
239 start-stop-daemon --stop --quiet --oknodo --retry=
0/
30/KILL/
5 --exec $DAEMON
240 [
"$?
" =
2 ]
&& return
2
241 # Many daemons don
't delete their pidfiles when they exit.
243 return
"$RETVAL
"
247 # Function that sends a SIGHUP to the daemon/service
251 # If the daemon can reload its configuration without
252 # restarting (for example, when it is sent a SIGHUP),
253 # then implement that here.
255 start-stop-daemon --stop --signal
1 --quiet --pidfile $PIDFILE --name $NAME
260 scriptbasename=
"$(basename $
1)
"
261 echo
"SN: $scriptbasename
"
262 if [
"$scriptbasename
" !=
"init-d-library
" ] ; then
263 script=
"$
1"
270 NAME=$(basename $DAEMON)
271 PIDFILE=/var/run/$NAME.pid
273 # Exit if the package is not installed
274 #[ -x
"$DAEMON
" ] || exit
0
276 # Read configuration variable file if it is present
277 [ -r /etc/default/$NAME ]
&& . /etc/default/$NAME
279 # Load the VERBOSE setting and other rcS variables
282 case
"$
1" in
284 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Starting $DESC
" "$NAME
"
286 case
"$?
" in
287 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
288 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
292 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Stopping $DESC
" "$NAME
"
294 case
"$?
" in
295 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
296 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
300 status_of_proc
"$DAEMON
" "$NAME
" && exit
0 || exit $?
302 #reload|force-reload)
304 # If do_reload() is not implemented then leave this commented out
305 # and leave
'force-reload
' as an alias for
'restart
'.
307 #log_daemon_msg
"Reloading $DESC
" "$NAME
"
311 restart|force-reload)
313 # If the
"reload
" option is implemented then remove the
314 #
'force-reload
' alias
316 log_daemon_msg
"Restarting $DESC
" "$NAME
"
318 case
"$?
" in
321 case
"$?
" in
323 1) log_end_msg
1 ;; # Old process is still running
324 *) log_end_msg
1 ;; # Failed to start
334 echo
"Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}
" >&2
340 </pre
></p
>
342 <p
>It is based on /etc/init.d/skeleton, and could be improved quite a
343 lot. I did not really polish the approach, so it might not always
344 work out of the box, but you get the idea. I did not try very hard to
345 optimize it nor make it more robust either.
</p
>
347 <p
>A better argument for switching init system in Debian than reducing
348 the size of init scripts (which is a good thing to do anyway), is to
349 get boot system that is able to handle the kernel events sensibly and
350 robustly, and do not depend on the boot to run sequentially. The boot
351 and the kernel have not behaved sequentially in years.
</p
>
356 <title>Browser plugin for SPICE (spice-xpi) uploaded to Debian
</title>
357 <link>http://people.skolelinux.org/pere/blog/Browser_plugin_for_SPICE__spice_xpi__uploaded_to_Debian.html
</link>
358 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Browser_plugin_for_SPICE__spice_xpi__uploaded_to_Debian.html
</guid>
359 <pubDate>Fri,
1 Nov
2013 11:
00:
00 +
0100</pubDate>
360 <description><p
><a href=
"http://www.spice-space.org/
">The SPICE protocol
</a
> for
361 remote display access is the preferred solution with oVirt and RedHat
362 Enterprise Virtualization, and I was sad to discover the other day
363 that the browser plugin needed to use these systems seamlessly was
364 missing in Debian. The
<a href=
"http://bugs.debian.org/
668284">request
365 for a package
</a
> was from
2012-
04-
10 with no progress since
366 2013-
04-
01, so I decided to wrap up a package based on the great work
367 from Cajus Pollmeier and put it in a collab-maint maintained git
368 repository to get a package I could use. I would very much like
369 others to help me maintain the package (or just take over, I do not
370 mind), but as no-one had volunteered so far, I just uploaded it to
371 NEW. I hope it will be available in Debian in a few days.
</p
>
373 <p
>The source is now available from
374 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/spice-xpi.git;a=summary
">http://anonscm.debian.org/gitweb/?p=collab-maint/spice-xpi.git;a=summary
</a
>.
</p
>