A developer’s review of Red Hat’s Embedded Linux Developer Suite (Part 3)
Nov 27, 1997 — by LinuxDevices Staff — from the LinuxDevices Archive — viewsBuilding target images for three SBCs
Despite the GUI and documentation provided with ELDS, I did manage to configure and build kernels and root filesystems for the three single-board computers I'm using as test platforms for this series of reviews. The SBCs — an Ampro Little Board/P5x, a… Jumptec-Adastra VNS-786L, and a WinSystems EBC-TXPlus — are all x86-based, but with disparate peripheral hardware.
At this point, an average user, having a kernel and root filesystem sitting on a development host hard drive, might be wondering how these are going to end up on the target. If you have read the previous reviews in this series, you know that Lineo's Embedix provides numerous well-documented and well-implemented methods of deploying target images; and that MontaVista's Hard Hat Linux provides fewer options, but certainly recognizes the responsibility of an Embedded Linux toolkit vendor to provide some assistance with deployment.
ELDS users, however, are on their own. Documentation is provided for exactly one target: Intel's StrongARM-based Assabet board. x86 users are dismissed with a link to the LILO HOWTO, some uselessly vague (and erroneous) instructions on setting up a boot partition, and a warning that the process is “tricky”. Other platforms are essentially not addressed at all.
I find it incredible that Red Hat essentially skipped the important issue of target deployment. But for this series I set out to get images from each toolkit running on the three SBCs, so I'll fill in one way to deploy target images to x86 SBCs.
One especially useful way to develop software in a cross-development environment is to boot from a floppy drive, but mount the root file system using NFS from the development host. Although floppy drives are not particularly common in embedded systems, they can often be added temporarily, especially in the case of x86-based SBCs. The kernel is installed on the floppy, along with instructions on where to get the root file system. You can then write and cross-compile your application software on the cross-development host in the NFS-mounted share. The process can then proceed almost as with native development, requiring no special operations between compiles. When satisfied with the software, you can transfer the kernel and root file system to an appropriate volume on the target, reconfiguring the kernel as appropriate.
How to accomplish this in ELDS is by no means obvious. The cryptic “Meta Configuration” screen, under the equally cryptic submenu “Fstab”, contains an option that seems to allow an NFS-mounted root file system to be used. But it contains no supporting documentation, and how to use it is not clear. I therefore chose to use the standard Linux method, described in the Documentation/nfsroot.txt file in the kernel source tree; along with the Syslinux boot loader.
The outline of the process is as follows . . .
- Configure the kernel. In the “Networking options” menu you must select “IP: kernel level autoconfiguration”. In “File Systems”, select the “Network File Systems” submenu; select “NFS file system support” and “Root file system on NFS”. Build the kernel.
- After creating the root file system, share it via NFS. Add an entry to the /etc/exports file on your cross-development host. Mine looked like this (for my Ampro SBC build): “/disk2/elds/ampro/target-fs *(rw,no_root_squash)”. Restart NFS: “/etc/rc.d/init.d/nfs restart”.
- You have to pass arguments to the kernel command line to tell it to mount the root file system via NFS. To do so you need a bootloader that supports kernel command line arguments. One of the more convenient floppy-oriented x86-based bootloaders is Syslinux, which is provided with many Linux distributions. Basically, you format a floppy as FAT, place the kernel and a configuration file on the floppy, and run 'syslinux' on it to prepare it to boot. On my system, the “syslinux.cfg” file contained (again, for the Ampro example): “append root=/dev/nfs nfsroot=192.168.123.178:/disk2/elds/ampro/target-fs ip=192.168.123.200:192.168.123.178:::::off”. This example works for the common case of both target and cross-development host being on the same subnet. Further details can be found in the nfsroot.txt file and in the syslinux.doc file provided with Syslinux.
- Finally, simply boot the floppy.
Story navigation . . .
- Part 1: Toolkit strategies
- Part 2: Configuring the system
- Part 3: Building target images for three SBCs
- Part 4: Overall assessment
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.