AVR32 NGW100 Notes for a Kernel Build environment on SuSE 10.1

These are notes I'm keeping on my trail to try to create a kernel build environment for the AVR NGW100 on SuSE 10.1 Linux. Note that I do not know if any of this is correct right now because I'm gunning for a working environment. I'll be figuring it out as I go.

1) The first thing I did was copy the AVR32 NGW100 Board Support Package (BSP) contents to my SuSE 10.1 linux box.

2) Knowing that I will need a GNU AVR32 compilation environment, I went into devel/linux/opensuse/10.1 and installed all the RPMs in that directory. There is no information about what depends upon what and therefore there is also no information about what order these RPMs should be installed. So, I had to go for broke. I needed to be root and then issues this command:

devel/linux/opensuse/10.1 # find . -name "*.rpm" -exec rpm -i {} \;

That failed a whole bunch of dependencies, but mainly it failed the avr32ocd dependency which failed in turn to install because it lacked libelf.X.so.

Typical of this error was this message:
error: Failed dependencies:
libavr32ocd >= 2.0.0 is needed by avr32gdbproxy-2.0.0-1.suse101.i586
libavr32ocd.so.2 is needed by avr32gdbproxy-2.0.0-1.suse101.i586

or

warning: ./avr32program-2.0.0-1.suse101.i586.rpm: Header V3 DSA signature: NOKEY, key ID c01dd150
error: Failed dependencies:
libavr32ocd >= 2.0.0 is needed by avr32program-2.0.0-1.suse101.i586
libavr32ocd.so.2 is needed by avr32program-2.0.0-1.suse101.i586
libelf.so.0 is needed by avr32program-2.0.0-1.suse101.i586


I went through yast2 and installed the libelf package 0.8.5-45.i586.rpm.

After libelf was installed through yast2, I went back and tried the single RPM install of the libavr32ocd package:

rpm -i libavr32ocd-2.0.0-1.suse101.i586.rpm

That succeed with no errors. Next I singly installed libarv32ocd-devel-2.0.0-1.suse101.i586.rpm - that succeeded as well.

After knocking down the major dependency issues, went for the bulk install of the RPMs again.

find . -name "*.rpm" -exec rpm -i {} \;

This time there were no errors emitted, just warnings describing the DSA signatures of the RPMs. I ignored the warnings.

These RPMs obviated the need for me to follow the download sources stuff in the AVR32Linux.org Getting Started section as the RPMs seemed to cover the major list of packages (uboot, gpb, etc.)

3) Build Scripts do it all

look in the BSP scripts directory and you'll find what you need to do a full build of uboot, /root and /usr JFFS images

./build-linux-environment.sh ../software ../builds/ngw/ ../mybuilds

SuSE 10.1 was lacking e2fsimage for the end stage of the build. e2fsimage isn't available directly from SuSE DVD/yast2.

Need to install e2fsimage 0.2.2 but it has dependency on e2fsprogs headers.

Solution is to install e2fsprog (e2fsprogs-devel to be precise) from yast2 or consult this link: http://support.novell.com/techcenter/psdb/286c206d70f263c8fc3da1dc2fab3ce7.html

rpm -Fvh e2fsprogs.rpm

The home page for e2fsprogs is at:
http://e2fsprogs.sourceforge.net/ext2.html

After e2fsprogs is configured/installed with devel headers,

Then download e2fsimage-0.2.2 from http://sourceforge.net/projects/e2fsimage/

spanky:/tmp/e2fsimage-0.2.2 # ./configure
/usr /usr/local
Found: ext2fs/ext2fs.h at /usr/include
Found: e2p/e2p.h at /usr/include
Found: libext2fs.so at /usr/lib
Found: libcom_err.so at /usr/lib

The version of the e2fs library is: 1.38, 30-Jun-2005

LDFLAGS : -lext2fs -lcom_err
PREFIX :/usr/local
CPPFLAGS :
CFLAGS :-Wall
VERSION :0.2.2

GNU Make 3.80
GNU Make 3.80

A usable make executable was found in /usr/bin/make

---
Got much further into kernel build but then bombed on:

DirectFB - configure, make and make install OK
pong - make and make install FAILED
make failed, see make.out

--- removed pong and commented out entire STK1000 section of the build ---

re-ran the build script and got images.

Setting up SuSE TFTP - selected the basic TFTP server from yast2

Pasted Graphic

setup a separate boot directory for ngwt boot images

For comparison purposes, here's the boot log of the stock image on the NGW100:


----------
I was building up a new SuSE 10 build environment and happened to run across a different error, it blew up building ncurses, which I hadn't seen when I first started this thread. After pawing through the make.out of ncurses, this error manifested itself as:
[code]
./gen '' B K >Key_Definitions
./gen: error while loading shared libraries: /home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib/libncurses.so.5: ELF file data encoding not little-endian

while building ncurses.

Context was Ada95 ncurses build:

make[1]: Leaving directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/c++'
cd Ada95 && make DESTDIR="" all
make[1]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95'
for d in gen src samples; do \
(cd $d ; make all) ;\
done
make[2]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/gen'
gcc -I. -I../../include -DHAVE_CONFIG_H -I. -O2 -c -o gen.o ./gen.c
gcc -I. -I../../include -DHAVE_CONFIG_H -I. -O2 gen.o -Wl,-rpath,/home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib -L../../lib -lncurses -o gen
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: skipping incompatible ../../lib/libncurses.so when searching for -lncurses
./gen '' B K >Key_Definitions
./gen: error while loading shared libraries: /home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib/libncurses.so.5: ELF file data encoding not little-endian
make[2]: *** [Key_Definitions] Error 127
make[2]: Leaving directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/gen'
make[2]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/src'
gnatmake -O3 -gnatpn -I. -I. -c -o terminal_interface.o ./terminal_in
[/code]

Something in ncurses didn't seem to want to obey the correct CC or HOSTCC environment that was being used for everything else in the case when it was building Ada95 support. Naturally, I didn't care about Ada95, so found the configure flag to not build it, which was --without-ada.

So, in the build-linux-environment script, I had to add it to this line within the function build_ncurses() section:



Once I added that, I built ncurses with no problems and proceeded through the rest of the build-linux-environment script. So, not sure why I didn't come across this the first time I set up SuSE 10, but if you hit this issue, this is one solution I found.

[Update: 7/14/09 - If you need a wicked strong, lightweight metal enclosure for the NGW100, we designed one. You can buy it at Sparkfun.]

asdfasdf