DebianOn is an effort to document how to install, configure and use Debian on some specific hardware. Therefore potential buyers would know if that hardware is supported and owners would know how get the best out of that hardware. The purpose is not to duplicate the Debian Official Documentation, but to document how to install Debian on some specific hardware. If you need help to get Debian running on your hardware, please have a look at our user support channels where you may find specific channels (mailing list, IRC channel) dedicated to certain types of hardware. |
Models covered
TI BeagleBone
Overall Status
TI BeagleBone board is a development board. It is ARM architecture. The SoC is TI am335x.
System as sold
It comes with Angstrom OS on the 4G SDcard.
Update: As of March 2014 BeagleBoard officially provides Debian builds here.
Serial Console
To access the serial console, we have to add an udev rule /etc/udev/rules.d/73-beaglebone.rules as following:
Notice that this is no longer needed with recent kernels after this and this commit.
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface", \ ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", \ DRIVER=="", RUN+="/sbin/modprobe -b ftdi_sio" ACTION=="add", SUBSYSTEM=="drivers", \ ENV{DEVPATH}=="/bus/usb-serial/drivers/ftdi_sio", \ ATTR{new_id}="0403 a6d0" ACTION=="add", KERNEL=="ttyUSB*", \ ATTRS{interface}=="BeagleBone", \ ATTRS{bInterfaceNumber}=="00", \ SYMLINK+="beaglebone-jtag" ACTION=="add", KERNEL=="ttyUSB*", \ ATTRS{interface}=="BeagleBone", \ ATTRS{bInterfaceNumber}=="01", \ SYMLINK+="beaglebone-serial"
The serial console is /dev/ttyUSB1. Baud rate is 115200 N 8.
Installation steps (by linaro-image-tools)
Environment
Please use Debian sid or Debian Wheezy or any later versions because we need the latest linaro-image-tools and live-build.
We also need an armel build environment. I am using qemubuilder to create a native build environment. Cross-compilers should work too. We don't want to describe the steps here because it is off-topic. Please read qemubuilder. And if you decide to use cross-compilers, please read EmdebianToolchain.
Prepare Debian binary rootfs
In this section we create a Debian Wheezy armel rootfs.
- We use live-build to create Debian binary rootfs. The first step is make an empty directory, for example, '/tmp/live_cd'
- Enter the created directory by "cd /tmp/live_cd"
- Execute "lb config --apt-indices none --architectures armel --binary-images tar --binary-filesystem ext3 --bootloader "" --cache false --chroot-filesystem none --debian-installer-gui false --distribution wheezy --parent-distribution wheezy --parent-debian-installer-distribution wheezy --gzip-options '--best --rsyncable' --initramfs none --linux-flavours none --linux-packages none --bootstrap-qemu-arch armel --bootstrap-qemu-static /usr/bin/qemu-arm-static"
- Create ./config/package-lists/bootstrap_include.list.chroot:
apt-transport-https gnupg initramfs-tools
- Create ./config/hooks/01_set_root_passwd.chroot as an executable shell script:
#!/bin/sh echo "I: update password" echo "root:linaro" | chpasswd
- Create ./config/hooks/02_getty_on_ttyO0.chroot as an executable shell script:
#!/bin/sh echo "I: add ttyO0 to inittab" echo "T0:2345:respawn:/sbin/getty -L 115200 ttyO0 vt102" >> /etc/inittab
- "chmod a+rx ./config/hooks/*"
- Re-run "lb config"
- Run "sudo lb build"
- And we should have a binary-tar.tar.gz generated now.
Prepare U-boot package
The U-boot of BeagleBone is still not upstreamed yet. So we have to get it from git://arago-project.org/git/projects/u-boot-am33x.git
To simplify this step, I've made a Debian package already for you. You can download the source package by the following commands. And build it from source by qemubuilder.
dget -ux http://people.debian.org/~paulliu/beaglebone/u-boot-am33x_0+git20111206.dsc
- cd u-boot-am33x-*
pdebuild --buildresult .. --pbuilder qemubuilder -- --configfile '<Your qemubuilder config file for armel>'
If you are lazy, you can just use the following command to get the binary package I've made.
Build U-boot
If you're using the package I made, you can skip this section.
Here we provide some information to people who want to work hard to do everything from source. Remember, you should do these commands inside armel environment. Or by setting ARCH and CROSS_COMPILE env to use cross compilers.
- Get the source: git clone git://arago-project.org/git/projects/u-boot-am33x.git
- How to configure: make am335x_evm_config
- How to build: make
- Please install the MLO and u-boot.img into /usr/lib/u-boot-am33x/ directory.
Prepare the kernel
The kernel for am335x is also not yet upstreamed. The git tree is at git://arago-project.org/git/projects/linux-am33x.git
For convenience, I made the kernel package by make-kpkg. Please look at http://people.debian.org/~paulliu/beaglebone/ You need to download linux-*.deb
Build the kernel
You can skip this section if you download the binary packages I made.
sudo qemubuilder --login --configfile '<Your qemubuilder config file for armel>'
- apt-get install kernel-package git
- git clone git://arago-project.org/git/projects/linux-am33x.git
- cd linux-am33x
- make am335x_evm_defconfig
- DEB_HOST_ARCH=armel make-kpkg --initrd --append-to-version .paulliu-1-am335x --revision 3.1.0-1 --arch arm buildpackage
After a long build, you should get the following binary packages:
- linux-doc-3.1.0.paulliu-1-am335x_3.1.0-1_all.deb
- linux-headers-3.1.0.paulliu-1-am335x_3.1.0-1_armel.deb
- linux-image-3.1.0.paulliu-1-am335x-dbg_3.1.0-1_armel.deb
- linux-image-3.1.0.paulliu-1-am335x_3.1.0-1_armel.deb
- linux-manual-3.1.0.paulliu-1-am335x_3.1.0-1_all.deb
- linux-source-3.1.0.paulliu-1-am335x_3.1.0-1_all.deb
Make a hwpack
In this section we create a hwpack that contains the kernel we just built and the am33x u-boot.
- create a config file "/tmp/linaro-debian-am335x" as following:
[hwpack] format=2.0 name=linaro-debian-am335x architectures=armel origin=Linaro maintainer=Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> support=unsupported packages=linux-image-3.1.0.paulliu-1-am335x mmc_id=0:1 u_boot_package=u-boot-am33x u_boot_file=usr/lib/u-boot-am33x/u-boot.img u_boot_in_boot_part=Yes spl_package=u-boot-am33x spl_file=usr/lib/u-boot-am33x/MLO spl_in_boot_part=Yes serial_tty=ttyO0 kernel_addr=0x80000000 initrd_addr=0x81600000 load_addr=0x80008000 wired_interfaces=eth0 partition_layout=bootfs_rootfs kernel_file=boot/vmlinuz-*-am335x initrd_file=boot/initrd.img-*-am335x boot_script=boot.scr extra_serial_options=console=tty0 console=ttyO0,115200n8 loader_start=1 [debian] sources-entry=http://ftp.us.debian.org/debian/ sid main
- Copy those kernel Debian packages and U-boot Debian packages to /tmp. (The .deb files)
- Run "linaro-hwpack-create --local-deb u-boot-am33x_0+git20111206_armel.deb --local-deb linux-image-3.1.0.paulliu-1-am335x_3.1.0-1_armel.deb --local-deb linux-headers-3.1.0.paulliu-1-am335x_3.1.0-1_armel.deb --local-deb linux-doc-3.1.0.paulliu-1-am335x_3.1.0-1_all.deb --local-deb linux-manual-3.1.0.paulliu-1-am335x_3.1.0-1_all.deb --local-deb linux-source-3.1.0.paulliu-1-am335x_3.1.0-1_all.deb linaro-debian-am335x 1"
Now we have a good hwpack for Debian image
- "hwpack_linaro-debian-am335x_1_armel_unsupported.tar.gz"
Build the image
We can use linaro-media-create to build the Debian image.
- linaro-media-create --image-file /tmp/linaro-debian-beaglebone.img --dev beagle --rootfs ext3 --hwpack /tmp/hwpack_linaro-debian-am335x_1_armel_unsupported.tar.gz --binary /tmp/live_cd/binary-tar.tar.gz
And now we got an image file called linaro-debian-beaglebone.img. Just use dd to write it to a microSD card.
Boot
Just insert the microSD card into BeagleBone board and boot. After several seconds we'll get a login prompt from the serial console. And then we use root to login. The root password is "linaro".