Atheros has been experimenting with the AMiLDA™ distribution for the AMD5120™. The AMiLDA™ distribution includes a Linux™ kernel, the Busybox™ application and the uClib™ library. Atheros has integrated the Atheros Powerline Toolkit into a copy of this distribution for our own use.
This section documents the steps needed to compile AMiLDA™. The information is taken from public information available on the internet and our own experiences with AMiLDA™. Atheros does not endorse, recommend or support this hardwaer or software in any way. We merely provide some information as a courtesy to customers who may be interested.
Obtain the Edimax™ toolchain, tool-chain.tar.gz, and save it in any location that your prefer.
Extract the Edimax™ toolchain to the root filesystem folder. The toolchain must be located there or compile errors will occur. The resulting folder, /export/tools, contains a pre-compiled set of build tools for the ADM5120™ that will execute in place of the normal tools installed on your system whenever the AMiLDA™ build stream is executed.
# tar -vzxf tool-chain.tar.gz -C /
Obtain the AMiLDA™ source tree and save it in any location that your prefer.
Extract the AMiLDA™ source tree to the folder /usr/src. The source tree must be located there or compile errors will occur. The resulting folder, /usr/src/AMiLDA, contains a Linux™ kernel and custom applications.
# tar -vzxf AMILDA.tar.gz -C /usr/src
Before attempting a compile the kernel, install the bison and flex packages. This should install contemporary yacc-style and lex-style components needed by the kernel build stream.
# apt-get install bison flex
From folder /usr/src/AMiLDA execute command make clean to purge old kernel and application object files and temporary files created by previous builds.
From folder /usr/src/AMiLDA/linux-2.4.32 execute command make oldconfig to build a new .config file.
If you encouter an error indicating that folder include/asm cannot be deleted because it is a directory then manually delete the directory with the command rm -fr include/asm. The folder will be replaced with a symbolic link during the build process. The folder contents is sometime included when the tree it archived because it is a symbolic link.
In folder /usr/src/AMiLDA/linux-2.4.32 execute command make dep to build new kernel files.
In folder /usr/src/AMiLDA execute command make to build new system. This operation takes some time to complete.
The Atheros build stream creates two firmware image files. File AMiLDA/linux/vmlinuz is a standard Linux™ image file. It can be dowloaded directly into ADM5120™ SDRAM and temporarily executed there. File AMiLDA/image/vmlinuz is an encapsulated version of the standardLinux™ image having an header and checksum. It can be dowloaded and flashed into ADM5120™ NVRAM for permanent execution.
Program AMiLDA/image/cvimg can be used to convert the standard Linux™ image file, AMiLDA/linux/vmlinuz, to an encapsulated image file. AN encapsulated image file is the only one needed to replicate your system on multiple ADM5120™ devices. You may also want to distribute script flash.sh, described in the next section, with the encapsulated image.
Atheros does not recommend using minicom to download and flash firmware because it can be awkward to configure and change. Instead, we recomend using one of the two expect scripts included with our build stream. Establish a serial connection to the ADM5120™, start one of the scripts then power-cycle the ADM5120™. The script will monitor the serial line for Boot Menu prompts and respond by downloading and flashing or executing the appropriate image.
Both scripts are located in the AMiLDA folder. Both scripts have constants that name the serial device and download file. One script downloads and executed an image in SDRAM. The other downloads and flashes NVRAM then loads the image into SDRAM and executes it.
Close all serial connections to the ADM5120 before running either script or download will fail. Start one of the scripts and power-cycle the ADM5120. Downloading should begin almost at once. Examples are shown below. Open a serial connection only after dowloading terminates.
Example 7.2.
Using script download.sh
# download.sh spawn [open ...] * Restart the router. ADM5120 Boot: Linux Loader Menu ==================== (a) Download vmlinuz to flash ... (b) Download vmlinuz to sdram (for debug) ... (c) Exit Please enter your key : Sending /usr/src/AMiLDA/linux/vmlinuz, 11165 blocks: Give your local XMODEM receive command now. Xmodem sectors/kbytes sent: 3965/495k
Script download.sh will download the standard image file AMiLDA/linux/vmlinuz to SDRAM and start execution using option b on the ADM5120™ boot menu.
Example 7.3.
Using script flash.sh
# download.sh spawn [open ...] * Restart the router. ADM5120 Boot: Linux Loader Menu ==================== (a) Download vmlinuz to flash ... (b) Download vmlinuz to sdram (for debug) ... (c) Exit Please enter your key : Sending /usr/src/AMiLDA/linux/vmlinuz, 11165 blocks: Give your local XMODEM receive command now. Xmodem sectors/kbytes sent: 3965/495k
Script flash.sh downloads the encapsulated image file AMiLDA/image/vmlinuz then flashes NVRAM using option a on the ADM5120™ boot menu.
To use these scripts, you must first install the Linux expect application. On GNU Linux based distributions, the command apt-get install expect will download and install it. Other distributions will require different commands.