Click on iPAQ

Douglas S. J. De Couto decouto at lcs.mit.edu
Wed Dec 18 13:17:02 EST 2002


Shweta Bhandare wrote:
> Hi Doug,
> 
>     Eddie asked me to e-mail you regarding installing Click-on-iPAQ. I 
> want to install Click in the userlevel of the kernel. I already have the 
> kernel src built on the iPAQ. I was interested in finding out the 
> minimal version of click that needs to go into the iPAQ.
> 
> Thanks,
> Regards,
>     Shweta
> 


Shweta,

It's relatively straighforward.  Here's what I do; I am also enclosing 
my script which does this automatically for my particular setup.  I 
assume you want to build a minimal size userlevel click to run a given 
configuration file.  I don't know how to do a cross-compile kernel 
click, it may be similar.  My setup is building on i386 freebsd for arm 
linux.  i assume you have the appropriate ipaq-linux cross-compile 
tools, arm-linux-g++, etc., which are available from the handhelds.org 
web site.

do all of this in your top-level click surce directory.

1. autoconf

2. ./configure --disable-linuxmodule --host=arm-linux \
           --build=i386-bsd --enable-tools=mixed

you might want to add any extra --enable-foo arguments to configure; for 
example, i add --enable-grid.  --enable-tool=mixed makes some tools be 
cross-compiled (notably, click-align), and some tools be compiled to run 
on the build host (i.e. click-mkmindriver, which is part of the build 
process).

3. gmake

4. gmake elementmap

i don't know i gmake twice, i just do...at this point (i think...) you 
should have a full-featured cross-compiled click that should run on an 
ipaq, if you could fit it into flash.

5. ./tools/click-mkmindriver/click-mkmindriver  -C . -u -A \
	-d./userlevel --elements "Print" -p MY_PKG \
	-f MY_CONFIG

this step produces the appropriate makefile to create a minimum click to 
run the click configuration in MY_CONFIG

-u: make userlevel
-A: include neccessary align elements, important for ipaq strongarm
-d: where to output the makefile
--elements: extra elements to add.  I specify Print, IPPrint, etc., in 
case i want to later debug a configuration that doesn't already contain 
these elements.
-p: package name.  whatever you want.
-f: the config file to use

6. gmake -C ./userlevel/ -f Makefile.MY_PKG

this step builds the actual minimal click binary

7. arm-linux-strip ./tools/click-align/click-align
8. arm-linux-strip ./userlevel/MY_PKGclick

strip debugging symbols to actually make the binaries small.
i cross-compile click-align and strip it because i use a dynamically 
generated click config on the ipaq, which has to be aligned every time, 
like so:

build-grid-config.sh | click-align | click

i hope this all still works...

good luck!

d

-- 
Douglas S. J. De Couto    decouto at lcs.mit.edu

-------------- next part --------------
#!/bin/sh

# ``automate'' the click-ipaq cross-compile

CLICKDIR=/home/am0/decouto/checkouts/click-ipaq

CONFIG=${CLICKDIR}/conf/grid.click
GRID_CLICK_TAG=ipaq-grid

cd $CLICKDIR
if [ -e Makefile ] ; then
#    gmake distclean
fi

if [ ! -e configure ] ; then
    autoconf
fi

# These steps are for the new click configure scripts (post-30 Oct 2001).

# The new click config setup should automatically build the right
# tools for the right host, that is, click-mkmindriver should run on
# the build host, while everything else runs on the target.

./configure --disable-linuxmodule --enable-grid \
    --host=arm-linux --build=i386-bsd --enable-tools=mixed

gmake 
gmake elementmap

echo "XXX Creating mindriver makefile"
cat $CONFIG | m4 -DIS_GW | ./tools/click-mkmindriver/click-mkmindriver \
    -C . -u -A -d ./userlevel --elements "Print IPPrint PrintGrid" -p ${GRID_CLICK_TAG} -f -

echo "XXX Building executable"
gmake -C ./userlevel -f Makefile.${GRID_CLICK_TAG}

echo "XXX Strippping executables"
# make the files smaller...
arm-linux-strip ./tools/click-align/click-align
arm-linux-strip ./userlevel/${GRID_CLICK_TAG}click


# The below steps are for the ``old'' click config setup (pre-30 Oct 2001).
# You shouldn't need to use them anymore...
# 
#
# # build the click-mkmindriver tool, to run on the build host
# ./configure --enable-grid --disable-linuxmodule
# gmake -C ./tools click-mkmindriver
# 
# # generate the mkmindriver setup files
# gmake elementmap
# cpp $GRID_CLICK_CONFIG | ./tools/click-mkmindriver/click-mkmindriver -C . -u -d ./userlevel -p ipaq-grid
# 
# # setup for cross-compiling
# rm config.cache
# ./configure --disable-linuxmodule --enable-grid --host=arm-linux --build=i386-bsd
# 
# # cross-compile the click-align tool (don't worry about the other tools for now)
# gmake -C ./tools clean
# gmake -C ./tools click-align
# 
# # cross-compile the click driver binary
# gmake -C ./userlevel -f Makefile.ipaq-grid
#
# arm-linux-strip ./tools/click-align/click-align
# arm-linux-strip ./userlevel/ipaq-gridclick




More information about the click mailing list