Minimal scratch build for BBB

From Crashcourse Wiki

Jump to: navigation, search



How little do we need to do to get a bootable system for the BBB? Based on a lot of Robert Nelson's stuff, and designed for populating a bootable SD card, then booting using a FTDI USB-to-TTL adapter (for now). This means that lots of stuff might not necessarily work, like USB tethering, HDMI, and so on. The point is just to boot and add extra features later bit by bit.


  • YoctoProject 1.4.2 toolchain from here.


Should be able to use absolutely stock U-Boot:

  • Check out current U-Boot git repo (which now incorporate Tom Rini's zImage transmogrification)
  • make am335x_boneblack_config
  • Copy MLO and u-boot.img to SD card, test boot (there is no need for a uEnv.txt file)

As a test, boot to U-Boot and look around U-Boot_Commands_on_the_BBB.

Kernel and device tree blob

Just follow the instructions at Robert Nelson's kernel build for the BBB, and copy the kernel and BBB .dtb file to the SD card Linux partition under /boot. Then test boot the kernel. It will predictably choke trying to mount the root filesystem.

The root filesystem

I'm going to use RCN's minimal root filesystem from here, with only the following customization.

Add this to /etc/fstab:

/dev/mmcblk0p2   /           auto   errors=remount-ro   0   1

and add this to /etc/inittab:

T0:23:respawn:/sbin/getty -L ttyO0 115200 vt102

Then boot from SD card. I get a login prompt in minicom. Success.

TO DO list

Exercises for the student:

  • Install all loadable modules in image.
  • Start adding interesting things to a uEnv.txt file.
  • Add functionality to system (networking, USB tethering, etc.)

Further enhancements

Getting access to the boot partition

Add the following to /etc/fstab:

/dev/mmcblk0p1   /boot/uboot auto   defaults            0   2

That's where you'd add your uEnv.txt file, or update your bootloader image file.

Configuring eth0

First, add to /etc/network/interfaces:

auto eth0
iface eth0 inet dhcp

Next, you can see the contents of the udev-related file /etc/udev/rules.d/70-persistent-net.rules:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# Unknown net device (/devices/ocp.2/4a100000.ethernet/net/eth0) (cpsw)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:59:af:4b:50:55", ATTR{dev_id}=="0x0", ATTR{type}=="1", KER
NEL=="eth*", NAME="eth0"

To insist on eth0 across multiple BBBs, change this to:

# BeagleBone: net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Adding /boot/uboot/uEnv.txt



Once system boots, verify:

root@arm:~# cat /proc/cmdline
console=ttyO0,115200n8 quiet root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait

(Back to BeagleBone Black page.)

Personal tools