]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2013/11/11.rss
Link to archive.org.
[homepage.git] / blog / archive / 2013 / 11 / 11.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
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>
7
8
9 <item>
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>&lt;p&gt;Today NUUG and Hackeriet announced
15 &lt;a href=&quot;http://www.nuug.no/news/Bli_med___bygge_dugnadsnett_for_alle_i_Oslo.shtml&quot;&gt;our
16 plans to join forces and create a wireless community network in
17 Oslo&lt;/a&gt;. 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 &lt;a href=&quot;https://github.com/petterreinholdtsen/meshfx-node/blob/master/oslo-nodes.geojson&quot;&gt;9
21 locations plotted on the map&lt;/a&gt;, 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 &lt;a href=&quot;irc://irc.freenode.net/%23nuug&quot;&gt;#nuug on irc.freenode.net&lt;/a&gt;
26 right away. :)&lt;/p&gt;
27 </description>
28 </item>
29
30 <item>
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>&lt;p&gt;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 &lt;a href=&quot;http://www.openwrt.org/&quot;&gt;OpenWrt&lt;/a&gt;.&lt;/p&gt;
40
41 &lt;p&gt;I started by following the instructions on the OpenWRT wiki for
42 &lt;a href=&quot;http://wiki.openwrt.org/toh/tp-link/tl-mr3040&quot;&gt;TL-MR3040&lt;/a&gt;,
43 and downloaded
44 &lt;a href=&quot;http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin&quot;&gt;the
45 recommended firmware image&lt;/a&gt;
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.&lt;/p&gt;
51
52 &lt;p&gt;I started off by reading the instructions from
53 &lt;a href=&quot;http://wirelessafrica.meraka.org.za/wiki/index.php?title=Antoine&#39;s_Research&quot;&gt;Wireless
54 Africa&lt;/a&gt;, which had quite a lot of useful information, but
55 eventually I followed the recipe from the Open Mesh wiki for
56 &lt;a href=&quot;http://www.open-mesh.org/projects/batman-adv/wiki/Batman-adv-openwrt-config&quot;&gt;using
57 batman-adv on OpenWrt&lt;/a&gt;. A small snag was the fact that the
58 &lt;tt&gt;opkg install kmod-batman-adv&lt;/tt&gt; 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 &lt;a href=&quot;https://dev.openwrt.org/ticket/14452&quot;&gt;reported the bug&lt;/a&gt; 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.&lt;/p&gt;
65
66 &lt;p&gt;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
70 them:&lt;/p&gt;
71
72 &lt;p&gt;&lt;tt&gt;/etc/config/network&lt;/tt&gt;&lt;/p&gt;
73
74 &lt;pre&gt;
75
76 config interface &#39;loopback&#39;
77 option ifname &#39;lo&#39;
78 option proto &#39;static&#39;
79 option ipaddr &#39;127.0.0.1&#39;
80 option netmask &#39;255.0.0.0&#39;
81
82 config globals &#39;globals&#39;
83 option ula_prefix &#39;fdbf:4c12:3fed::/48&#39;
84
85 config interface &#39;lan&#39;
86 option ifname &#39;eth0&#39;
87 option type &#39;bridge&#39;
88 option proto &#39;dhcp&#39;
89 option ipaddr &#39;192.168.1.1&#39;
90 option netmask &#39;255.255.255.0&#39;
91 option hostname &#39;tl-mr3040&#39;
92 option ip6assign &#39;60&#39;
93
94 config interface &#39;mesh&#39;
95 option ifname &#39;adhoc0&#39;
96 option mtu &#39;1528&#39;
97 option proto &#39;batadv&#39;
98 option mesh &#39;bat0&#39;
99 &lt;/pre&gt;
100
101 &lt;p&gt;&lt;tt&gt;/etc/config/wireless&lt;/tt&gt;&lt;/p&gt;
102 &lt;pre&gt;
103
104 config wifi-device &#39;radio0&#39;
105 option type &#39;mac80211&#39;
106 option channel &#39;11&#39;
107 option hwmode &#39;11ng&#39;
108 option path &#39;platform/ar933x_wmac&#39;
109 option htmode &#39;HT20&#39;
110 list ht_capab &#39;SHORT-GI-20&#39;
111 list ht_capab &#39;SHORT-GI-40&#39;
112 list ht_capab &#39;RX-STBC1&#39;
113 list ht_capab &#39;DSSS_CCK-40&#39;
114 option disabled &#39;0&#39;
115
116 config wifi-iface &#39;wmesh&#39;
117 option device &#39;radio0&#39;
118 option ifname &#39;adhoc0&#39;
119 option network &#39;mesh&#39;
120 option encryption &#39;none&#39;
121 option mode &#39;adhoc&#39;
122 option bssid &#39;02:BA:00:00:00:01&#39;
123 option ssid &#39;meshfx@hackeriet&#39;
124 &lt;/pre&gt;
125 &lt;p&gt;&lt;tt&gt;/etc/config/batman-adv&lt;/tt&gt;&lt;/p&gt;
126 &lt;pre&gt;
127
128 config &#39;mesh&#39; &#39;bat0&#39;
129 option interfaces &#39;adhoc0&#39;
130 option &#39;aggregated_ogms&#39;
131 option &#39;ap_isolation&#39;
132 option &#39;bonding&#39;
133 option &#39;fragmentation&#39;
134 option &#39;gw_bandwidth&#39;
135 option &#39;gw_mode&#39;
136 option &#39;gw_sel_class&#39;
137 option &#39;log_level&#39;
138 option &#39;orig_interval&#39;
139 option &#39;vis_mode&#39;
140 option &#39;bridge_loop_avoidance&#39;
141 option &#39;distributed_arp_table&#39;
142 option &#39;network_coding&#39;
143 option &#39;hop_penalty&#39;
144
145 # yet another batX instance
146 # config &#39;mesh&#39; &#39;bat5&#39;
147 # option &#39;interfaces&#39; &#39;second_mesh&#39;
148 &lt;/pre&gt;
149
150 &lt;p&gt;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.&lt;/p&gt;
153 </description>
154 </item>
155
156 <item>
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>&lt;p&gt;If one of the points of switching to a new init system in Debian is
162 &lt;a href=&quot;http://thomas.goirand.fr/blog/?p=147&quot;&gt;to get rid of huge
163 init.d scripts&lt;/a&gt;, 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:&lt;/p&gt;
166
167 &lt;p&gt;&lt;pre&gt;
168 #!/lib/init/init-d-script
169 ### BEGIN INIT INFO
170 # Provides: rsyslog
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.
180 ### END INIT INFO
181 DESC=&quot;enhanced syslogd&quot;
182 DAEMON=/usr/sbin/rsyslogd
183 &lt;/pre&gt;&lt;/p&gt;
184
185 &lt;p&gt;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.&lt;/p&gt;
188
189 &lt;p&gt;How to do this, you ask? Well, one create a new script
190 /lib/init/init-d-script looking something like this:
191
192 &lt;p&gt;&lt;pre&gt;
193 #!/bin/sh
194
195 # Define LSB log_* functions.
196 # Depend on lsb-base (&gt;= 3.2-14) to ensure that this file is present
197 # and status_of_proc is working.
198 . /lib/lsb/init-functions
199
200 #
201 # Function that starts the daemon/service
202
203 #
204 do_start()
205 {
206 # Return
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 &gt; /dev/null \
211 || return 1
212 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
213 $DAEMON_ARGS \
214 || return 2
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.
218 }
219
220 #
221 # Function that stops the daemon/service
222 #
223 do_stop()
224 {
225 # Return
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=&quot;$?&quot;
232 [ &quot;$RETVAL&quot; = 2 ] &amp;&amp; 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 [ &quot;$?&quot; = 2 ] &amp;&amp; return 2
241 # Many daemons don&#39;t delete their pidfiles when they exit.
242 rm -f $PIDFILE
243 return &quot;$RETVAL&quot;
244 }
245
246 #
247 # Function that sends a SIGHUP to the daemon/service
248 #
249 do_reload() {
250 #
251 # If the daemon can reload its configuration without
252 # restarting (for example, when it is sent a SIGHUP),
253 # then implement that here.
254 #
255 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
256 return 0
257 }
258
259 SCRIPTNAME=$1
260 scriptbasename=&quot;$(basename $1)&quot;
261 echo &quot;SN: $scriptbasename&quot;
262 if [ &quot;$scriptbasename&quot; != &quot;init-d-library&quot; ] ; then
263 script=&quot;$1&quot;
264 shift
265 . $script
266 else
267 exit 0
268 fi
269
270 NAME=$(basename $DAEMON)
271 PIDFILE=/var/run/$NAME.pid
272
273 # Exit if the package is not installed
274 #[ -x &quot;$DAEMON&quot; ] || exit 0
275
276 # Read configuration variable file if it is present
277 [ -r /etc/default/$NAME ] &amp;&amp; . /etc/default/$NAME
278
279 # Load the VERBOSE setting and other rcS variables
280 . /lib/init/vars.sh
281
282 case &quot;$1&quot; in
283 start)
284 [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Starting $DESC&quot; &quot;$NAME&quot;
285 do_start
286 case &quot;$?&quot; in
287 0|1) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 0 ;;
288 2) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 1 ;;
289 esac
290 ;;
291 stop)
292 [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Stopping $DESC&quot; &quot;$NAME&quot;
293 do_stop
294 case &quot;$?&quot; in
295 0|1) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 0 ;;
296 2) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 1 ;;
297 esac
298 ;;
299 status)
300 status_of_proc &quot;$DAEMON&quot; &quot;$NAME&quot; &amp;&amp; exit 0 || exit $?
301 ;;
302 #reload|force-reload)
303 #
304 # If do_reload() is not implemented then leave this commented out
305 # and leave &#39;force-reload&#39; as an alias for &#39;restart&#39;.
306 #
307 #log_daemon_msg &quot;Reloading $DESC&quot; &quot;$NAME&quot;
308 #do_reload
309 #log_end_msg $?
310 #;;
311 restart|force-reload)
312 #
313 # If the &quot;reload&quot; option is implemented then remove the
314 # &#39;force-reload&#39; alias
315 #
316 log_daemon_msg &quot;Restarting $DESC&quot; &quot;$NAME&quot;
317 do_stop
318 case &quot;$?&quot; in
319 0|1)
320 do_start
321 case &quot;$?&quot; in
322 0) log_end_msg 0 ;;
323 1) log_end_msg 1 ;; # Old process is still running
324 *) log_end_msg 1 ;; # Failed to start
325 esac
326 ;;
327 *)
328 # Failed to stop
329 log_end_msg 1
330 ;;
331 esac
332 ;;
333 *)
334 echo &quot;Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}&quot; &gt;&amp;2
335 exit 3
336 ;;
337 esac
338
339 :
340 &lt;/pre&gt;&lt;/p&gt;
341
342 &lt;p&gt;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.&lt;/p&gt;
346
347 &lt;p&gt;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.&lt;/p&gt;
352 </description>
353 </item>
354
355 <item>
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>&lt;p&gt;&lt;a href=&quot;http://www.spice-space.org/&quot;&gt;The SPICE protocol&lt;/a&gt; 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 &lt;a href=&quot;http://bugs.debian.org/668284&quot;&gt;request
365 for a package&lt;/a&gt; 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.&lt;/p&gt;
372
373 &lt;p&gt;The source is now available from
374 &lt;a href=&quot;http://anonscm.debian.org/gitweb/?p=collab-maint/spice-xpi.git;a=summary&quot;&gt;http://anonscm.debian.org/gitweb/?p=collab-maint/spice-xpi.git;a=summary&lt;/a&gt;.&lt;/p&gt;
375 </description>
376 </item>
377
378 </channel>
379 </rss>