Daniel Petti | 31268f7 | 2014-01-20 11:27:28 -0800 | [diff] [blame] | 1 | This file contains notes on setting up a new BBB image. |
| 2 | Doing it right requires knowing what you're doing as a Debian sysadmin, so the |
| 3 | main goal of this file is to avoid forgetting anything. |
| 4 | |
| 5 | Daniel last updated this on 2014-01-20 with Debian Wheezy. |
| 6 | |
| 7 | 1. Install Debian stable. |
| 8 | Follow the instructions here: |
| 9 | http://blogs.bu.edu/mhirsch/2013/11/install-debian-7-to-emmc-internal-flash-drive-of-beaglebone-black/ |
| 10 | Create a "driver" user. |
| 11 | 2. Install aos.conf and starter. |
| 12 | I just changed aos.conf to give driver permissions instead of the group. |
| 13 | 3. Install and configure exim4. |
Daniel Petti | 95b7489 | 2014-01-20 14:29:03 -0800 | [diff] [blame] | 14 | TODO (daniel): We might not need this. |
Daniel Petti | 31268f7 | 2014-01-20 11:27:28 -0800 | [diff] [blame] | 15 | `apt-get install exim4-config` |
| 16 | `dpkg-reconfigure exim4-config` and select the option for making minimal |
| 17 | DNS queries (it also says some junk about modems). |
| 18 | 4. Configure the network. |
| 19 | Edit /etc/network/interfaces to give it the right static IP address. |
| 20 | Set up eth1 like the default eth0 in case the NIC gets assigned that (see |
| 21 | #8 below). That shouldn't be a problem any more, but it's probably good |
| 22 | to be on the safe side because it can be a pain to find a screen to fix |
| 23 | it otherwise. |
| 24 | 5. Install stuff. |
| 25 | This includes the realtime kernel. |
| 26 | Note that at the time of this writing, you can't apt-get install the |
| 27 | realtime kernel packages directly on the beaglebone. |
| 28 | You must download them on your computer, copy them to the beaglebone, |
| 29 | and install them using dpkg -i. |
| 30 | <http://robotics.mvla.net/files/frc971/packages/>. |
| 31 | After you do this, you will still need to modify the zImage |
| 32 | symlink to point to the right kernel. |
| 33 | `rm /boot/zImage` |
| 34 | `ln -s /boot/vmlinuz-3.8.13.9-rt20+ /boot/zImage` |
| 35 | After you reboot, you should be running the rt kernel. |
| 36 | (Check it with `uname -r`.) |
| 37 | Besides the realtime kernel packages, you'll figure everything else out |
| 38 | as you start trying to run stuff. |
| 39 | 6. Make SSH logins faster. |
| 40 | Add the line "UseDNS no" to /etc/ssh/sshd_config. |
| 41 | 7. Make it so that the programming team can log in without passwords. |
| 42 | Everybody will have to run `ssh-copy-id -i ~/.ssh/id_rsa.pub BBB` (see |
| 43 | <http://www.debian-administration.org/articles/152> for details). |
| 44 | 8. Make udev stop being annoying and naming NICs eth1. |
| 45 | udev wants to remember the ethernet NIC from each device and name the one |
| 46 | in a new BBB eth1, which breaks stuff. If that happens, removing |
| 47 | /etc/udev/rules.d/70-persistent-net.rules will make it autogenerate a |
| 48 | new one and fix it. |
| 49 | To prevent this problem from happening in the first place, follow the |
| 50 | directions in 10-net-eth0.rules. |
Brian Silverman | 09c401f | 2014-02-08 12:12:31 -0800 | [diff] [blame^] | 51 | 9. Configure partition automounting. |
Daniel Petti | 95b7489 | 2014-01-20 14:29:03 -0800 | [diff] [blame] | 52 | Open /etc/fstab on the bbb and remove the last two lines, which the |
| 53 | comments indicate mount both partitions on the uSD card. |
| 54 | Replace them with this line: |
| 55 | "/dev/mmcblk0p2 /media/driver/sdcard ext4 defaults,nobootwait 0 0" |
Daniel Petti | 31268f7 | 2014-01-20 11:27:28 -0800 | [diff] [blame] | 56 | Obviously, replace mmcblk0p2 with the actual handle for the partition |
| 57 | on your uSD card that you want to mount, and make sure that |
| 58 | /media/driver/sdcard exists. |
Brian Silverman | 09c401f | 2014-02-08 12:12:31 -0800 | [diff] [blame^] | 59 | Another thing to add is: |
| 60 | "/dev/mmcblk0p1 /boot/uboot msdos defaults 0 2" |
| 61 | This mounts the uboot partition. (mmcblk0 is the eMMC when there's |
| 62 | no uSD card present.) |
Daniel Petti | 31268f7 | 2014-01-20 11:27:28 -0800 | [diff] [blame] | 63 | 10. Set up logging. |
| 64 | Fairly straightforward here. We want it to log to the uSD card, so: |
| 65 | `mkdir ~/tmp` |
| 66 | `mkdir /media/driver/sdcard/robot_logs` |
Daniel Petti | 95b7489 | 2014-01-20 14:29:03 -0800 | [diff] [blame] | 67 | `ln -s /media/driver/sdcard/robot_logs ~/tmp/robot_logs` |
Daniel Petti | 97abf96 | 2014-01-20 11:34:14 -0800 | [diff] [blame] | 68 | 11. Set the correct date. |
| 69 | `date` to check if date is correct. |
| 70 | `date -s <date string>` to set it if it isn't. |
Brian Silverman | 09c401f | 2014-02-08 12:12:31 -0800 | [diff] [blame^] | 71 | 12. Make it export UART1 on boot. |
| 72 | Add the following to /boot/uboot/uenv.txt: |
| 73 | "optargs=capemgr.enable_partno=BB-UART1" |
| 74 | 13. Download the code! |
Daniel Petti | 31268f7 | 2014-01-20 11:27:28 -0800 | [diff] [blame] | 75 | 50. Clone the image to the rest of the disks. |
Daniel Petti | 95b7489 | 2014-01-20 14:29:03 -0800 | [diff] [blame] | 76 | Boot up from a uSD card. |
| 77 | `dd if=/dev/mmcblk1 | gzip -c > BBB.img.gz` |
| 78 | You can then scp this image to your computer. |
| 79 | (Perhaps you want to give it a more descriptive name?) |
| 80 | Use this image to flash a new uSD card. |