]> pere.pagekite.me Git - homepage.git/blobdiff - blog/archive/2013/10/10.rss
Generated.
[homepage.git] / blog / archive / 2013 / 10 / 10.rss
index e7f49f6498b882c1357423d9b9914334c7ba5eb7..472d8c7ce73fcc553213a9661c1c3fb93982ab77 100644 (file)
@@ -6,6 +6,304 @@
                 <link>http://people.skolelinux.org/pere/blog/</link>
 
        
+       <item>
+               <title>Teaching vmdebootstrap to create Raspberry Pi SD card images</title>
+               <link>http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html</guid>
+                <pubDate>Sun, 27 Oct 2013 17:00:00 +0100</pubDate>
+               <description>&lt;p&gt;The
+&lt;a href=&quot;http://packages.qa.debian.org/v/vmdebootstrap.html&quot;&gt;vmdebootstrap&lt;/a&gt;
+program is a a very nice system to create virtual machine images.  It
+create a image file, add a partition table, mount it and run
+debootstrap in the mounted directory to create a Debian system on a
+stick.  Yesterday, I decided to try to teach it how to make images for
+&lt;a href=&quot;https://wiki.debian.org/RaspberryPi&quot;&gt;Raspberry Pi&lt;/a&gt;, as part
+of a plan to simplify the build system for
+&lt;a href=&quot;https://wiki.debian.org/FreedomBox&quot;&gt;the FreedomBox
+project&lt;/a&gt;.  The FreedomBox project already uses vmdebootstrap for
+the virtualbox images, but its current build system made multistrap
+based system for Dreamplug images, and it is lacking support for
+Raspberry Pi.&lt;/p&gt;
+
+&lt;p&gt;Armed with the knowledge on how to build &quot;foreign&quot; (aka non-native
+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
+&lt;a href=&quot;http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html&quot;&gt;Debian
+Jessie based mesh node images for the Raspberry Pi&lt;/a&gt;.  First, the
+&lt;tt&gt;--foreign /path/to/binfm_handler&lt;/tt&gt; option tell vmdebootstrap to
+call debootstrap with --foreign and to copy the handler into the
+generated chroot before running the second stage.  This allow
+vmdebootstrap to create armel images on an amd64 host.  Next I added
+two new options &lt;tt&gt;--bootsize size&lt;/tt&gt; and &lt;tt&gt;--boottype
+fstype&lt;/tt&gt; to teach it to create a separate /boot/ partition with the
+given file system type, allowing me to create an image with a vfat
+partition for the /boot/ stuff.  I also added a &lt;tt&gt;--variant
+variant&lt;/tt&gt; option to allow me to create smaller images without the
+Debian base system packages installed.  Finally, I added an option
+&lt;tt&gt;--no-extlinux&lt;/tt&gt; to tell vmdebootstrap to not install extlinux
+as a boot loader.  It is not needed on the Raspberry Pi and probably
+most other non-x86 architectures.  The changes were accepted by the
+upstream author of vmdebootstrap yesterday and today, and is now
+available from
+&lt;a href=&quot;http://git.liw.fi/cgi-bin/cgit/cgit.cgi/vmdebootstrap/&quot;&gt;the
+upstream project page&lt;/a&gt;.&lt;/p&gt;
+
+&lt;p&gt;To use it to build a Raspberry Pi image using Debian Jessie, first
+create a small script (the customize script) to add the non-free
+binary blob needed to boot the Raspberry Pi and the APT source
+list:&lt;/p&gt;
+
+&lt;p&gt;&lt;pre&gt;
+#!/bin/sh
+set -e # Exit on first error
+rootdir=&quot;$1&quot;
+cd &quot;$rootdir&quot;
+cat &amp;lt;&amp;lt;EOF &gt; etc/apt/sources.list
+deb http://http.debian.net/debian/ jessie main contrib non-free
+EOF
+# Install non-free binary blob needed to boot Raspberry Pi.  This
+# install a kernel somewhere too.
+wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update \
+    -O $rootdir/usr/bin/rpi-update
+chmod a+x $rootdir/usr/bin/rpi-update
+mkdir -p $rootdir/lib/modules
+touch $rootdir/boot/start.elf
+chroot $rootdir rpi-update
+&lt;/pre&gt;&lt;/p&gt;
+
+&lt;p&gt;Next, fetch the latest vmdebootstrap script and call it like this
+to build the image:&lt;/p&gt;
+
+&lt;pre&gt;
+sudo ./vmdebootstrap \
+    --variant minbase \
+    --arch armel \
+    --distribution jessie \
+    --mirror http://http.debian.net/debian \
+    --image test.img \
+    --size 600M \
+    --bootsize 64M \
+    --boottype vfat \
+    --log-level debug \
+    --verbose \
+    --no-kernel \
+    --no-extlinux \
+    --root-password raspberry \
+    --hostname raspberrypi \
+    --foreign /usr/bin/qemu-arm-static \
+    --customize `pwd`/customize \
+    --package netbase \
+    --package git-core \
+    --package binutils \
+    --package ca-certificates \
+    --package wget \
+    --package kmod
+&lt;/pre&gt;&lt;/p&gt;
+
+&lt;p&gt;The list of packages being installed are the ones needed by
+rpi-update to make the image bootable on the Raspberry Pi, with the
+exception of netbase, which is needed by debootstrap to find
+/etc/hosts with the minbase variant.  I really wish there was a way to
+set up an Raspberry Pi using only packages in the Debian archive, but
+that is not possible as far as I know, because it boots from the GPU
+using a non-free binary blob.&lt;/p&gt;
+
+&lt;p&gt;The build host need debootstrap, kpartx and qemu-user-static and
+probably a few others installed.  I have not checked the complete
+build dependency list.&lt;/p&gt;
+
+&lt;p&gt;The resulting image will not use the hardware floating point unit
+on the Raspberry PI, because the armel architecture in Debian is not
+optimized for that use.  So the images created will be a bit slower
+than &lt;a href=&quot;http://www.raspbian.org/&quot;&gt;Raspbian&lt;/a&gt; based images.&lt;/p&gt;
+</description>
+       </item>
+       
+       <item>
+               <title>Det er jo makta som er mest sårbar ved massiv overvåkning av Internett</title>
+               <link>http://people.skolelinux.org/pere/blog/Det_er_jo_makta_som_er_mest_s_rbar_ved_massiv_overv_kning_av_Internett.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Det_er_jo_makta_som_er_mest_s_rbar_ved_massiv_overv_kning_av_Internett.html</guid>
+                <pubDate>Sat, 26 Oct 2013 20:30:00 +0200</pubDate>
+               <description>&lt;p&gt;De siste måneders eksponering av
+&lt;a href=&quot;http://www.aftenposten.no/nyheter/uriks/Her-er-Edvard-Snowdens-mest-omtalte-avsloringer-7351734.html&quot;&gt;den
+totale overvåkningen som foregår i den vestlige verden dokumenterer
+hvor sårbare vi er&lt;/a&gt;.  Men det slår meg at de som er mest sårbare
+for dette, myndighetspersoner på alle nivåer, neppe har innsett at de
+selv er de mest interessante personene å lage profiler på, for å kunne
+påvirke dem.&lt;/p&gt;
+
+&lt;p&gt;For å ta et lite eksempel: Stortingets nettsted,
+&lt;a href=&quot;http://www.stortinget.no/&quot;&gt;www.stortinget.no&lt;/a&gt; (og
+forsåvidt også
+&lt;a href=&quot;http://data.stortinget.no/&quot;&gt;data.stortinget.no&lt;/a&gt;),
+inneholder informasjon om det som foregår på Stortinget, og jeg antar
+de største brukerne av informasjonen der er representanter og
+rådgivere på Stortinget.  Intet overraskende med det.  Det som derimot
+er mer skjult er at Stortingets nettsted bruker
+&lt;a href=&quot;http://en.wikipedia.org/wiki/Google_Analytics&quot;&gt;Google
+Analytics&lt;/a&gt;, hvilket gjør at enhver som besøker nettsidene der også
+rapporterer om besøket via Internett-linjer som passerer Sverige,
+England og videre til USA.  Det betyr at informasjon om ethvert besøk
+på stortingets nettsider kan snappes opp av svensk, britisk og USAs
+etterretningsvesen.  De kan dermed holde et øye med hvilke
+Stortingssaker stortingsrepresentantene synes er interessante å sjekke
+ut, og hvilke sider rådgivere og andre på stortinget synes er
+interessant å besøke, når de gjør det og hvilke andre representanter
+som sjekker de samme sidene omtrent samtidig.  Stortingets bruk av
+Google Analytics gjør det dermed enkelt for utenlands etteretning å
+spore representantenes aktivitet og interesse.  Hvis noen av
+representantene bruker Google Mail eller noen andre tjenestene som
+krever innlogging, så vil det være enda enklere å finne ut nøyaktig
+hvilke personer som bruker hvilke nettlesere og dermed knytte
+informasjonen opp til enkeltpersoner på Stortinget.&lt;/p&gt;
+
+&lt;p&gt;Og jo flere nettsteder som bruker Google Analytics, jo bedre
+oversikt over stortingsrepresentantenes lesevaner og interesse blir
+tilgjengelig for svensk, britisk og USAs etterretning.  Hva de kan
+bruke den informasjonen til overlater jeg til leseren å undres
+over.&lt;/p&gt;
+</description>
+       </item>
+       
+       <item>
+               <title>A Raspberry Pi based batman-adv Mesh network node</title>
+               <link>http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html</guid>
+                <pubDate>Mon, 21 Oct 2013 11:40:00 +0200</pubDate>
+               <description>&lt;p&gt;The last few days I have been experimenting with
+&lt;a href=&quot;http://www.open-mesh.org/projects/batman-adv/wiki&quot;&gt;the
+batman-adv mesh technology&lt;/a&gt;.  I want to gain some experience to see
+if it will fit &lt;a href=&quot;https://wiki.debian.org/FreedomBox&quot;&gt;the
+Freedombox project&lt;/a&gt;, and together with my neighbors try to build a
+mesh network around the park where I live.  Batman-adv is a layer 2
+mesh system (&quot;ethernet&quot; in other words), where the mesh network appear
+as if all the mesh clients are connected to the same switch.&lt;/p&gt;
+
+&lt;p&gt;My hardware of choice was the Linksys WRT54GL routers I had lying
+around, but I&#39;ve been unable to get them working with batman-adv.  So
+instead, I started playing with a
+&lt;a href=&quot;http://www.raspberrypi.org/&quot;&gt;Raspberry Pi&lt;/a&gt;, and tried to
+get it working as a mesh node.  My idea is to use it to create a mesh
+node which function as a switch port, where everything connected to
+the Raspberry Pi ethernet plug is connected (bridged) to the mesh
+network.  This allow me to hook a wifi base station like the Linksys
+WRT54GL to the mesh by plugging it into a Raspberry Pi, and allow
+non-mesh clients to hook up to the mesh.  This in turn is useful for
+Android phones using &lt;a href=&quot;http://servalproject.org/&quot;&gt;the Serval
+Project&lt;/a&gt; voip client, allowing every one around the playground to
+phone and message each other for free.  The reason is that Android
+phones do not see ad-hoc wifi networks (they are filtered away from
+the GUI view), and can not join the mesh without being rooted.  But if
+they are connected using a normal wifi base station, they can talk to
+every client on the local network.&lt;/p&gt;
+
+&lt;p&gt;To get this working, I&#39;ve created a debian package
+&lt;a href=&quot;https://github.com/petterreinholdtsen/meshfx-node&quot;&gt;meshfx-node&lt;/a&gt;
+and a script
+&lt;a href=&quot;https://github.com/petterreinholdtsen/meshfx-node/blob/master/build-rpi-mesh-node&quot;&gt;build-rpi-mesh-node&lt;/a&gt;
+to create the Raspberry Pi boot image.  I&#39;m using Debian Jessie (and
+not Raspbian), to get more control over the packages available.
+Unfortunately a huge binary blob need to be inserted into the boot
+image to get it booting, but I&#39;ll ignore that for now.  Also, as
+Debian lack support for the CPU features available in the Raspberry
+Pi, the system do not use the hardware floating point unit.  I hope
+the routing performance isn&#39;t affected by the lack of hardware FPU
+support.&lt;/p&gt;
+
+&lt;p&gt;To create an image, run the following with a sudo enabled user
+after inserting the target SD card into the build machine:&lt;/p&gt;
+
+&lt;p&gt;&lt;pre&gt;
+% wget -O build-rpi-mesh-node \
+    https://raw.github.com/petterreinholdtsen/meshfx-node/master/build-rpi-mesh-node
+% sudo bash -x ./build-rpi-mesh-node &gt; build.log 2&gt;&amp;1
+% dd if=/root/rpi/rpi_basic_jessie_$(date +%Y%m%d).img of=/dev/mmcblk0 bs=1M
+%
+&lt;/pre&gt;&lt;/p&gt;
+
+&lt;p&gt;Booting with the resulting SD card on a Raspberry PI with a USB
+wifi card inserted should give you a mesh node.  At least it does for
+me with a the wifi card I am using. The default mesh settings are the
+ones used by the Oslo mesh project at Hackeriet, as I mentioned in
+&lt;a href=&quot;http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html&quot;&gt;an
+earlier blog post about this mesh testing&lt;/a&gt;.&lt;/p&gt;
+
+&lt;p&gt;The mesh node was not horribly expensive either.  I bought
+everything over the counter in shops nearby.  If I had ordered online
+from the lowest bidder, the price should be significantly lower:&lt;/p&gt;
+
+&lt;p&gt;&lt;table&gt;
+
+&lt;tr&gt;&lt;th&gt;Supplier&lt;/th&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;NOK&lt;/th&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;Teknikkmagasinet&lt;/td&gt;&lt;td&gt;Raspberry Pi model B&lt;/td&gt;&lt;td&gt;349.90&lt;/td&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;Teknikkmagasinet&lt;/td&gt;&lt;td&gt;Raspberry Pi type B case&lt;/td&gt;&lt;td&gt;99.90&lt;/td&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;Lefdal&lt;/td&gt;&lt;td&gt;Jensen Air:Link 25150&lt;/td&gt;&lt;td&gt;295.-&lt;/td&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;Clas Ohlson&lt;/td&gt;&lt;td&gt;Kingston 16 GB SD card&lt;/td&gt;&lt;td&gt;199.-&lt;/td&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;Total cost&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;943.80&lt;/td&gt;&lt;/tr&gt;
+
+&lt;/table&gt;&lt;/p&gt;
+
+&lt;p&gt;Now my mesh network at home consist of one laptop in the basement
+connected to my production network, one Raspberry Pi node on the 1th
+floor that can be seen by my neighbor across the park, and one
+play-node I use to develop the image building script.  And some times
+I hook up my work horse laptop to the mesh to test it.  I look forward
+to figuring out what kind of latency the batman-adv setup will give,
+and how much packet loss we will experience around the park. :)&lt;/p&gt;
+</description>
+       </item>
+       
+       <item>
+               <title>Perl library to control the Spykee robot moved to github</title>
+               <link>http://people.skolelinux.org/pere/blog/Perl_library_to_control_the_Spykee_robot_moved_to_github.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Perl_library_to_control_the_Spykee_robot_moved_to_github.html</guid>
+                <pubDate>Sat, 19 Oct 2013 10:20:00 +0200</pubDate>
+               <description>&lt;p&gt;Back in 2010, I created a Perl library to talk to
+&lt;a href=&quot;http://en.wikipedia.org/wiki/Spykee&quot;&gt;the Spykee robot&lt;/a&gt;
+(with two belts, wifi, USB and Linux) and made it available from my
+web page.  Today I concluded that it should move to a site that is
+easier to use to cooperate with others, and moved it to github.  If
+you got a Spykee robot, you might want to check out
+&lt;a href=&quot;https://github.com/petterreinholdtsen/libspykee-perl&quot;&gt;the
+libspykee-perl github repository&lt;/a&gt;.&lt;/p&gt;
+</description>
+       </item>
+       
+       <item>
+               <title>Good causes: Debian Outreach Program for Women, EFF documenting the spying and Open access in Norway</title>
+               <link>http://people.skolelinux.org/pere/blog/Good_causes__Debian_Outreach_Program_for_Women__EFF_documenting_the_spying_and_Open_access_in_Norway.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Good_causes__Debian_Outreach_Program_for_Women__EFF_documenting_the_spying_and_Open_access_in_Norway.html</guid>
+                <pubDate>Tue, 15 Oct 2013 21:30:00 +0200</pubDate>
+               <description>&lt;p&gt;The last few days I came across a few good causes that should get
+wider attention.  I recommend signing and donating to each one of
+these. :)&lt;/p&gt;
+
+&lt;p&gt;Via &lt;a href=&quot;http://www.debian.org/News/weekly/2013/18/&quot;&gt;Debian
+Project News for 2013-10-14&lt;/a&gt; I came across the Outreach Program for
+Women program which is a Google Summer of Code like initiative to get
+more women involved in free software.  One debian sponsor has offered
+to match &lt;a href=&quot;http://debian.ch/opw2013&quot;&gt;any donation done to Debian
+earmarked&lt;/a&gt; for this initiative.  I donated a few minutes ago, and
+hope you will to. :)&lt;/p&gt;
+
+&lt;p&gt;And the Electronic Frontier Foundation just announced plans to
+create &lt;a href=&quot;https://supporters.eff.org/donate/nsa-videos&quot;&gt;video
+documentaries about the excessive spying&lt;/a&gt; on every Internet user that
+take place these days, and their need to fund the work.  I&#39;ve already
+donated.  Are you next?&lt;/p&gt;
+
+&lt;p&gt;For my Norwegian audience, the organisation Studentenes og
+Akademikernes Internasjonale Hjelpefond is collecting signatures for a
+statement under the heading
+&lt;a href=&quot;http://saih.no/Bloggers_United/&quot;&gt;Bloggers United for Open
+Access&lt;/a&gt; for those of us asking for more focus on open access in the
+Norwegian government.  So far 499 signatures.  I hope you will sign it
+too.&lt;/p&gt;
+</description>
+       </item>
+       
        <item>
                <title>Oslo community mesh network - with NUUG and Hackeriet at Hausmania</title>
                <link>http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html</link>        
@@ -66,7 +364,7 @@ There are heaps of different protocols, and I am still struggling to
 figure out which one would be &quot;best&quot; for some definitions of best, but
 given that the community mesh group in Oslo is so small, I believe it
 is best to hook up with the existing one instead of trying to create a
-completely different setup, and thus this have decided to focus on
+completely different setup, and thus I have decided to focus on
 batman-adv for now.  It sure help me to  know that the very cool
 &lt;a href=&quot;http://www.servalproject.org/&quot;&gt;Serval project in Australia&lt;/a&gt;
 is using batman-adv as their meshing technology when it create a self
@@ -84,7 +382,7 @@ packets across mesh networks, and OLSR, B.A.T.M.A.N. and
 B.A.T.M.A.N. advanced are protocols used by several free software
 based community mesh networks.&lt;/p&gt;
 
-&lt;/p&gt;The batman-adv protocol is a bit special, as it provide layer 2
+&lt;p&gt;The batman-adv protocol is a bit special, as it provide layer 2
 (as in ethernet ) routing, allowing ipv4 and ipv6 to work on the same
 network.  One way to think about it is that it provide a mesh based
 vlan you can bridge to or handle like any other vlan connected to your
@@ -94,13 +392,13 @@ least since Debian Wheezy, and it is fairly easy to set up.  A
 introduction&lt;/a&gt; is available from the Open Mesh project.  These are
 the key settings needed to join the Oslo meshfx network:&lt;/p&gt;
 
-&lt;table&gt;
+&lt;p&gt;&lt;table&gt;
 &lt;tr&gt;&lt;th&gt;Setting&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;
 &lt;tr&gt;&lt;td&gt;Protocol / kernel module&lt;/td&gt;&lt;td&gt;batman-adv&lt;/td&gt;&lt;/tr&gt;
 &lt;tr&gt;&lt;td&gt;ESSID&lt;/td&gt;&lt;td&gt;meshfx@hackeriet&lt;/td&gt;&lt;/tr&gt;
 &lt;td&gt;Channel / Frequency&lt;/td&gt;&lt;td&gt;11 / 2462&lt;/td&gt;&lt;/tr&gt;
 &lt;td&gt;Cell ID&lt;/td&gt;&lt;td&gt;02:BA:00:00:00:01&lt;/td&gt;
-&lt;/table&gt;
+&lt;/table&gt;&lt;/p&gt;
 
 &lt;p&gt;The reason for setting ad-hoc wifi Cell ID is to work around bugs
 in firmware used in wifi card and wifi drivers.  (See a nice post from
@@ -134,6 +432,12 @@ commercial companies, even though Telenor discovered that it was hard
 to figure out a good business plan for mesh networking and as far as I
 know have closed down the experiment.  Perhaps Telenor or others would
 be interested in a cooperation?&lt;/p&gt;
+
+&lt;p&gt;&lt;strong&gt;Update 2013-10-12&lt;/strong&gt;: I was just
+&lt;a href=&quot;http://lists.alioth.debian.org/pipermail/freedombox-discuss/2013-October/005900.html&quot;&gt;told
+by the Serval project developers&lt;/a&gt; that they no longer use
+batman-adv (but are compatible with it), but their own crypto based
+mesh system.&lt;/p&gt;
 </description>
        </item>