planet embedded

August 28, 2010

Thiago de Freitas Oliveira Araujo

Gstreamer Multicast Client – Returning Console, running on boot(example on mini 2440, FriendlyArm)

Instal the gstreamer main components:

:~$ apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-good  gstreamer0.10-plugins-ugly gstreamer0.10-tools gstreamer0.10-alsa

Create the Script, and set it to the ip of the VLC UDP multicast server.

:~$ vim /etc/init.d/gst.sh

#!/bin/sh
killall gst-launch-0.10
gst-launch-0.10 udpsrc port=1234 multicast-group=239.255.12.42 ! decodebin ! audioconvert ! alsasink

To run it on boot, simply do:

:~$ update-rc.d gst.sh defaults

by thiagodefreitas at August 28, 2010 06:34 PM

Vlc Multicast Client – Returning Console, running on boot(example on mini 2440, FriendlyArm)

Install VlC

:~$ apt-get install vlc

Create the Script, and set it to the ip of the VLC UDP multicast server and “–rc-fake-tty” returns it to the prompt after running the command.

:~$ vim /etc/init.d/vlc.sh

#!/bin/sh

killall vlc
vlc -vvv –daemon udp:@239.255.12.42 –rc-fake-tty

To run it on boot, simply do:

:~$ update-rc.d vlc.sh defaults

by thiagodefreitas at August 28, 2010 06:23 PM

August 27, 2010

Thiago de Freitas Oliveira Araujo

Creating a YAFFS2 Debian root File System to run on FLASH – Friendly Arm Mini 2440, using Multistrap

Creating a YAFFS2 Debian root File System to run on FLASH – Friendly Arm Mini 2440, using Multistrap:

  • Firstly , install multistrap on a Linux Distribution ( I used Ubuntu, for this purpose)

apt-get install multistrap
sudo multistrap -f grip-config

[Link to grip-cofig]

  • Cross-Compiling the Kernel Modules and install it to your Debian FileSytem:

Follow the guide , on the site : http://billforums.station51.net/viewtopic.php?f=4&t=20

Install the modules on the PATH of your multistrap generated(~/nfs/lib/modules/)

* It may be necessary to create a symlink from 2.6.32-rc8 to 2.6.32.2-FriendlyARM as this folder may be not recognized on boot.

My way of accessing the files was by NFS****(check how to make the NFS mount on the end of this post).

  • Chrooting on the File System

chroot nfsmount
The following commands are necessary to make adjustments for your emdebian rootfs:
echo “proc /proc proc none 0 0″ >>etc/fstab

echo “sysfs /sys sysfs defaults 0 0″ >> etc/fstab

Then, it is necessary to run the following command: (for this to work you may need to mount /proc /sys and
 /dev/pts, by command line on the first time):
mount proc /proc -t proc
mount devpts /dev/pts -t pts
dpkg --configure -a

echo “thiagoBoard” >etc/hostname
mknod dev/console c 5 1
mknod dev/ttySAC0 c 204 64

  • Emdebian Repositories to Lenny, Add the repositories on the /etc/apt/sources.list.d/multistrap.sources.list:

deb http://www.emdebian.org/grip lenny main
deb-src http://www.emdebian.org/grip lenny main
deb http://www.emdebian.org/grip lenny-proposed-updates main
deb-src http://www.emdebian.org/grip lenny-proposed-updates main
deb http://www.emdebian.org/grip sid main
deb-src http://www.emdebian.org/grip sid main

apt-get update

  • Creating /dev/random

To create the SSH keys you are going to need the Random file on your rootfs, to create it, simply do:

mknod /dev/random c 1 9
Additional devices, may be:
mknod /dev/urandom c 1 9
mknod /dev/ptmx c 5 2
mknod /dev/null c 1 3
chmod 666 /dev/null

apt-get install openssh-server

To configure which programs you want on boot just use rcconf:

:~$ apt-get install rcconf

:~$ rcconf

  • LOADING KERNEL ON BOARD:
##### FriendlyARM BIOS for 2440 #####
[k]kernel
[v] Download vivi
...
Choose k:

obs: Use the zImage_T35
found inside the file at the section Linux, at http://arm9.net/download.asp
  • CREATING THE YAFFS2 Image:

Download the mkyaffs2image binary ( I use the mkyaffs2image-128M, to create my Yaffs2 image to a 1GB Nand Mini 2440)
http://arm9download.cncncn.com/linux/mkyaffs2image.tgz

then:

./mkyaffs2image-128M ~/nfs/ debianLenny.img

  • UPLOAD THE Yaffs2 Image to your board
##### FriendlyARM BIOS for 2440 #####
[k]kernel
[v] Download vivi
...
Choose y:
(choose your generated image file to send)
  1. Set some vivi parameters, for example

##### FriendlyARM BIOS for 2440 #####
[k]kernel
[v] Download vivi

Choose s:

Choose v:

choose s:

type linux_cmd_line

type “noinitrd root=/dev/mtdblock3 init=/sbin/init console=ttySAC0 ip=192.168.36.19 mask=255.255.255.0 gw=192.168.36.1″

or ” noinitrd root=/dev/mtdblock3 init=/bin/sh console=ttySAC0 ip=192.168.36.19 mask=255.255.255.0 gw=192.168.36.1″

if you are having boot problems as this should give a previous console.

Have fun!

*** I have mounted my generated folder as an NFS file system on the Mini2440, and on the mini2440, the following commands were issued:

[INSTALLING NFS ON YOUR SYSTEM: On the computer copy the /opt/multistrap to a ~/nfs folder , and also configure the NFS server]:

apt-get install nfs-kernel-server

Edit the /etc/exports file:
/home/thiago/nfs 192.168.36.18(rw, no_root_squash, sync)

/etc/init.d/nfs-kernel-server restart

[On the mini2440 board, can be skipped if you already are able to do NFS on another folder in your system]:

mkdir nfsmount
mount -t nfs 192.168.36.200:/home/thiago/nfs nfsmount

————————————

  • Working .img to be uploaded to the Mini2440:

On the following link (Link to the Img file) , there is a ready to work Yaffs2 Image that can be uploaded 1Gb Nand of the Mini 2440 from Friendly Arm. Unfortunatelly, due to lack of time to update it, some minor modifications are necessary.

Initially boot using the “init=/bin/sh” , as boot parameter on the vivi settings, as shown on the section numbered as one. Then when it boots, do the following commands:

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
mount /proc /proc -t proc
mount devpts /dev/pts -t devpts

mknod /dev/random c 1 9
mknod /dev/urandom c 1 9
mknod /dev/ptmx c 5 2
mknod /dev/null c 1 3
chmod 666 /dev/null

apt-get install openssh-server

Now, change the vivi parameters back to “init=/sbin/init”, and you have a fully working Debian running on the Flash of your board. You may establish a ssh session to it, and have lots of fun!


##### FriendlyARM BIOS for 2440 #####
[x] bon part 0 320k 2368k
[v] Download vivi
...

by thiagodefreitas at August 27, 2010 10:44 PM