Embedthis Ejscript 1.1.2
Home >Source Code >Building from Source Code >OpenWrt Platform

See Also

Ejscript for the OpenWrt Platform

This document describes the process to build Ejscript for the OpenWrt platform. For other platforms and generic build instructions, please read Building from Source Code.

Background

OpenWrt is a Linux project to create downloadable replacement firmware for consumer communications and storage devices. It supports devices such as the Linksys WRT54G router and the Linksys NSLU2 storage device.

The OpenWrt project provides a highly configurable environment with an active development forum. Most code in OpenWrt is based on a GPL license. For more information about OpenWrt, please consult: Wikipedia OpenWrt, and NSLU2-Linux Home Page.

Prerequisites

You will need the following components:

Steps

  1. Download OpenWrt.
    svn checkout svn://svn.openwrt.org/openwrt/trunk kamikaze
    

    Please read OpenWrt Documentation and Getting Source for full details.

  2. Check out the package/ejs/Makefile.

    cd packages
    svn co svn://svn.openwrt.org/openwrt/packages/ejs
    cd ..
    
  3. Configure the OpenWrt Linux kernel.
    make menuconfig
    
  4. Select Languages and enable Ejscript. You can either build Ejscript into the base system or build it as a loadable and installable package. Select "*" to integrate into the base system or "M" to build a package.

    You also have options to install various components of Ejscript. These options are:

    • ejs — The Ejscript command shell program (ejs)
    • ejsc — The Ejscript compiler. You can choose to not enable this and do all your compilation on the build development system (cross-compilation)
    • ejstools — Ejscript includes a documentation generator and disassembler tool as well as a SQLite command line too. These are normally not installed on the target host.
    • ejsweb — The Ejscript Web Framework and ejsweb application generator and manager program.
    • ejscgi — Select if you want to run Ejscript via CGI from a web server.
    • ejswebserver — Select if you want to install the Ejscript embedded Appweb web server.

    Select your desired options and then exit and save your configuration. You are given the option to save on exit.

  5. Build the OpenWrt Linux kernel.
    make
    
  6. Flash the OpenWrt firmware to your device. This is highly device specific and you need to consult the OpenWrt and your device documentation. The new firmware can be found under the bin directory.
  7. If you build Ejscript as a package, it will be built as bin/packages/*/ejs*.ipk. You wll need to install on your target by logging onto your device using ssh and then typing:
    opkg install http://url_to_ejs_package"
    

Configuration

The ejs source tree is built under the build_dir/*/ejs* directory. Ejscript saves the OpenWrt configuration so that you can use make at any time inside the Ejscript source tree. WARNING: If you modify the OpenWrt package/ejs/Makefile, OpenWrt will remove the Ejscript source and re-download and extract the source code. So save any changes you make!

The Ejscript configuration for OpenWrt includes: Ejscript, Sqlite, Regular Expressions, Authentication, Directory Listings, HTTP client, ranged and chunked transfers, error logging and file upload. You can modify this configuration by editing the configure command in OpenWrt packages/ejs/Makefile and the run make or make package/ejs/compile if you are selected to build Ejscript as a package.

© Embedthis Software LLC, 2003-2012. All rights reserved. Embedthis, Ejscript and Appweb are trademarks of Embedthis Software LLC.