<channel>
<title>Petter Reinholdtsen - Entries from October 2013</title>
<description>Entries from October 2013</description>
- <link>http://people.skolelinux.org/pere/blog/</link>
+ <link>https://people.skolelinux.org/pere/blog/</link>
+ <item>
+ <title>Teaching vmdebootstrap to create Raspberry Pi SD card images</title>
+ <link>https://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html</link>
+ <guid isPermaLink="true">https://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><p>The
+<a href="http://packages.qa.debian.org/v/vmdebootstrap.html">vmdebootstrap</a>
+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
+<a href="https://wiki.debian.org/RaspberryPi">Raspberry Pi</a>, as part
+of a plan to simplify the build system for
+<a href="https://wiki.debian.org/FreedomBox">the FreedomBox
+project</a>. 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.</p>
+
+<p>Armed with the knowledge on how to build "foreign" (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
+<a href="http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html">Debian
+Jessie based mesh node images for the Raspberry Pi</a>. First, the
+<tt>--foreign /path/to/binfm_handler</tt> 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 <tt>--bootsize size</tt> and <tt>--boottype
+fstype</tt> 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 <tt>--variant
+variant</tt> option to allow me to create smaller images without the
+Debian base system packages installed. Finally, I added an option
+<tt>--no-extlinux</tt> 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
+<a href="http://git.liw.fi/cgi-bin/cgit/cgit.cgi/vmdebootstrap/">the
+upstream project page</a>.</p>
+
+<p>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:</p>
+
+<p><pre>
+#!/bin/sh
+set -e # Exit on first error
+rootdir="$1"
+cd "$rootdir"
+cat &lt;&lt;EOF > 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
+</pre></p>
+
+<p>Next, fetch the latest vmdebootstrap script and call it like this
+to build the image:</p>
+
+<pre>
+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
+</pre></p>
+
+<p>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.</p>
+
+<p>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.</p>
+
+<p>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 <a href="http://www.raspbian.org/">Raspbian</a> based images.</p>
+</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>
+ <link>https://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">https://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><p>De siste måneders eksponering av
<a href="http://www.aftenposten.no/nyheter/uriks/Her-er-Edvard-Snowdens-mest-omtalte-avsloringer-7351734.html">den
<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>
+ <link>https://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html</link>
+ <guid isPermaLink="true">https://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><p>The last few days I have been experimenting with
<a href="http://www.open-mesh.org/projects/batman-adv/wiki">the
<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>
+ <link>https://people.skolelinux.org/pere/blog/Perl_library_to_control_the_Spykee_robot_moved_to_github.html</link>
+ <guid isPermaLink="true">https://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><p>Back in 2010, I created a Perl library to talk to
<a href="http://en.wikipedia.org/wiki/Spykee">the Spykee robot</a>
<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>
+ <link>https://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">https://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><p>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
<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>
- <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html</guid>
+ <link>https://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html</link>
+ <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html</guid>
<pubDate>Fri, 11 Oct 2013 14:10:00 +0200</pubDate>
<description><p>Wireless mesh networks are self organising and self healing
networks that can be used to connect computers across small and large
<item>
<title>Skolelinux / Debian Edu 7.1 install and overview video from Marcelo Salvador</title>
- <link>http://people.skolelinux.org/pere/blog/Skolelinux___Debian_Edu_7_1_install_and_overview_video_from_Marcelo_Salvador.html</link>
- <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Skolelinux___Debian_Edu_7_1_install_and_overview_video_from_Marcelo_Salvador.html</guid>
+ <link>https://people.skolelinux.org/pere/blog/Skolelinux___Debian_Edu_7_1_install_and_overview_video_from_Marcelo_Salvador.html</link>
+ <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Skolelinux___Debian_Edu_7_1_install_and_overview_video_from_Marcelo_Salvador.html</guid>
<pubDate>Tue, 8 Oct 2013 17:10:00 +0200</pubDate>
<description><p>The other day I was pleased and surprised to discover that Marcelo
Salvador had published a