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
The serial console is /dev/ttyUSB0. Baud rate is 115200 N 8.
Installation steps (with vmdebootstrap)
Important: The ?BeagleBone Black customisation script shipped by vmdebootstrap in Stretch is broken and results in an image that won't boot (bug#874535). It won't be fixed since vmdebootstrap isn't maintained anymore. Replacements suggested in the bug report are debos and vmdb2. Both are shipped starting with Buster; there's no backport for Stretch (as of 2019-01-25).
http://linux.codehelp.co.uk/?p=113
vmdebootstrap provides a wrapper for beaglebone-black:
/usr/share/vmdebootstrap/examples/beagleboneblack.sh
The script uses a customise script and can be replaced by using the commands directly if you want different options:
https://sources.debian.net/src/vmdebootstrap/0.5-2/examples/beagleboneblack.sh/
sudo vmdebootstrap \ --owner $(whoami) --verbose \ --mirror http://http.debian.net/debian \ --log beaglebone-black.log --log-level debug \ --arch armhf \ --foreign /usr/bin/qemu-arm-static \ --enable-dhcp \ --configure-apt \ --no-extlinux \ --no-kernel \ --package u-boot \ --package linux-image-armmp \ --distribution sid \ --serial-console-command "'/sbin/getty -L ttyO0 115200 vt100'" \ --customize "beagleboneblack-customise.sh" \ --bootsize 50m --boottype vfat
The customise script creates the u-boot configuration:
https://sources.debian.net/src/vmdebootstrap/0.5-2/examples/beagleboneblack-customise.sh/
With this in place, a simple dd to an SD card and the BBB boots directly into Debian ARMMP.
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 Sid armhf rootfs.
There is a bug of the live-build. https://bugs.debian.org/780627
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 armhf --binary-images tar --binary-filesystem ext3 --bootloader "" --cache false --chroot-filesystem none --debian-installer-gui false --distribution sid --parent-distribution sid --parent-debian-installer-distribution sid --gzip-options '--best --rsyncable' --initramfs none --linux-flavours none --linux-packages none --bootstrap-qemu-arch armhf --bootstrap-qemu-static /usr/bin/qemu-arm-static
Create ./config/includes.chroot/sbin/auto-serial-getty as an executable shell script:
#!/bin/sh -e for arg in $(cat /proc/cmdline) do case $arg in console=*) tty=${arg#console=} tty=${tty#/dev/} case $tty in tty[a-zA-Z]* ) PORT=${tty%%,*} tmp=${tty##$PORT,} SPEED=${tmp%%n*} BITS=${tmp##${SPEED}n} # 8bit serial is default [ -z $BITS ] && BITS=8 [ 8 -eq $BITS ] && GETTY_ARGS="$GETTY_ARGS -8 " [ -z $SPEED ] && SPEED='115200,57600,38400,19200,9600' GETTY_ARGS="$AUTOGETTY_ARGS $GETTY_ARGS $SPEED $PORT" exec /sbin/getty $GETTY_ARGS esac esac done
Create ./config/includes.chroot/etc/init/auto-serial-getty.conf
start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /sbin/auto-serial-getty
Create ./config/hooks/01_set_root_passwd.hook.chroot as an executable shell script:
#!/bin/sh echo "I: update password" echo "root:linaro" | chpasswd
Run "chmod a+rx ./config/hooks/* ./config/includes.chroot/sbin/*"
Re-run "lb config"
Run "sudo lb build"
And we should have a live-image-armhf.tar.tar generated now and must use xz to convert it to live-image-armhf.tar.tar.xz.
Run "xz -9 live-image-armhf.tar.tar"
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".