Chroot Development Environment on N900

setting up a development environment on the Nokia n900


1. We need to have plenty of disk space formatted for linux. Here I used a 8GB SD card formatted
  externally as ext3.
 
 
 
2. The n900 does not mount this automatically at the moment so you have to do this manually.

  mount /dev/mmcblk1p1   /media/mmc1

now ssh into the n900

3. from the scratchbox setup i recovered the rootstrap maemo-sdk-rootstrap_5.0beta_armel.tgz
   
   wget http://repository.maemo.org/unstable/5.0beta/armel/maemo-sdk-rootstrap_5.0beta_armel.tgz
   
   create a directory for your development
   
   mkdir /media/mmc1/devel
   mkdir /devel/mmc1/devel/dev
   cp maemo-sdk-rootstrap_5.0beta_armel.tgz /media/mmc1/devel/
   
   cd /media/mmc1/devel/
   
   tar -xzvf maemo-sdk-rootstrap_5.0beta_armel.tgz
    mkdir var/log/apt
   you now have your development environment set up.
   
4. create a link for convenience

   ln -s /media/mmc1/devel /devel
   
   # some programs still look in old location so create symlink
   mkdir /devel/scratchbox/tools
   ln -s /usr/bin /devel/scratchbox/tools/bin
   
5. mount proc and dev

    mount -o bind /proc /devel/proc
    mount -o bind /dev /devel/dev
     mount -o bind  /dev/pts /devel/dev/pts
    
6 enter your chroot environment

    chroot /devel /bin/sh
    
    have fun .....
    
7. problem is i can't load my debs onto extras cause it might not compile in the environment there
.. i can disribute the binaries tho.

8. here are some gcc flags you might consider using..

-O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp
    
9. note that the tracker hogs the processor whenever lots of new files are created/ renamed
   in this case when extracting tarballs !
   
10. you have to chroot as user root ... build packeges with dpkg-buildpackage ( without the -rfakeroot ) option.. seems to be OK.