This post is more to gather information that’s spread over a few different pages all into one place, so if I need to do it again from scratch I’ve got an easy reference to follow.
I’m running on Mac OS X as my primary operating system, and whilst it’s Unix, it’s not Linux so some of the development tools needed to get the beagleboard up and running either are outdated ports or don’t exist. As a result, I started out with creating a vm using Ubuntu Server 9.04 x64 in VMware Fusion.
I performed a basic install into the VM, accepting most of the the default settings – 1 CPU, 512 MB RAM, 20GB SCSI HDD. The one setting I changed was to use Bridged networking rather than NAT. During the installation of Ubuntu, the only set of pre-configured packages I selected was the OpenSSH Server. I let the installer automatically configure the disk, using the whole disk with a guided LVM setup and accepted the defaults.
Once Ubuntu was installed, the first thing I did was to set up a static IP address and configure passwordless logins for ssh.
Modify /etc/network/interfaces and configure eth0 with an IP address for your LAN
# The primary network interface
iface eth0 inet static
Modify /etc/resolv.conf as well to add in your DNS Server.
Finally, restart the networking subsystem so it picks up the new static IP.
sudo /etc/init.d/networking restart
Once this is done, you can ssh in from the host operating system. Test that ssh logins work, and then set up passwordless logins for convenience.
ssh [email protected]
Once logged in to the vm via ssh
ssh-keygen -t dsa
I don’t bother with a password for these keys as I’m not going to be using them for anything that requires a high degree of security. When the keys are generated log out of the remote system. From the host os, copy over your public keys to the vm. If you haven’t already generated ssh keys, do so with ssh-keygen.
scp ~/.ssh/id_dsa.pub [email protected]:~/.ssh/authorized_keys
Now you will be able to log into the vm, and copy files to it, without needing to enter a password.
Next up, are some system updates, installing a basic build environment and VMware Tools.
sudo apt-get -y upgrade
If this updates the kernel, reboot before continuing. If not, continue on with more updates.
sudo apt-get -y install build-essential
sudo apt-get -y install linux-headers-`uname -r`
Next, in VMware select the Virtual Machine -> Install VMware Tools menu item, then in the VM:
tar zxvf /cdrom/VMwareTools-7.9.7-196839.tar.gz
sudo ./vmware-install.pl --default
If it has problems finding the linux headers, reboot and re-run the command
sudo apt-get -y install linux-headers-`uname -r`
Then try installing the VMware Tools again.
Now that the build environment is set up, we can start installing the beagleboard specific stuff. At this point, if you’re feeling cautious, you can snapshot the VM so that you can roll back to this point should anything go wrong with it later on.
Set up the development environment
sudo apt-get install qemu
sudo dpkg -i debootstrap_1.0.13~jaunty1_all.deb
Install rootstock (this is a listed package in 9.10 so you can apt-get rootstock)
tar xf rootstock-0.1.3.tar.gz
sudo ./rootstock --fqdn beagleboard --login ubuntu --password mypass --imagesize 1G --seed xfce4,gdm --dist jaunty --serial ttyS2 --kernel-image http://rcn-ee.net/deb/kernel/beagle/jaunty/v2.6.29-58cf2f1-oer44.1/linux-image-2.6.29-oer44.1_1.0jaunty_armel.deb
Everything from sudo ./rootstock through to the armel.deb above is all on one line.
This downloads the ARM kernel and builds a tar archive of the root filesystem for ARM. It will be sized for a 1G SD card, using the login username of ubuntu and a password of mypass. It will take quite some time to do it, as it’s running inside qemu to emulate an ARM processor (inside a VM at that)
Format the SD Card using fdisk. In my VM, it came up as /dev/sdb. I created a 32MB partition at the start – this will be FAT format and hold the boot image, the rest of the disk will be ext3.
sudo fdisk /dev/sdb
In fdisk, type p to print the partition map, just to make sure you’re working with the correct disk. You don’t want to destroy the partition map from the system disk.
Then, once you’ve verified you’re talking to the correct disk, enter o to create a new, empty partition table. Enter n and then p to create a primary partition. Make it partition 1, with the first cylinder at 1 and the size as 32M. Then enter n, p, 2 to make a second primary partition. Take all the defaults for the sizes and this will make the second partition fill the rest of the SD card.
Next, using a, toggle the bootable flag on partition 1. Finally, hit p to print out the partition table so you can check it and hit w to write this to disk and exit.
When the prompt returns, create a FAT and an ext3 filesystem on the disk
sudo mkfs.msdos -v -n MSDOS /dev/sdb1
sudo mkfs.ext3 /dev/sdb2
sudo tune2fs -c0 /dev/sdb2
Once that’s one, create the boot image
sudo apt-get install uboot-mkimage
mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux" -d ./vmlinuz-* ./uImage
Mount /dev/sdb1 on /mnt/disk1 and /dev/sdb2 on /mnt/sdb2
sudo cp ~./rootstock-0.1.3/uImage uImage
sudo tar xpvf ~/rootstock-0.1.3/armel-rootfs-[date].tgz
OK, now we’re ready to boot the beagle. Connect to it’s serial port using your favourite piece of software. I use screen and a USB-RS232 adapter like so:
screen /dev/tty.usbserial-FTC9PP16 115200
Your /dev/tty… entry will be different depending on the USB-RS232 adapter you have. 115200 is the baud rate that the beagleboard expects to use. Depending on the serial cable you get for the beagle, you may need a null-modem adapter – I got the serial cable from Digikey and it just worked. Make sure you plug into the header pins the right way around though.
Now you are in screen – to quit screen, the default keystroke is Ctrl+a, Ctrl+, y
Power up the board and interrupt the boot process when it asks you. Type in the following to default to booting off the SD card:
setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000'
setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 ro omapfb.mode=dvi:128[email protected]'
If you’re using a different revision of the board, you may need to use an alternate syntax for the mmc init bit:
setenv bootcmd 'mmcinit; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000'
Once you enter boot, it should then start to boot off the SD card, you’ll see all the regular linux startup messages happen and at the login prompt, you will be able to log in using the credentials you passed to rootstock.
Done and donner.