Déploiement d’un noyau sur Snowball depuis les sources du noyau Igloo.Deploy Snowball system from Igloo kernel sources with wlan features

Voici un arbre git permettant de déployer un système avec wifi fonctionnel sur la Snowball de Calao Système en utilisant le noyau fournit par la communauté Igloo.

Pour le recupérer :

git clone https://github.com/Evanok/snowball_builder.git.

Vous pouvez aussi télécharger directement la tarball correspondant au dernier commit de l’arbre pour ne pas vous embarrasser de l’arbre git complet :

wget https://github.com/Evanok/snowball_builder/tarball/master -O snowball_builder.tar.gz

Dans l’arborescence du projet, vous trouverez un Makefile. Vous n’avez qu’a faire make pour démarrer la construction du système avec les paramètres par défauts. A savoir un noyau Android 3.3 avec une distribution Debian.

Les deux principaux éléments du projet sont le script builder.sh et le script shell config_creator. Ce sont donc ces deux fichiers que vous devrez modifier pour toute modification de la procédure.

Dans builder.sh, les étapes sont :

  • Récupération des éléments necessaires : source du noyau Igloo, compilateur croisé ARM
  • Génération du uImage à l’aide du configure donné en paramètre
  • Génération des modules noyaux
  • Génération de 3 scripts utilisés par multistrap pour générer le rootfs à l’aide de config_creator
  • Construction du rootfs à l’aide du multistrap

Description des scripts utilisés par multistrap :

snowball_multistrap_configuration 

C’est le principal script utilisé par multistrap, il fera référence aux deux autres. Vous pouvez y ajouter par exemple les paquets installés à la génération du système.

snowball_setup_script.sh

Ce script défini les opérations à effectuer sur le rootfs avant de le compresser sous la forme d’une tarball. On y défini les utilisateurs, récupère les modules du noyau, défini le fichier network/interfaces ou encore procédons à la création de certain bloc de /dev. Si vous souhaitez ajouter des élements au rootfs pendant la génération c’est ici que vous devrez effectuer vos modifications.

snowball_config_script.sh

Ce script permettra de configurer la Snowball lors du premier démarrage. On en profitera aussi pour installer le patch du package debian bluez ainsi que de proceder au test du wlan.

Le système déployée par défaut est un noyau Android et une distribution Debian Squeeze. En effet ici seul nous intéresse la fonctionnalité du WIFI.

Enfin un script permet de déployer de façon automatisée le système produit sur une micro sd. Attention votre carte micro sd devra avoir été formatée correctement auparavant en deux partitions afin d’y recueillir l’image du noyau d’un coté et le rootfs de l’autre.

Ensuite vous n’avez plus qu’a démarrer votre Snowball avec la sd carte. Attention votre Snowball doit être reliée à internet par le port Ethernet au démarrage. Une fois démarrée, vous n’avez plus qu’a lancer le script de configuration /snowball_config_script.sh

Enfin pour déployer le wifi au démarrage après chaque redémarrage de la Snowball :

  • hciattach -a 23 -n -s 115200 /dev/ttyAMA0 cg2900 115200 flow &
  • modprobe cw1200_core
  • modprobe cw1200_wlan
  • ifconfig wlan0 up

Et voila, on va pouvoir commencer à faire mumuse avec notre nouveau jouet.

This is a git tree which allow you to deploy a Snowball system from Igloo kernel sources with wlan features.

Get the git tree :

git clone https://github.com/Evanok/snowball_builder.git.

You can also download directly the tarball which fetch the last commit of the git tree to have lighter Snowball builder :

wget https://github.com/Evanok/snowball_builder/tarball/master -O snowball_builder.tar.gz

In the project tree, you will find a Makefile. You just have to run make to start the building process with default parameters. These defaults parameters are the branch linux-android-3.3 of the igloo kernel and a basic configure. The system will run with Debian Squeeze distribution.

The two most important files of the project tree are the script builder.sh and config_creator.sh. Theses two scripts must be modify if you wan customize your building process.

builder.sh steps :

  • Clone some git trees : Igloo kernel sources, cross arm compiler
  • Building uImage
  • Installing kernel modules
  • Generate scripts ubing by Multistrap
  • Building rootfs with Multistrap

Description of scripts using by Multistrap

snowball_multistrap_configuration 

Main script using by Multistrap, you can find for example debian package installed in the Snowball system

snowball_setup_script.sh

This script define command to run before compress the rootfs. We will define users, copying kernel modules in rootfs, define some configurations files like network/interfaces… If you want add some directory to the rootfs, you must customize this script !

snowball_config_script.sh

This script will allow to configure the Snowball system at the first booting. For example we will mount /proc or installing bluez package patch for hciattach command.

Finaly a script which allow to deploy Snowball system on micro sd card. Be carefull, your sd card must be partionned correctly. You must have two partitions, in one hand, a partition for kernel image and in the other hand a partition for the rootfs.

Ensuite vous n’avez plus qu’a démarrer votre Snowball avec la sd carte. Attention votre Snowball doit être reliée à internet par le port Ethernet au démarrage. Une fois démarrée, vous n’avez plus qu’a lancer le script de configuration /snowball_config_script.sh

Next you just have to boot yoour Snowball with micro sd card. With some Snowball you must use Ethernet cable to connect your Snowball to Internet to boot it correctly. After booting, you just have to run the configuration script : /snowball_config_script.sh which configure the rootfs the first time that you start your system board.

To enable wlan, command are :

  • hciattach -a 23 -n -s 115200 /dev/ttyAMA0 cg2900 115200 flow &
  • modprobe cw1200_core
  • modprobe cw1200_wlan
  • ifconfig wlan0 up

And now we can start to play we our new toy !

Choix d’une carte embarquée

Après une première prospection voici les cartes qui ont été envisagé:

Mes besoins sont:
  • Connexion pour Camera
  • Port permettant de communiquer avec la carte arduino qui contrôle les moteurs
  • Puissance pour faire du traitement d’image simple
  • Wifi ( eventuellement on peut rajouter le wifi via une extension ou une carte dédiée)

Voici un début de tableau afin de comparer leur caractéristiques

Nom de la carteARCHFréquence (Mhz)Mémoire (MB)Energie (ma/V)PortsDimensionPrix
Pico-SAM9G45
ARM940025650 / 3USB 2.0 * 4
Ethernet
Carte SIM
MicroSD
extension RS232,I2C, WIFI; SPI
80x10085
Raspberry Pi ARM11700256700 / 5 - 1 WattsUSB 2.0
HDMI
SD Card
Ethernet
GPIO
85x5425
BeagleBoneARM87002561 mAH / 3USB
SD
Ethernet
JTAG
86×5475
FOX Board G20
ARM940060 / 5USB
SD
Ethernet
I2C, SPI
66x58166
TS-7553ARM92502563.2 WattsSD
USB
Ethernet
Xbee
I2C, SPI
2 * RS232, RS485, CAN
42x3683
TNY-A9263-C0X ARM8200256250 / 5USB
I2C, SPI
Ethernet
41x36160
SnowballARM910001024250 / 5Wifi
Ethernet
USB
RS232
I2C, SPI, UART
HDMI
SD
JTAG
Bluetooth
Accelero, GPS, Magneto, Gyro
85x85230