So you want to run Debian on a Nitrogen board.
Thanks to the efforts of the top-notch Debian ARM team, this is really painless. The instructions I’ll list below use the ‘netboot’
armel image along with our Linux kernel to get a full-featured Debian system running.
There are some caveats that I’ll mention along the way, primarily in the area of kernel update support. We haven’t yet determined what it would take to integrate our kernel patches into a Debian package. If anybody has pointers, please pass them on.
To begin with, let’s review the needs for booting a Nitrogen board. To boot the Debian netboot image, you’ll need an SD card configured with
u-boot.bin as described in the Nitrogen User’s Manual. The initial ram-disk,
initrd.u-boot is not necessary, because we’re going to build a new one from the Debian netboot image.
The Debian network boot image we’ve chosen is targeted at the
versatile ARM platform and is available on the ‘armel’ section of the Debian downloads site. There are two files in that directory:
The first steps are to grab the
initrd.gz file and convert it to a format that U-Boot can handle. U-Boot likes to wrap RAM-disks in a format that contains a CRC so that you don’t boot partially downloaded images. Please note that you need the
uboot-mkimage package (
sudo apt-get install uboot-mkimage) on your development machine to do this.
user@devmachine:~/tmp$ wget https://ftp.nl.debian.org/debian/dists/lenny/main/installer-armel/current/images/versatile/netboot/initrd.gz --2010-07-15 12:01:19-- https://ftp.nl.debian.org/debian/dists/lenny/main/installer-armel/current/images/versatile/netboot/initrd.gz Resolving ftp.nl.debian.org... 22.214.171.124 Connecting to ftp.nl.debian.org|126.96.36.199|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2503337 (2.4M) [application/octet-stream] Saving to: `initrd.gz' 100%[======================================>] 2,503,337 492K/s in 8.2s 2010-07-15 12:01:28 (296 KB/s) - `initrd.gz' saved [2503337/2503337] user@devmachine:~/tmp$ mkimage -A arm -O linux -T ramdisk -n "Initial Ram Disk" -d initrd.gz initrd.u-boot Image Name: Initial Ram Disk Created: Thu Jul 15 12:02:53 2010 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 2503337 Bytes = 2444.67 kB = 2.39 MB Load Address: 00000000 Entry Point: 00000000 user@devmachine:~/tmp$ ls -l initrd.u-boot -rw-r--r-- 1 user user 2503401 2010-07-15 12:02 initrd.u-boot
Copy the resulting file,
initrd.u-boot, to your SD card and you’re ready to boot the netboot image. This is all that’s technically needed to boot a Debian image, although there are some other steps you’ll probably want to walk through.
If you’ve booted your SD card image, you’ve probably seen that it’s not happy with the installation media because your SD card is probably configured with one big FAT partition. The Debian installer has facilities for re-sizing partitions and such, but you’re probably best off doing this by hand on another machine. Because of the way SD cards handle wear-leveling, we recommend that you give the boot partition at least 100MB, but you can get rid of the rest.
You can leave the rest of the disk unpartitioned, and the Debian installer will take care of it for you.
You’ll receive a handful of warnings like the one on the right during the installation process that refer to the lack of kernel and boot-loader support. You can safely ignore these, since you’ll need to maintain the kernel separately from the Debian package manager.
The installation process will install the base Debian system first, then prompt you for the type of install (desktop, web server, etc). Unless you have an 8GB or larger SD card, you won’t have sufficient space to install the full desktop package. We recommend installing just the standard system first. You can customize your installation later by using
Once the installation completes, one final step is needed to activate your Debian system. The boot loader is still configured to load the netboot installer RAM-disk. We’ll need to configure U-Boot to skip loading a RAM disk entirely and use the new root partition instead.
U-Boot> set bootargs "root=/dev/mmcblk0p2 fixrtc rootwait video=mxcdi0fb:LVDS666,1280x720@60" U-Boot> set bootcmd 'mmcinit && fatload mmc 0 92000000 uImage && bootm 92000000' U-Boot> saveenv && reset
fixrtc clause may be new to you. Since the Nitrogen does not have a battery-backed real-time clock, the Debian startup scripts will complain that the root filesystem was last checked in the future and force a filesystem check on every boot. The
fixrtc clause tells the system to force the real-time clock to be set from the last root filesystem check time, if it isn’t set during boot.
Once you’ve gone through all of this, you’ll be able to login and select from the wealth of available packages. To give you just a taste, here are screenshots of Fluxbox, MPlayer and IceWeasel running on our 7″ WVGA panel.