The Project Directory

Previous sections explained the contents of the Embedded Linux Workshop.This section explains the contents of the project directory, which contains the files that are specific to a particular project you may be building.The project directory is normally named after the project it contains. For instance, if you’re using the Embedded Linux Workshop to build a router, your project directory might be named router.

The project directory contains the following files and directories.

File/Directory Description
BUILD The BUILD file contains a number that’s incremented every time you build the project.This helps you keep track of different copies of the media.
arch and opt These directories have the same layout as their counterparts in the Embedded Linux Workshop directory structure, and they serve the same purpose.You would put any code that’s specific to the current project in these directories.
config The config file is a piece of Perl code that configures the Embedded Linux Workshop for the project. It’s described in detail in the next section.
obj All the output of the Embedded Linux Workshop finds its way into the obj directory. It contains the root filesystem, the kernel, and the image that needs to make its way to the boot media.

The config file

Running elw --newproject zug at the command line produces the following output:

Building project zug: 
#mkdir -p zug/obj 
#mkdir -p zug/opt 
#mkdir -p zug/arch/i386/opt 
#mkdir -p zug/arch/i386/src/kernel 
#touch zug/arch/i386/src/kernel/linux_directory_goes_here 
#mkdir -p zug/mnt 

Within the root of the new project is a file named config.The config file configures the Embedded Linux Workshop for the current project. Let’s look at it piece by piece.

###################################################################### 
# Configuration for zug 
# [NOTE: this file configures your project. You must modify it as] 
# [NOTE: necessary for your project.                             ] 
###################################################################### 

$STYLE="syslinux"; 

The --newproject option defaults to the SYSLINUX style. Much of the following discussion is dependent on the SYSLINUX style. If you’re using a different style, look at the source code for that style for more information on its needs.

# Initial Ram Disk 
# ----------------
$INITRDSZ=10240;                                # Size (512 byte) 
$INITRDINODES=1024;                             # inodes 

These variables size the root filesystem.

# Disk image attributes 
# ------------------------
$DISK_BLOCKS=1440;                              # 1K blocks of media 

This one sizes the boot media.There are 1440 1KB blocks on a 1.44MB 3½-inch floppy disk.

# Application info 
# -----------------------------------------
$APP_NAME=“zug”; 
$APP_SNAM=“zug”; 
$APP_VERS=“0.0.1”; 
$APP_ROOT=“/dev/fd0”;                           # A 1.44mb floppy size 

The $APP_ROOT variable is important because the boot script will attempt to mount its contents at boot time so it can get to the configuration information.

# Options required for this software package 
# ------------------------------------------
@OPT=("zug"); 
@OPT=(@OPT,"bash"); 

# Debug packages 
# --------------
@OPT=(@OPT,"fdisk"); 
@OPT=(@OPT,"strace"); 
@OPT=(@OPT,"vi"); 

The @OPT variable contains the packages that are specific to this project. The debug packages take some room, so they should be left out of the production image. Note that the elw script will find the packages, whether they’re in the Embedded Linux Workshop directories or within the project’s directories. If they’re in both, the project’s directory takes precedence.

# Devices for this package 
# ------------------------
$DEV="ttyS0 ttyS1 ttyS2 ttyS3"; 

Your project may or may not need these devices. They’re listed here mainly so you can see how to add devices to your final image. Use or remove them as you like.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.242.165