Tuesday, May 17, 2011

how to install BackTrack 5 on Nokia N900 Tutorials


10:15 PM |

Before I start, lemme give credit where credit is due. The BackTrack and OffSec teams are also awesome. The script I’m using came straight out of their BT5 ARM image, with just a few adjustments to work on the N900. You can and should download BackTrack here - http://www.backtrack-linux.org/downloads/

On to the instructions…

  1. You must have rooted your N900. If you don’t know how to root your N900, this post is not for you.
  2. You must be running the power users kernel. Since I wanted to do this install with a clean flash of my N900, I spent a fair chunk of three days trying to figure out how to solve the “exec format error” problem. It turns out that this kernel fixes it easy. Just run `apt-get install kernel-power*`, and all will be well.
  3. You must have space to put the BT5 image, and it must be on a file system that allows for large files. The default file system on your memory card won’t cut it. I chose to reformat my memory cards partition into ext3, but you can do whatever you like.
    • The easiest way to do this is `mkfs.ext3 `. Beware, this will wipe the partition, so make sure there’s nothing important on it, and make sure you’re wiping the right one. It’s probably /dev/mmcblk1p1.
    • Then you’ll want to mount that partition somewhere. I chose to mount it in /media. To do this, `mkdir /media/mmc1; mount /dev/mmcblk1p1 /media/mmc1`. You may want to see the next list item first though.
  4. Now you’ll need to copy the bt5.img file into /media/mmc1 somehow or other. I chose to copy it over USB by mounting the media card in my Linux laptop, as I’ve found that wirelessly transferring large files on my N900 is iffy at best. Note, you won’t be able to mount the card on your laptop while it’s mounted in Maemo on your N900. Also note, check the frigging md5sum if you don’t want to bang your head on the wall a lot.
  5. In the same directory as the bt5.img file, you’ll want to have the bootbt script. I’ve slightly modified it to work in our situation, instead of Android. Rather than fight with WordPress’ formatting, I’ll just link you to it. http://pastie.org/1907031
  6. If your locations or partition are any different, you may need to edit that script. Basically it is set up to create /media/mmc1/bt5mnt if it doesn’t exist, and then mount ./bt5.img on it. I suppose it could probably be changed to create ./bt5mnt instead, but I already pasted the script, so that’s your problem.
  7. Run the script. `bash ./bootbt`, or `chmod +x ./bootbt; ./bootbt`, or whatever. I don’t care. If neither of us forgot anything, it should chroot you right on into BT5, and you’ll get the red prompt text.  If you want to just run command line stuff, you’re done!
  8. Next up is if you want to run VNC. Which you do, obviously, if only to get that awesome dragon wallpaper on your N900. You’ll want to edit /usr/bin/startvnc and change the geometry to 800×480. I prefer using nano to do this, but apparently I’m not as leet as the vi cultists, who can bite me.
  9. Change your vnc password using `vncpasswd`.
  10. If you couldn’t guess this from the previous steps… run /usr/bin/startvnc. Errors are normal btw, we’re running Linux, remember?
  11. If you don’t already have one, you’ll need a vnc client. From a terminal window outside your BT5 chroot, try `apt-get install presencevnc`. It seems to work better for me than vncviewer. Run it, and connect to 127.0.0.1. Don’t forget to specify 5901 as your port, if it gives you trouble. Note, to use capital letters and symbols in the VNC client, you have to actually hold the shift/function key while you press the letter.
  12. Tada.
  13. Edit: Another point of interest. If you, as I did, begin to have problems with running out of memory, you’ll need to add a swap partition. It makes stuff go a lot smoother. I used gparted on my laptop to shrink my memory card’s ext3 partition down a bit and added a 2GB swap partition (overkill, but why not). Then you can either add it in /etc/fstab on your N900, or use the quick and dirty way of `swapon /dev/mmcblk1p2` or whatever your partition is. Run `free` to find out if it worked.
I don’t think I missed anything, but if I did, let me know and I’ll try to help.

Leave A Comment