- <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><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 the FreedomBox project.
-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>
- <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
-totale overvåkningen som foregår i den vestlige verden dokumenterer
-hvor sårbare vi er</a>. 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.</p>
-
-<p>For å ta et lite eksempel: Stortingets nettsted,
-<a href="http://www.stortinget.no/">www.stortinget.no</a> (og
-forsåvidt også
-<a href="http://data.stortinget.no/">data.stortinget.no</a>),
-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
-<a href="http://en.wikipedia.org/wiki/Google_Analytics">Google
-Analytics</a>, 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.</p>
-
-<p>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.</p>
-</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><p>The last few days I have been experimenting with
-<a href="http://www.open-mesh.org/projects/batman-adv/wiki">the
-batman-adv mesh technology</a>. I want to gain some experience to see
-if it will fit <a href="https://wiki.debian.org/FreedomBox">the
-Freedombox project</a>, 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 ("ethernet" in other words), where the mesh network appear
-as if all the mesh clients are connected to the same switch.</p>
-
-<p>My hardware of choice was the Linksys WRT54GL routers I had lying
-around, but I've been unable to get them working with batman-adv. So
-instead, I started playing with a
-<a href="http://www.raspberrypi.org/">Raspberry Pi</a>, 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 <a href="http://servalproject.org/">the Serval
-Project</a> 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.</p>
-
-<p>To get this working, I've created a debian package
-<a href="https://github.com/petterreinholdtsen/meshfx-node">meshfx-node</a>
-and a script
-<a href="https://github.com/petterreinholdtsen/meshfx-node/blob/master/build-rpi-mesh-node">build-rpi-mesh-node</a>
-to create the Raspberry Pi boot image. I'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'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't affected by the lack of hardware FPU
-support.</p>
-
-<p>To create an image, run the following with a sudo enabled user
-after inserting the target SD card into the build machine:</p>
-
-<p><pre>
-% 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 > build.log 2>&1
-% dd if=/root/rpi/rpi_basic_jessie_$(date +%Y%m%d).img of=/dev/mmcblk0 bs=1M
-%
-</pre></p>
-
-<p>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
-<a href="http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html">an
-earlier blog post about this mesh testing</a>.</p>
-
-<p>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:</p>
-
-<p><table>
-
-<tr><th>Supplier</th><th>Model</th><th>NOK</th></tr>
-<tr><td>Teknikkmagasinet</td><td>Raspberry Pi model B</td><td>349.90</td></tr>
-<tr><td>Teknikkmagasinet</td><td>Raspberry Pi type B case</td><td>99.90</td></tr>
-<tr><td>Lefdal</td><td>Jensen Air:Link 25150</td><td>295.-</td></tr>
-<tr><td>Clas Ohlson</td><td>Kingston 16 GB SD card</td><td>199.-</td></tr>
-<tr><td>Total cost</td><td></td><td>943.80</td></tr>
-
-</table></p>
-
-<p>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. :)</p>
-</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><p>Back in 2010, I created a Perl library to talk to
-<a href="http://en.wikipedia.org/wiki/Spykee">the Spykee robot</a>
-(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
-<a href="https://github.com/petterreinholdtsen/libspykee-perl">the
-libspykee-perl github repository</a>.</p>
+ <title>Hvordan bør RFC 822-formattert epost lagres i en NOARK5-database?</title>
+ <link>http://people.skolelinux.org/pere/blog/Hvordan_b_r_RFC_822_formattert_epost_lagres_i_en_NOARK5_database_.html</link>
+ <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Hvordan_b_r_RFC_822_formattert_epost_lagres_i_en_NOARK5_database_.html</guid>
+ <pubDate>Fri, 7 Mar 2014 15:20:00 +0100</pubDate>
+ <description><p>For noen uker siden ble NXCs fri programvarelisenserte
+NOARK5-løsning
+<a href="http://www.nuug.no/aktiviteter/20140211-noark/">presentert hos
+NUUG</a> (video
+<a href="https://www.youtube.com/watch?v=JCb_dNS3MHQ">på youtube
+foreløbig</a>), og det fikk meg til å titte litt mer på NOARK5,
+standarden for arkivhåndtering i det offentlige Norge. Jeg lurer på
+om denne kjernen kan være nyttig i et par av mine prosjekter, og for ett
+av dem er det mest aktuelt å lagre epost. Jeg klarte ikke finne noen
+anbefaling om hvordan RFC 822-formattert epost (aka Internett-epost)
+burde lagres i NOARK5, selv om jeg vet at noen arkiver tar
+PDF-utskrift av eposten med sitt epostprogram og så arkiverer PDF-en
+(eller enda værre, tar papirutskrift og lagrer bildet av eposten som
+PDF i arkivet).</p>
+
+<p>Det er ikke så mange formater som er akseptert av riksarkivet til
+langtidsoppbevaring av offentlige arkiver, og PDF og XML er de mest
+aktuelle i så måte. Det slo meg at det måtte da finnes en eller annen
+egnet XML-representasjon og at det kanskje var enighet om hvilken som
+burde brukes, så jeg tok mot til meg og spurte
+<a href="http://samdok.com/">SAMDOK</a>, en gruppe tilknyttet
+arkivverket som ser ut til å jobbe med NOARK-samhandling, om de hadde
+noen anbefalinger:
+
+<p><blockquote>
+<p>Hei.</p>
+
+<p>Usikker på om dette er riktig forum å ta opp mitt spørsmål, men jeg
+lurer på om det er definert en anbefaling om hvordan RFC
+822-formatterte epost (aka vanlig Internet-epost) bør lages håndteres
+i NOARK5, slik at en bevarer all informasjon i eposten
+(f.eks. Received-linjer). Finnes det en anbefalt XML-mapping ala den
+som beskrives på
+&lt;URL: <a href="https://www.informit.com/articles/article.aspx?p=32074">https://www.informit.com/articles/article.aspx?p=32074</a> &gt;? Mitt
+mål er at det skal være mulig å lagre eposten i en NOARK5-kjerne og
+kunne få ut en identisk formattert kopi av opprinnelig epost ved
+behov.</p>
+</blockquote></p>
+
+<p>Postmottaker hos SAMDOK mente spørsmålet heller burde stilles
+direkte til riksarkivet, og jeg fikk i dag svar derfra formulert av
+seniorrådgiver Geir Ivar Tungesvik:</p>
+
+<p><blockquote>
+<p>Riksarkivet har ingen anbefalinger når det gjelder konvertering fra
+e-post til XML. Det står arkivskaper fritt å eventuelt definere/bruke
+eget format. Inklusive da - som det spørres om - et format der det er
+mulig å re-etablere e-post format ut fra XML-en. XML (e-post)
+dokumenter må være referert i arkivstrukturen, og det må vedlegges et
+gyldig XML skjema (.xsd) for XML-filene. Arkivskaper står altså fritt
+til å gjøre hva de vil, bare det dokumenteres og det kan dannes et
+utrekk ved avlevering til depot.</p>
+
+<p>De obligatoriske kravene i Noark 5 standarden må altså oppfylles -
+etter dialog med Riksarkivet i forbindelse med godkjenning. For
+offentlige arkiv er det særlig viktig med filene loependeJournal.xml
+og offentligJournal.xml. Private arkiv som vil forholde seg til Noark
+5 standarden er selvsagt frie til å bruke det som er relevant for dem
+av obligatoriske krav.</p>
+</blockquote></p>
+
+<p>Det ser dermed ut for meg som om det er et lite behov for å
+standardisere XML-lagring av RFC-822-formatterte meldinger. Noen som
+vet om god spesifikasjon i så måte? I tillegg til den omtalt over,
+har jeg kommet over flere aktuelle beskrivelser (søk på "rfc 822
+xml", så finner du aktuelle alternativer).</p>
+
+<ul>
+
+<li><a href="http://www.openhealth.org/xmtp/">XML MIME Transformation
+protocol (XMTP)</a> fra OpenHealth, sist oppdatert 2001.</li>
+
+<li><a href="https://tools.ietf.org/html/draft-klyne-message-rfc822-xml-03">An
+XML format for mail and other messages</a> utkast fra IETF datert
+2001.</li>
+
+<li><a href="http://www.informit.com/articles/article.aspx?p=32074">xMail:
+E-mail as XML</a> en artikkel fra 2003 som beskriver python-modulen
+rfc822 som gir ut XML-representasjon av en RFC 822-formattert epost.</li>
+
+</ul>
+
+<p>Finnes det andre og bedre spesifikasjoner for slik lagring? Send
+meg en epost hvis du har innspill.</p>