Differences between revisions 1 and 56 (spanning 55 versions)
Revision 1 as of 2012-10-11 20:08:59
Size: 269
Editor: ?SebastianTramp
Comment: initial page
Revision 56 as of 2013-01-11 15:26:24
Size: 12437
Editor: ?ClemensHoffmann
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the University of Leipzig (in german). The original course page is available at
http://bis.informatik.uni-leipzig.de/de/Lehre/1213/WS/LV/DSSNP
= Summary =
FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig (in german).

The original course page is available at http://bis.informatik.uni-leipzig.de/de/Lehre/1213/WS/LV/DSSNP
The practical will be organized in 3-4 hackaktons and a lot of work between these sessions.
The idea of the practical is to extend the freedombox with semantic technologies.

----
<<TableOfContents>>
----

= History =

  * 11.01.2012 - We now have our first freedombox hosted WebIDs
  * 07.12.2012 - short meeting with german results @ http://okfnpad.org/freedomboxleipzig
  * 01.11.2012 - We had our first Hackaton so everybody has his OLinuXino now
  * 22.10.2012 - olimex was really fast, ten nice A13-OLinuXino-WIFI arrived today!
  * 18.10.2012 - We ordered our student hardware: the [[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/|A13-OLinuXino-WIFI]]
  * 12.10.2012 - We now have a mailing list http://lists.informatik.uni-leipzig.de/pipermail/w12.bis.dssnp/
  * 11.10.2012 - first meeting with 5 students, the practical will now start with 6 students
  * 08.10.2012 - introductional talk to the audience of the Software aus Komponenten lesson

= Groups WebIDs =

  * Manuel http://manu.comiles.eu/foaf.rdf#me ([[http://inspector.sindice.com/inspect?url=http://manu.comiles.eu/foaf.rdf%23me|inspect]])
  * Clemens http://dyndns.clelicy.de/me ([[http://inspector.sindice.com/inspect?url=http://dyndns.clelicy.de/me|inspect]])
  * Norman http://id.feedface.de/me ([[http://inspector.sindice.com/inspect?url=http://id.feedface.de/me|inspect]])
  * Seebi http://seebi.homeip.net ([[http://inspector.sindice.com/inspect?url=http://seebi.homeip.net|inspect]])
  * Nate http://fb.comiles.eu/?c=person&id=natanael ([[http://inspector.sindice.com/inspect?url=http%3A%2F%2Ffb.comiles.eu%2F%3Fc%3Dperson%26id%3Dnatanael|inspect]])

= Hardware =

This is our practical hardware, the OLinuXino (actually, we use the WIFI version of it)

[[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/|{{https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/images/A13-OLinuXino-MAXI-WIFI-1.jpg}}]]

[[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/resources/A13-OLINUXINO.pdf|User's manual]]

= Software =

== Basic Installation ==
 * Debian Image: https://dl.dropbox.com/u/27470434/olinuxino-original.img.torrent
 * The A1x Linux Project: http://linux-sunxi.org/Main_Page

== Basic Configuration ==
 * first steps (e.g. WLAN activation): http://lists.informatik.uni-leipzig.de/pipermail/w12.bis.dssnp/2012-October/000062.html

Or with SD device not of exact same size as that image, reinstall its contents onto a freshly partitioned and formatted device:{{{
dd if=/dev/zero of=/dev/sdX bs=512 count=2047
parted -s /dev/sdX -- mktable msdos mkpart primary 1 18 mkpart primary 18 -0
dd if=olinuxino-original.img of=/dev/sdX bs=1024 seek=8 count=1015
mkdosfs /dev/sdX1
mke2fs -T ext3 /dev/sdX2
kpartx -av olinuxino-original.img
mount -o ro /dev/mapper/loop0p1 /mnt
mount /dev/sdX1 /media
rsync -avH /mnt/ /media/
umount /mnt /media
mount -o ro /dev/mapper/loop0p2 /mnt
mount /dev/sdX2 /media
rsync -avH --exclude=/var/cache/apt/archives/ /mnt/ /media/
umount /mnt /media
kpartx -d olinuxino-original.img
}}}

(Second dd command above is crude: ideally we would have the SPL and u-boot binaries as files, as documented at [[http://linux-sunxi.org/FirstSteps]].)

=== Time ===
 * follow http://wiki.debian.org/NTP to configure NTP, after that run `tzselect` to correct the timezone
  * OR read this for the deamon http://www.debianadmin.com/ntp-server-and-client-configuration-in-debian.html

=== Network ===
This section describes how to setup the network connection of your device. Out goal is to have a roaming tolerant setup where the box is reachable from outside despite any odd ISP configurations.

==== Network Manager ====

 0.#0 Find the name of your wifi device with iwconfig (wlanX)
 1. run "apt-get install network-manager"
 2. Copy all your configured Wifis from your desktop or laptop to your board (e.g. via SD-Card) You may find them in /etc/NetworkManager/system-connections and that is the same place, where it has to go in the board.
 3. Make sure all files in /etc/NetworkManager/system-connections have owner root:root and only read and write rights for the owner.
 4. Make sure your wifi device (wlanX) does '''not''' appear in /etc/network/interfaces
 5. Restart your board (power off - wait - power on)

Further reading: http://wiki.debian.org/NetworkManager

==== Network Access for non-root Users ====

{{{
# groupadd -g 3003 aid_inet
# adduser <username> aid_inet
}}}

This is cause by the enabled kernel option: CONFIG_ANDROID_PARANOID_NETWORK
(another reason for a new kernel)

Source: http://forums.debian.net/viewtopic.php?f=5&t=62151

== Usability ==

=== Know if the System is On or Off ===

There is no feedback to know, if the system stopped already after telling it `shutdown -h now` or if the systems is ready with booting if you have it running headless.
I wrote a small [[https://gist.github.com/4053244|init script]] which you have to place in `/etc/init.d/statusled`. To activate it run `update-rc.d statusled defaults`.
Now you can test the script with `service statusled start` or `service statusled stop`.

''Note: you have to use a kernel with GPIO enabled to use this script''

=== Shell ===
For the bash users among us I think it would be helpfully to enable the tab auto completion. You can find the instructions here: http://www.simplylinux.ch/bash-completion-fuer-debian

The tutor of this practical suggests to use `zsh`:-) which has much better completion options as well as a lot of other nice features.

== qemu Emulation ==

todo clemens

== connectivity ==

With the new kernel [[#Kernel_compilation]] it is possible to install and run `miredo` which is an IPv6 tunnel service. With the IPv6 address you can reach your device from everywhere.

=== How to provide a stable WebID over standard networks? ===
  * http://pagekite.net
  * [[FreedomBox/Connections]]

=== How to provide a stable WebID over p2p, crypto networks? ===

  * https://www.torproject.org
  * https://gnunet.org
  * https://freenetproject.org

=== Get the Ethernet mod running (MOD-ENC28J60) ===
To get the [[https://www.olimex.com/Products/Modules/Ethernet/MOD-ENC28J60/|MOD-ENC28J60]] running with the board you need to compile the kernel with [[http://cateee.net/lkddb/web-lkddb/ENC28J60.html|enc28j60]] support as described below and read following discussions:
  * https://www.olimex.com/forum/index.php?topic=462.0
  * http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=18397

I haven't tested this so far

== DSSN ==
=== dssn.js ===
==== DSSN implementation for node.js ====

  * https://github.com/jmandel/node-redland (Norman)
  * https://github.com/antoniogarrote/rdf-raptor-node-js
  * https://github.com/0xfeedface/node_raptor
  * https://github.com/flashingpumpkin/node-pubsub
  * https://github.com/technoweenie/nubnub (Manuel)
  * https://github.com/chjj/node-pingback
  * https://github.com/0xfeedface/re-publish (Seebi)
  * https://github.com/antoniogarrote/rdfstore-js
  * https://github.com/cannelony/node_dstore (Clemens,Seebi)
  * https://github.com/antoniogarrote/NodeJS-WebID-demo
  * http://magnetik.github.com/node-webid-report/ (Clemens)
  * https://launchpad.net/ubuntu/+source/gcc-4.7-armhf-cross
  * http://pump.io/

==== Basic requirements ====

  Install the following packages using aptitude:
    * `build-essential`
    * `gcc-4.7`
    * `librdf0-dev`
    * `libraptor1-dev`


  Set gcc 4.7 as default:
    * `sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 50`
    * `sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.7 50`
    * `sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 50`


  Install Node.js using e.g. this precompiled armhf [[https://github.com/AKSW/dssnp/blob/master/nodejs/node_0.8.14-1_armhf.deb?raw=true|debian package]]:
    * `dpkg -i node_0.8.14-1_armhf.deb`

  Set NODE_PATH:
    * `export NODE_PATH=/usr/local/lib/node_modules`

  Install NPM:
    * [[https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager|NPM]]

==== re:publish ====

  1. Clone [[https://github.com/0xfeedface/re-publish|re:publish]]
  2. Clone [[https://github.com/0xfeedface/node_raptor|node_raptor]]
  3. `export RAPTOR_PREFIX=/usr`
  4. Enter `node_raptor` directory
  5. `npm install -g` (with root)
  6. `npm install -g paperboy`
  8. Enter `republish` directory
  7. Copy `config.js-dist` to `config.js` and adapt it to your needs. For instance set the namespace under which resources should be served (i.e. your domain).
  8. Get a RDF file (e.g. your FOAF profile)
  9. Start the server by passing it the path to the RDF file:
     `node lib/server.js test/data.ttl`

=== xodx ===
Xodx is running on the system. You can get the current develop branch from the [[https://github.com/white-gecko/xodx|git repository]]. Additionally you have to install a web server (I recommend nginx) and a triplestore (best choice is virtuoso).

To get nginx running with php fast cgi you should follow [[http://library.linode.com/web-servers/nginx/php-fastcgi/ubuntu-10.04-lucid|this tutorial]]. You can find the necessary [[https://gist.github.com/4020109|scripts in my gist]].
To get xodx running you can adopt the [[https://gist.github.com/3739707|server configuration for OntoWiki]].

So far I had no success in accessing xodx with my IPv4 address but it works with IPv6 (as you can see it is next generation software :-D )

= Kernel compilation =
Because the kernel in our current image doesn't support the GPIO (all these pins) and IPv6 I'm trying to build a new kernel for us.
Our Debian system is using the unofficial [[ArmHardFloatPort|armhf debian port]] which uses the advantages of the floating point unit on the chip.

== Preparations ==
First you have to check out the kernel sources from [[https://github.com/linux-sunxi/linux-sunxi|linux-sunxi@github]] or download the [[https://github.com/linux-sunxi/linux-sunxi/archive/sunxi-3.0.tar.gz|tar-ball]] and extract it.

Second you have to download the [[https://launchpad.net/linaro-toolchain-binaries/+download|Toolchain]] and extract it and add the `bin/`-Folder to your `$PATH`.

And you need mkimage for uboot

{{{
sudo apt-get install uboot-mkimage
}}}

== Configure and Compile the Kernel ==

{{{
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- a13_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
}}}

  1. load the default configuration for our board
  2. adjust the settings e.g. enable: (you can find the `.config` [[https://github.com/AKSW/dssnp/blob/master/kernel|on github]])
    1. "Device Drivers > Misc devices > An ugly sun4i gpio driver" for GPIO
    2. "Networking support > Networking options > TCP/IP networking > The IPv6 protocol" for IPv6
    3. "Device Drivers > Network device support > Universal TUN/TAP device driver support" for tunnel support (IPv6 with miredo)
    4. "General setup > Prompt for development and/or incomplete code/drivers" and "Device Drivers > Network device support > Ethernet (10 or 100Mbit) > ENC28J60 support" for the Ethernet mod/extension (untested)

{{{
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install
}}}

== Installation ==

If you just want to exchange the kernel of your system which is already on the SD-card you just have to mount both partitions and move the `uImage` to the boot partition and the module to the root-fs.

{{{
cp <kernelsources>/arch/arm/boot/uImage /{mnt|media}/<boot-partition>
cp -r <kernelsources>/output/lib/modules/3.0.42 /{mnt|media}/<root-partition>/lib/modules/
}}}

If you want to build a whole new image with a new kernel you have to read the following sources.

Sources and further reading:
  * http://linux-sunxi.org/Linux
  * http://linux-sunxi.org/FirstSteps
  * https://launchpad.net/linaro-toolchain-binaries/+download

Summary

FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig (in german).

The original course page is available at http://bis.informatik.uni-leipzig.de/de/Lehre/1213/WS/LV/DSSNP The practical will be organized in 3-4 hackaktons and a lot of work between these sessions. The idea of the practical is to extend the freedombox with semantic technologies.



History

  • 11.01.2012 - We now have our first freedombox hosted WebIDs
  • 07.12.2012 - short meeting with german results @ http://okfnpad.org/freedomboxleipzig

  • 01.11.2012 - We had our first Hackaton so everybody has his OLinuXino now
  • 22.10.2012 - olimex was really fast, ten nice A13-OLinuXino-WIFI arrived today!
  • 18.10.2012 - We ordered our student hardware: the A13-OLinuXino-WIFI

  • 12.10.2012 - We now have a mailing list http://lists.informatik.uni-leipzig.de/pipermail/w12.bis.dssnp/

  • 11.10.2012 - first meeting with 5 students, the practical will now start with 6 students
  • 08.10.2012 - introductional talk to the audience of the Software aus Komponenten lesson

Groups WebIDs

Hardware

This is our practical hardware, the OLinuXino (actually, we use the WIFI version of it)

https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/

User's manual

Software

Basic Installation

Basic Configuration

Or with SD device not of exact same size as that image, reinstall its contents onto a freshly partitioned and formatted device:

dd if=/dev/zero of=/dev/sdX bs=512 count=2047
parted -s /dev/sdX -- mktable msdos mkpart primary 1 18 mkpart primary 18 -0
dd if=olinuxino-original.img of=/dev/sdX bs=1024 seek=8 count=1015
mkdosfs /dev/sdX1
mke2fs -T ext3 /dev/sdX2
kpartx -av olinuxino-original.img
mount -o ro /dev/mapper/loop0p1 /mnt
mount /dev/sdX1 /media
rsync -avH /mnt/ /media/
umount /mnt /media
mount -o ro /dev/mapper/loop0p2 /mnt
mount /dev/sdX2 /media
rsync -avH --exclude=/var/cache/apt/archives/ /mnt/ /media/
umount /mnt /media
kpartx -d olinuxino-original.img

(Second dd command above is crude: ideally we would have the SPL and u-boot binaries as files, as documented at http://linux-sunxi.org/FirstSteps.)

Time

Network

This section describes how to setup the network connection of your device. Out goal is to have a roaming tolerant setup where the box is reachable from outside despite any odd ISP configurations.

Network Manager

  1. Find the name of your wifi device with iwconfig (wlanX)
  2. run "apt-get install network-manager"
  3. Copy all your configured Wifis from your desktop or laptop to your board (e.g. via SD-Card) You may find them in /etc/NetworkManager/system-connections and that is the same place, where it has to go in the board.
  4. Make sure all files in /etc/NetworkManager/system-connections have owner root:root and only read and write rights for the owner.
  5. Make sure your wifi device (wlanX) does not appear in /etc/network/interfaces

  6. Restart your board (power off - wait - power on)

Further reading: http://wiki.debian.org/NetworkManager

Network Access for non-root Users

# groupadd -g 3003 aid_inet
# adduser <username> aid_inet

This is cause by the enabled kernel option: CONFIG_ANDROID_PARANOID_NETWORK (another reason for a new kernel)

Source: http://forums.debian.net/viewtopic.php?f=5&t=62151

Usability

Know if the System is On or Off

There is no feedback to know, if the system stopped already after telling it shutdown -h now or if the systems is ready with booting if you have it running headless. I wrote a small init script which you have to place in /etc/init.d/statusled. To activate it run update-rc.d statusled defaults. Now you can test the script with service statusled start or service statusled stop.

Note: you have to use a kernel with GPIO enabled to use this script

Shell

For the bash users among us I think it would be helpfully to enable the tab auto completion. You can find the instructions here: http://www.simplylinux.ch/bash-completion-fuer-debian

The tutor of this practical suggests to use zsh:-) which has much better completion options as well as a lot of other nice features.

qemu Emulation

todo clemens

connectivity

With the new kernel #Kernel_compilation it is possible to install and run miredo which is an IPv6 tunnel service. With the IPv6 address you can reach your device from everywhere.

How to provide a stable WebID over standard networks?

How to provide a stable WebID over p2p, crypto networks?

Get the Ethernet mod running (MOD-ENC28J60)

To get the MOD-ENC28J60 running with the board you need to compile the kernel with enc28j60 support as described below and read following discussions:

I haven't tested this so far

DSSN

dssn.js

DSSN implementation for node.js

Basic requirements

  • Install the following packages using aptitude:
    • build-essential

    • gcc-4.7

    • librdf0-dev

    • libraptor1-dev

    Set gcc 4.7 as default:
    • sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 50

    • sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.7 50

    • sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 50

    Install Node.js using e.g. this precompiled armhf debian package:

    • dpkg -i node_0.8.14-1_armhf.deb

    Set NODE_PATH:
    • export NODE_PATH=/usr/local/lib/node_modules

    Install NPM:

re:publish

  1. Clone re:publish

  2. Clone node_raptor

  3. export RAPTOR_PREFIX=/usr

  4. Enter node_raptor directory

  5. npm install -g (with root)

  6. npm install -g paperboy

  7. Enter republish directory

  8. Copy config.js-dist to config.js and adapt it to your needs. For instance set the namespace under which resources should be served (i.e. your domain).

  9. Get a RDF file (e.g. your FOAF profile)
  10. Start the server by passing it the path to the RDF file:
    • node lib/server.js test/data.ttl

xodx

Xodx is running on the system. You can get the current develop branch from the git repository. Additionally you have to install a web server (I recommend nginx) and a triplestore (best choice is virtuoso).

To get nginx running with php fast cgi you should follow this tutorial. You can find the necessary scripts in my gist. To get xodx running you can adopt the server configuration for OntoWiki.

So far I had no success in accessing xodx with my IPv4 address but it works with IPv6 (as you can see it is next generation software :-D )

Kernel compilation

Because the kernel in our current image doesn't support the GPIO (all these pins) and IPv6 I'm trying to build a new kernel for us. Our Debian system is using the unofficial armhf debian port which uses the advantages of the floating point unit on the chip.

Preparations

First you have to check out the kernel sources from linux-sunxi@github or download the tar-ball and extract it.

Second you have to download the Toolchain and extract it and add the bin/-Folder to your $PATH.

And you need mkimage for uboot

sudo apt-get install uboot-mkimage

Configure and Compile the Kernel

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- a13_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
  1. load the default configuration for our board
  2. adjust the settings e.g. enable: (you can find the .config on github)

    1. "Device Drivers > Misc devices > An ugly sun4i gpio driver" for GPIO

    2. "Networking support > Networking options > TCP/IP networking > The IPv6 protocol" for IPv6

    3. "Device Drivers > Network device support > Universal TUN/TAP device driver support" for tunnel support (IPv6 with miredo)

    4. "General setup > Prompt for development and/or incomplete code/drivers" and "Device Drivers > Network device support > Ethernet (10 or 100Mbit) > ENC28J60 support" for the Ethernet mod/extension (untested)

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install

Installation

If you just want to exchange the kernel of your system which is already on the SD-card you just have to mount both partitions and move the uImage to the boot partition and the module to the root-fs.

cp <kernelsources>/arch/arm/boot/uImage /{mnt|media}/<boot-partition>
cp -r <kernelsources>/output/lib/modules/3.0.42 /{mnt|media}/<root-partition>/lib/modules/

If you want to build a whole new image with a new kernel you have to read the following sources.

Sources and further reading:


CategoryFreedomBox