Just some quick and dirty instructions on how I built a Beaglebone Black disk image from scratch. A big thanks to Robert C. Nelson for the Open Source tools and instructions at Linux Arm on Beaglebone Black that this relies on.
I am sharing the steps I performed here because I built a read-only root filesystem. It is not perfect as it throws a couple of errors during the boot sequence. But those errors are by no means fatal and can be ignored.
Setting up pre-requisites
Same packages are needed in order to build.
Packages needed for the device tree compiler
Packages needed for the kernel build
For disk formatting.
Setting up cross compile environment
Our build machine is Debian Wheezy x86_64. Linaro gcc is 32-bit and needs additional 32-bit binaries.
Install Linaro gcc compiler for ARM.
The last command should provide this kind of output. Otherwise there is a library install issue.
Building U-Boot
Obtain u-boot sources.
Patch U-Boot
Or get patched sources.
Build U-Boot
Build the device tree compiler
Upgrade device tree compiler package. If this script throws an error about ‘sudo: not found’, then just manual install those packages. Still need to run the script!
Build the kernel
Get Kernel. (This isn’t really necessary as the next step would clone the kernel repo. But I wanted a local kernel repo for other tasks, too.)
Get the kernel build scripts.
Edit the script to clone out local kernel repo. Edit the following lines to read like this:
Build the kernel (3.8).
Prepare the SD card
We are using a HD partition to experiment. Be careful here and be sure what disk device you are using. Very easy to nuke the local filesystem and require a rebuild of the build machine.
Erase the disk.
Create partition layout.
This is what we want.
Format partitions.
Make partition mount points.
Mount volumes.
Install bootloader.
Create /tmp/boot/uEnv.txt
Install root filesystem.
Copy the kernel.
Edit /tmp/rootfs/etc/fstab.
Edit /tmp/rootfs/etc/networking/interfaces.
Edit /tmp/rootfs/etc/inittab.
Create /tmp/rootfs/etc/init/serial.conf.
Be done with SD card.
After system is installed
Boot Beaglebone Black with the new SD card. Use the serial console cable to access the root prompt. The username/password are root/root.
To make permanent changes the root filesystem needs to be mounted read-write. This is easily done: