This file contains notes on setting up a new fit-pc image.
Doing it right requires knowing what you're doing as a Debian sysadmin, so the
main goal of this file is to avoid forgetting anything.

Brian last updated this on 2013-08-28 with Debian Wheezy.

1.  Install Debian stable.
      It will need firmware during the installation.
	  I partitioned it with (in order) a 0.5G ext2 /boot, a 2G swap, a 3.0G xfs
	    /, and then an xfs /home on the rest of the SSD.
      Create 1 user named "driver".
	  Select only "SSH Server" and
	    "Basic System Utilities"(or something like that) in tasksel.
2.  Install aos.conf and starter.
	  I just changed aos.conf to give driver permissions instead of the group.
3.  Make exim4 start faster.
      `dpkg-reconfigure exim4-config` and select the option for making minimal
	    DNS queries (it also says some junk about modems).
4.  Configure the network.
      Edit /etc/network/interfaces to give it the right static IP address.
	  Set up eth1 like the default eth0 in case the NIC gets assigned that (see
	    #8 below). That shouldn't be a problem any more, but it's probably good
		to be on the safe side because it can be a pain to find a screen to fix
		it otherwise.
5.  Install stuff.
      firmware-linux-nonfree is always a good one to get.
	  Remember to add
	    <http://robotics.mvla.net/files/frc971/packages/frc971.list>.
      Besides the custom linux-image package, you'll figure everything else out
	    as you start trying to run stuff.
6.  Make SSH logins faster.
      Add the line "UseDNS no" to /etc/ssh/sshd_config.
7.  Make it so that the programming team can log in without passwords.
      Everybody will have to run `ssh-copy-id -i ~/.ssh/id_rsa.pub fitpc` (see
	    <http://www.debian-administration.org/articles/152> for details).
8.  Make udev to stop being annoying and naming NICs eth1.
      udev want to remember the ethernet NIC from each device and name the one
	    in a new fitpc eth1, which breaks stuff. If that happens, removing
		/etc/udev/rules.d/70-persistent-net.rules will make it autogenerate a
		new one and fix it.
	  To prevent this problem from happening in the first place, follow the
	    directions in 10-net-eth0.rules.
9.  Download the code!
      In order for it to actually run, you'll have to
	    `mkdir -p ~driver/tmp/robot_logs`.
50. Clone the image to the rest of the disks.
      I've had good luck with `dd if=/dev/sdx of=/dev/sdx bs=16384` before, but
	    that didn't work this time...
      Using gparted's copy/paste feature for each partition worked this time.
	    A bug in the gparted version I used meant that it wouldn't copy an XFS
		  partition to a smaller destination, so I had to manually mount both of
		  them and `xfsdump -J - /path/to/src | xfsrestore -J - /path/to/dest`.
		Doing it that way changes the UUIDs on the XFS partitions.
		  To deal with that, I edited the UUIDs in the /etc/fstab of the clone.
		  I also had to manually install grub on the clone, which meant mounting
		    the clone's /boot, `grub-install --boot-directory=bla /dev/sdx`, and
			then using sed to switch the UUIDs in the clone's
			/boot/grub/grub.cfg.
