BeagleBone
This page has terse notes on installing the Linaro LEB root filesystem on a BeagleBone, setting up the USB Ethernet gadget, and enabling basic networking.
Initial
Grab the boot partition contents to get MLO, u-boot, and the kernel.
Grab the modules from the rootfs.
Use linaro-media-create to fill the SD card. Claim we’re a BeagleBoard for no real reason.
./linaro-media-create --mmc /dev/sdb-check-this --dev beagle \
--rootfs ext4 --console ttyO0,115200n8 \
--hwpack ~/Downloads/hwpack_linaro-omap3_20120210-0_armel_supported.tar.gz \
--binary ~/Downloads/linaro-o-developer-tar-20120210-0.tar.gz \
--hwpack-force-yes --align-boot-part
Copy the original boot files to the new boot
partition and the
original modules to the new rootfs
partition.
Boot issues
Seems to hang. Use an initial shell via:
set ip_method none --verbose init=/bin/sh
/etc/network/interfaces
includes a DHCP on eth0 which is causing the
long boot time. Disable.
I prefer LABEL=rootfs instead of UUID in /etc/fstab.
Enabling gadget based networking
Add g_ether
to /etc/modules
to enable the USB Ethernet gadget.
Add a iface usb0 inet static
stanza to /etc/network/interfaces:
auto usb0
iface usb0 inet static
address 192.168.7.10
netmask 255.255.255.0
gateway 192.168.7.1
hwaddress ether fa:aa:55:aa:55:01
Set /etc/modprobe.d/gether.conf to options g_ether host_addr=fa:aa:55:aa:55:02
to fix the host MAC address.
Note the fixed instead of random MAC address.
Setup usb0 on the host as 192.168.7.1. Note that NetworkManager might interfere. If so, add a connection for the usb0 MAC address that does nothing.
SSH into the host and forward off to the main network proxy:
ssh -L 8123:proxy:8123 -N michaelh@192.168.7.1
Install openssh-server:
http_proxy=http://localhost:8123/ apt-get install openssh-server
Add a user adduser michaelh
, put them in the sudo group adduser michaelh admin
, ssh in from the host.
You can now ssh into the board.
Internet access via the host
The Maemo guys have documented this at http://wiki.maemo.org/USB_networking.
On the host, add a usb0 stanza to /etc/network/interfaces
:
iface usb0 inet static
address 192.168.7.1
netmask 255.255.255.0
up echo 1 > /proc/sys/net/ipv4/ip_forward
up iptables -P FORWARD ACCEPT
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.0/24
down echo 0 > /proc/sys/net/ipv4/ip_forward
down iptables -t nat -F POSTROUTING
Post boot
Set the hostname:
echo bone > /etc/hostname
Consider installing avahi-daemon
. Allows ssh bone.local
.
sudo ntpdate-debian
to set the date. Works best with eth0 due to the
forwarding delays in usb0.
Make a LED turn on and off:
cd /sys/devices/platform/leds-gpio/leds/beaglebone::usr2
echo 255 > brightness
echo 0 > brightness
Profit.
Wireless
I have a Edimax EW-7711UTn USB Wifi dongle.
Add a wlan0 stanza to /etc/network/interfaces:
auto wlan0
iface wlan0 inet dhcp
wireless-essid Public
(I have a profile on my router called ‘Public’ with no password).
Actually, it drops after a while. Ignore.
Notes
Env:
autoload=yes
baudrate=115200
bootargs_defaults=setenv bootargs console=${console} ${optargs}
bootcmd=if mmc rescan; then echo SD/MMC found on device ${mmc_dev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run mmc_load_uimage; then run mmc_args;bootm 0x80007fc0;fi;fi;run nand_boot;
bootdelay=1
bootenv=uEnv.txt
bootfile=uImage
console=ttyO0,115200n8
ethact=cpsw
ethaddr=40:5f:c2:76:ab:62
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
ip_method=none
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
mmc_boot=run mmc_args; run mmc_load_uimage; bootm 0x80007fc0
mmc_dev=0
mmc_load_uimage=fatload mmc ${mmc_dev} 0x80007fc0 ${bootfile}
mmc_load_uimage_ext2=ext2load ${mmc_dev} 0x80007fc0 /boot/${bootfile}
mmc_root=/dev/mmcblk0p2 ro
mmc_root_fs_type=ext4 rootwait
nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_method}
nand_boot=echo Booting from nand ...; run nand_args; nand read.i ${loadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${loadaddr}
nand_img_siz=0x500000
nand_root=/dev/mtdblock7 rw
nand_root_fs_type=jffs2
nand_src_addr=0x280000
net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
net_boot=echo Booting from network ...; setenv autoload no; dcache off; dhcp; tftp ${loadaddr} ${bootfile}; run net_args; bootm ${loadaddr}
nfsopts=nolock
nor_args=run bootargs_defaults;setenv bootargs ${bootargs} root={nor_root} rootfstype=${nor_root_fs_type} ip=${ip_method}
nor_boot=echo Booting from NOR ...; run nor_args; cp.b ${0x08080000} ${loadaddr} ${nor_img_siz}; bootm ${loadaddr}
nor_img_siz=0x280000
nor_root=/dev/mtdblock3 rw
nor_root_fs_type=jffs2
nor_src_addr=0x08080000
rootpath=/export/rootfs
script_addr=0x81900000
spi_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${spi_root} rootfstype=${spi_root_fs_type} ip=${ip_method}
spi_boot=echo Booting from spi ...; run spi_args; sf probe ${spi_bus_no}:0; sf read ${loadaddr} ${spi_src_addr} ${spi_img_siz}; bootm ${loadaddr}
spi_bus_no=0
spi_img_siz=0x280000
spi_root=/dev/mtdblock4 rw
spi_root_fs_type=jffs2
spi_src_addr=0x62000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial