Loggytronic Forum

VOMP => VOMP General / MVP => Topic started by: boppen on November 11, 2005, 21:23:59

Title: Compile a "dongle"
Post by: boppen on November 11, 2005, 21:23:59
Hi!

I've folloved the crosscompiler guide tp build my own development environment.
But it would be nice to be able build a stripped "vomp-dongle" of the same type like the ones that I can download from this site and skip all the NFS stuff - but I cant figure out how to do that - I've tried with a 'make strip' and 'make release' but they didn't work - what have I missed?

Regards, Lars Fredriksson
Title: Re: Compile a "dongle"
Post by: kdeiss on November 12, 2005, 10:55:42
To tell the truth: I was lazy, but it ist working.

I installed the sources of the mediamvp-project from cvs.

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co -P build
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co -P mvplib
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co -P mvpmc
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co -P tests
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/mvpmc co -P web

What me costs days of work was that this project needs a gcc 3.3.x, vomp needs 2.9.x.

I found a precompiled version (so you don't need compile the cross gcc again - which takes hours...)
http://www.quixotic-research.net/downloads/powerpc-405-linux-uclibc.tar.gz

(By the way: At www.quixotic-research.net is hosted annother interesting project for the mediamvp,
a vlc client for the mediamvp, but the author does not provide the sources of his project, even
he is saying that it is GPL....)

Also you need a directory /tftboot and inside an existing dongle.bin.
You need it for the kernel-modules, which are extracted from this dongle.bin.
Assuming that you now have a directory /usr/src/mvpmc-cvs now change to that directory and run the following commands (inside a script):

CC=/opt/crosstool/powerpc-405-linux-gnu/gcc-3.3.3-uClibc-0.9.23/bin/powerpc-405-linux-uclibc-gcc ./configure --with-mvpmc-mediamvp --with-mvpmc-host
make populate
make configure
make

This will take a while but at the end you will have a new dongle.bin (inside /tftboot) for the mediamvp-project.
You can try it out, the mediamvp should boot this dongle now - but we can't do much with it, it's dedicated for the MythTV.

But we have what we want: a devel enviroment to create our own dongle.

First I wrote a small script which is able to look into other dongles. The Perl script dongle_split.pl
you will find in /usr/src/mvpmc-cvs/dongle/dongle_split.pl


#!/bin/bash
#DONGLE="../mvpmc/dongle.bin"
#DONGLE="../vomp/dongle.bin"
DONGLE="../iptv/dongle.bin"


TARGET=/mnt/mvpramddisk
mkdir -p $TARGET

./dongle_split.pl $DONGLE || error "dongle split failed"
mv ramdisk ramdisk.gz || error "move failed"
gunzip ramdisk.gz

umount $TARGET
mount -o loop ./ramdisk $TARGET
if [ $? -eq 0 ] ; then
    echo "RAM-Disk mounted on $TARGET"
    ls -la $TARGET
else
    echo "Failure mounting RAMDISK"
fi

Now you should be able to have a look at /mnt/mvpramdisk. If you give as source a dongle.bin from
chris you can see the complete structure of his dongle.

So, now I renamed /usr/src/mvpmc-cvs/mediamvp/dongle/fs to /usr/src/mvpmc-cvs/mediamvp/dongle/fs_mediamvp
created a new empty /usr/src/mvpmc-cvs/mediamvp/dongle/fs and copy the files I need from /mnt/ramdisk.

You can put into this virtuell fs whatever you want, e.g your modified binaries.

Now create a SCRIPT /usr/src/mvpmc-cvs/buildimg.sh

#!/bin/bash
WORKAREA=$1
if [ "$WORKAREA" == "" ] ; then
    echo "workarea not specified!"
    exit 1
fi

TOP=`pwd`/${WORKAREA}
INSTALL=${TOP}/install

cd dongle

if [ "$WORKAREA" == "mediamvp" ] ; then
    ./dongle_build.sh -d /tftpboot/dongle.bin -o ${TOP}/dongle.bin || err
fi


Call it with ./buildimg.sh mediamvp, stripping and linking to busyboy all is done in dongle_build.sh.

At the end you have your own "vomp" dongle in /tftboot !

Perhaps somebody could integrate this mechanism to the vomp-enviroment, I personally was very happy
that this was working ......

Klaus
Title: Re: Compile a "dongle"
Post by: Chris on November 12, 2005, 16:51:42
Very good work there, but please nobody spend any more time on this, I have a dongle build system that integrates into the current build environment structure (the one from the development environment setup web page) that I will clean up and publish so everyone can make dongles. (When I get back to the UK).

It is based on the MVPMC one but it is heavily modified and simplified.

make release in the current client CVS is what I do just before going to the dongle directory and running the dongle create script. My idea was to have all the other directories sat there with files ready to release in, then execute the dongle build script which copies things in from everywhere.

Title: Re: Compile a "dongle"
Post by: gerge on January 09, 2006, 12:05:00

Chris, where can i find the dongle create script?

(I don't want DHCP and TFTP to my server, because i like my router :) )

gerge
Title: Re: Compile a "dongle"
Post by: Chris on January 10, 2006, 15:58:39
Yes, the dongle create script ;)

Erm, I was going to document that and put it on the web site some time ago. I forgot :(

I will do it next time I get chance to do some vomping.

How do you get the dongles to the mvp now? mvploader?