Installing TinyOS on Debian
Introduction
Installing the labyrinth of tools and compilers for TinyOS can be somewhat challenging. The installation instructions can be a tough read and they are sometimes outdated. Also, they are not very appropriate for Debian. This page tries to help out a bit.
These instructions do not apply if you're installing for the Telos platform since you need the msp compiler, not the avr packages. In that case, take a look at TinyOS 1.x on Ubuntu.
The problem
You probably don't have much trouble as long as you're running simulations. However, if you try to compile for actual motes, chances are that you're going to run into some sort of trouble. My problems essentially boiled down to nesC generating C code that contains dollar ($) signs in identifiers. Plain old avr-gcc and avr-as don't like that.
There are several Debian packages (binutils-avr, gcc-avr, avr-libc) that may seem seductive, but installing those will spawn the devil. So don't.
Packages
First, make sure you uninstall every possible trace of gcc-avr, avr-libc, and binutils-avr.
These packages come from http://www.tinyos.net/dist-1.1.0/tools/linux/ and http://www.tinyos.net/dist-1.1.0/tinyos/linux/. I turned them into Debian packages by running alien -d [rpm package].
avr-binutils_2.13.2.1-2_i386.deb
avr-gcc_3.3tinyos-2_i386.deb
avr-libc_20030512cvs-2_i386.deb
nesc_1.1.2a-2_i386.deb
tinyos-tools_1.1.0-2_i386.deb
After you install those, you should make sure apt-get doesn't decide to throw them away on your next dist-upgrade. Start aptitude, and mark packages avr-libc, avr-binutils, avr-gcc, nesc, and tinyos-tools as held (using the '=' key). This prevents Debian's package manager to uninstall or upgrade (and, again, spawn the devil).
Problems
make: execvp: ncc: Permission denied ../Makerules:26: /../apps/Makerules: No such file or directory make: *** No rule to make target `/../apps/Makerules'. Stop.Install the nesc package.
Couldn't execute avr-gccInstall the avr-gcc package. Make sure to install the TinyOS-specific version!
inttypes.h: No such file or directory string.h: No such file or directory stdlib.h: No such file or directory math.h: No such file or directory ctype.h: No such file or directory avr/io.h: No such file or directory avr/signal.h: No such file or directory avr/interrupt.h: No such file or directory avr/wdt.h: No such file or directory avr/pgmspace.h: No such file or directory ...Install avr-libc.
ld: unrecognised emulation mode: avr5 Supported emulations: elf_i386 i386linux elf_x86_64Install avr-binutils.
/tmp/ccIv3SOz.s: Assembler messages: /tmp/ccIv3SOz.s:10: Error: unknown opcode ... ...You didn't listen, did you? You're using the wrong avr-gcc. Don't use the one supplied by Debian. Use the one from this page or alien the .rpm package from the TinyOS installation instructions page.
Other web sites
Obviously, check out TinyOS RedHat installation instructions.
Geoffrey Mainland wrote a page called TinyOS Installation Steps. Note, however, that the avr-gcc package Geoffrey puts up for download, does not contain the correct compiler and assembler for TinyOS code. Unless you compile and install nesc from source, you probably won't be able to use his packages.
Markus Becker's page about his TinyOS setup on Debian.