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 | 15acbc9 | 2014-02-08 13:25:04 -0800 | [diff] [blame] | 51 | 9. Set up /etc/fstab sanely. |
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. |
Brian Silverman | 15acbc9 | 2014-02-08 13:25:04 -0800 | [diff] [blame] | 54 | Because the uSD card shows up as /dev/mmcblk0 and pushes the internal emmc |
| 55 | to /dev/mmcblk1 when it's plugged in, using those names for the two of them |
| 56 | doesn't work very well. Instead, we use /dev/disk/by-path. |
| 57 | Add "/dev/disk/by-path/platform-mmc.14-part1 /boot/uboot msdos defaults 0 2" |
| 58 | to mount the uboot partition. |
| 59 | Also add |
| 60 | "/dev/disk/by-path/platform-mmc.5-part1 /home/driver/tmp/robot_logs ext4 defaults,noatime,data=writeback 0 0" |
| 61 | to mount the uSD card in the right place for the logs to go to it. |
Daniel Petti | 31268f7 | 2014-01-20 11:27:28 -0800 | [diff] [blame] | 62 | 10. Set up logging. |
| 63 | Fairly straightforward here. We want it to log to the uSD card, so: |
| 64 | `mkdir ~/tmp` |
| 65 | `mkdir /media/driver/sdcard/robot_logs` |
Daniel Petti | 95b7489 | 2014-01-20 14:29:03 -0800 | [diff] [blame] | 66 | `ln -s /media/driver/sdcard/robot_logs ~/tmp/robot_logs` |
Daniel Petti | 97abf96 | 2014-01-20 11:34:14 -0800 | [diff] [blame] | 67 | 11. Set the correct date. |
| 68 | `date` to check if date is correct. |
| 69 | `date -s <date string>` to set it if it isn't. |
Brian Silverman | 0b88252 | 2014-02-16 15:47:34 -0800 | [diff] [blame] | 70 | 12. Fix the locale setup for SSHing in. |
Brian Silverman | 15acbc9 | 2014-02-08 13:25:04 -0800 | [diff] [blame] | 71 | `dpkg-reconfigure locales`, leave it with "en_US.UTF-8" only being |
| 72 | enabled, and then select "None" instead of that for the default in |
| 73 | the second screen. |
| 74 | 30. Download the code! |
| 75 | 50. Clone the image to the rest of the BBBs. |
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` |
Brian Silverman | 15acbc9 | 2014-02-08 13:25:04 -0800 | [diff] [blame] | 78 | You can then copy this image to your computer. |
| 79 | Use this image to flash other uSD cards and/or BBBs. |