NSLU2-Linux
view · edit · print · history

DS101.AngstromHowto History

Hide minor edits - Show changes to markup

February 04, 2008, at 09:54 PM by fcarolo -- formatting, fixed false wikilinks
Changed lines 17-18 from:

You may use another distribution like OpenSlug, Unslug or SlugOs?, or other. One of the most important thing is to have a working ARM big-endian toolchain, and that is not easy. Fortunately such a toolchain is built as part of the OpenEmbedded build process.

to:

You may use another distribution like Unslung or SlugOS, or other. One of the most important thing is to have a working ARM big-endian toolchain, and that is not easy. Fortunately such a toolchain is built as part of the OpenEmbedded build process.

Added line 71:
January 31, 2008, at 11:20 AM by pierrox --
Added lines 90-91:

Important : adjust manually the MAC address of the ethernet port in arch/arm/mach-ixp4xx/ds101-setup.c. This MAC address should be stored somewhere in flash, but as we don't want to access flash it is currently hardcoded...

January 31, 2008, at 10:49 AM by pierrox --
Changed line 31 from:

On http://www.slug-firmware.net/, download Angstrom <a href="http://ftp.osuosl.org/pub/nslu2/releases/Angstrom-2007.12-source.tar.gz">source code</a>.

to:

From http://www.slug-firmware.net/, download Angstrom soure code (http://ftp.osuosl.org/pub/nslu2/releases/Angstrom-2007.12-source.tar.gz).

January 31, 2008, at 10:47 AM by pierrox --
Added lines 150-153:

Pre-built binaries

They are provided as is, for convenience only. You may just start with these files if you are really eager to start. Use at your own risks.

  • http://www.pierrox.net/ds101/20080122/binaries/
January 31, 2008, at 10:45 AM by pierrox --
Changed lines 145-149 from:
to:

And after ?

If all goes well, the boot process ends on a login prompt. Log in as root (no password), and start enjoying your new and powerful machine. Some things you will probably want to do :

  • eventually configure the network interface eth0 (see /etc/network/interfaces). default is DHCP, so it may just work
  • ipkg update, so that "ipkg install some_package" works just great

The rest is up to you.

January 31, 2008, at 10:44 AM by pierrox --
Added lines 135-145:

Booting Linux

It is time to cross fingers and have a pray. The "exec" command is designed to boot a linux kernel. In our case a good invocation is : (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
exec -c "console=ttyS0,115200 mem=64M@0x00000000 root=/dev/sda1 rootdelay=10" 0x11600000

(:tableend:) You may modify the root device "/dev/sda1" according to your setup. The rootdelay option can be removed if /dev/sda1 refers the internal hard disk. In case you mount root on a USB mass storage device, the rootdelay option will instruct the kernel to wait a bit before to mount root, so that USB devices can be detected before.

January 31, 2008, at 10:44 AM by pierrox --
Added lines 107-134:

Connect to the bootloader

Follow the instructions on SerialConsole to establish the serial link, then power-up the DS-101.

Taking control

Soon after powering-up the DS-101 RedBoot bootloader ask whether to enable ethernet or not. Type "1" for yes. You must be ready and type "1" as soon as possible because you won't get more than 1 second to answer. Some few seconds later the bootloader ask whether to execute the automatic boot script : type ^C to abort it. Once again answer delay is short, so be careful. If all goes well RedBoot will now wait for your commands. You can now interact with the bootloader, and especially load the kernel zImage. Typing "help" will provide some explanation about available commands.

Loading Linux

RedBoot offers several methods to download the kernel. Fastest is tftp or http over ethernet but needs a server, slowest is x/ymodem but does not need special setup (only lrzsz package). The tftp or http method is strongly recommended as it really speeds up the transfert. Setting up a tftp or http server is out of scope According to your setup, load the kernel with one of the following command:

  • using xmodem :

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
load -m xmodem -b 0x11600000 -r

(:tableend:)

  • using http (example) :

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
load -r -v -h 192.168.1.8 -m http -b 0x11600000 /zImage 

(:tableend:) The default DS-101 IP address is 192.168.1.75, netmask 255.255.255.0. Your tftp or http server must be on a 192.168.1.0 network. The previous http load command suppose a web server is running on host 192.168.1.8 and that the linux kernel can be found at the /zImage path. Data are fetched and stored into memory at location 0x11600000 in physical RAM.

January 31, 2008, at 10:43 AM by pierrox --
Added lines 30-106:

Build the Angstrom distribution

On http://www.slug-firmware.net/, download Angstrom <a href="http://ftp.osuosl.org/pub/nslu2/releases/Angstrom-2007.12-source.tar.gz">source code</a>. Building Angstrom is pretty straightforward, for example : (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
tar xzf Angstrom-2007.12-source.tar.gz
export ANGSTROM_ROOT=$PWD/angstrom-2007.12
cd $ANGSTROM_ROOT
make

(:tableend:)

This should be enough. If everything goes well you will obtain (among other nice things) :

  • a working toolchain, with prefix armeb-angstrom-linux-gnueabi-, located in $ANGSTROM_ROOT/tmp/cross/bin
  • a ready to use root filesystem : $ANGSTROM_ROOT/tmp/deploy/glibc/images/ixp4xxbe/base-image-ixp4xxbe.tar.gz
  • ipk packages feeds in $ANGSTROM_ROOT/tmp/deploy/glibc/ipk/

Preparing the root fs for the DS-101

The easiest way is probably to put the root fs on a USB storage device, so that it can be plugged directly into one of the DS-101 USB port. It will preserve the IDE connector which is rather flimsy. Assuming your disk is /dev/sda, a possible procedure on your host computer could be : (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
fdisk /dev/sda (create a primary partition, eventually some swap space)
mkfs.ext3 /dev/sda1
mount /dev/sda1 /mnt/tmp
cd /mnt/tmp 
tar xzf $ANGSTROM_ROOT/tmp/deploy/glibc/images/ixp4xxbe/base-image-ixp4xxbe.tar.gz
cd /
umount /mnt/tmp
sync

(:tableend:) You may adjust system files like /etc/fstab, or do it later if needed. Plug your disk in the DS-101, the root filesystem is then ready to be used on the device.

Build the kernel

You need

  • linux-2.6.23.12, see http://www.kernel.org/
  • ds101 patch : http://www.pierrox.net/ds101/20080122/sources/linux-2.6.23.12-ds101-full.patch

The proposed patch is an all-in-one patch, gathering essential things. Broken out series can be found here : http://www.pierrox.net/ds101/20080122/sources/patches/. It is not the official repository. It merges code found on nslu2-linux and mikpe patches.

Add the cross-compiler to your PATH, and ensure it is working : (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
PATH=$PATH:$ANGSTROM_ROOT/tmp/cross/bin
armeb-angstrom-linux-gnueabi-gcc --version

(:tableend:) Unpack the Linux kernel and apply DS-101 patches : (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
tar xjf linux-2.6.23.12.tar.bz2
cd linux-2.6.23.12
patch -p1 < ../linux-2.6.23.12-ds101-full.patch

(:tableend:) Finally adjust the proposed configuration and build the kernel. The kernel .config file shipped in the ds101 patch should be considered as a starting point only. (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
make ARCH=arm CROSS_COMPILE=armeb-angstrom-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=armeb-angstrom-linux-gnueabi-
ls -l arch/arm/boot/zImage

(:tableend:) Modules can be installed on the target root filesystem this way : (:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
make ARCH=arm CROSS_COMPILE=armeb-angstrom-linux-gnueabi- INSTALL_MOD_PATH=/path/to/rootfs modules_install

(:tableend:)

January 31, 2008, at 10:42 AM by pierrox -- Howto run Angstrom on the DS101
Added lines 1-29:

Introduction

This short howto explains howto to build a linux 2.6 kernel and the Angstrom distribution, and how to run this setup on the DS-101 specifically, without erasing the built-in flash. This way you can test different kernels and softwares without fearing to brick your device. In case something goes wrong, simply reboot the device and try again.

This is not a HOWTO on how to build Angstrom and Linux (instructions on the topic may be found elsewhere), but it tries to gather required steps in order to use an open distribution instead of the original firmware.

Although the overall process is quite easy, it is not yet ready for end user as it requires some unusual hardware to access the serial console of the device (see Prerequisites).

In short, the step involved are :

  • build angstrom using OpenEmbedded
  • put the Angstrom root filesystem on a IDE hard disk, or on a USB storage device
  • plug the IDE HD or the usb stick on the DS-101
  • build the kernel using a vanilla 2.6 kernel, DS-101 patches, and the Angstrom toolchain
  • connect to the ds101 bootloader
  • load the kernel into RAM
  • run !

You may use another distribution like OpenSlug, Unslug or SlugOs?, or other. One of the most important thing is to have a working ARM big-endian toolchain, and that is not easy. Fortunately such a toolchain is built as part of the OpenEmbedded build process.

Softwares version used in this howto may not be up to date. You may check for newer versions before to begin. However this actual setup is known to be good for DS-101 rev3.0.

Things described here are somewhat experimental, so be careful.

This howto is possibly incomplete and/or incorrect. Feel free to improve it.

Prerequisites

A 3.3V TTL serial cable is required to access the device serial console. See SerialConsole. A free hard disk or a usb stick is needed to store the root filesystem. Before to begin experimentations remove the current hard disk from the DS-101, so that your data are kept in a safe way. Internal flash won't be overwritten, so in case you would like to come back to the original DS101 firmware, just reboot your device with the current hard disk.

January 31, 2008, at 10:37 AM by pierrox -- Howto run Angstrom on the DS101
view · edit · print · history · Last edited by fcarolo.
Originally by pierrox.
Page last modified on February 04, 2008, at 09:54 PM