Bering-uClibc 4.x - User Guide - Basic Configuration - LEAF Packages

From bering-uClibc
Revision as of 22:16, 6 November 2010 by Davidmbrooke (Talk | contribs) (Populated "Adding and Removing Packages" with content from

Jump to: navigation, search
Basic Configuration - LEAF Packages
Prev Bering-uClibc 4.x - User Guide Next

Adding and Removing Packages


The configuration is divided into two files: syslinux.cfg defines the place where leaf.cfg can be found during boot process. The packages to load and the devices to load from are defined in leaf.cfg.

Warning: Because leaf.cfg is sourced by linuxrc it is necessary to be aware of linefeed handling. That means you can break leaf.cfg, if you edit it with a Windows editor like Notepad. A possible solution is to use a decent editor like e3 or to run the DOS2UNIX utility, which strips the <CR> chars. It works under pure DOS as well as a DOS box under XP (and I would expect 9x, ME, 2K, NT as well). It can be downloaded from:
Not any more - this link doesn't work! Davidmbrooke 22:16, 6 November 2010 (UTC)

Configuring syslinux.cfg

As with Bering-uClibc 3.x there must be neither packages nor devices defined in syslinux.cfg. You have to configure the LEAFCFG variable instead.

This variable has the following syntax:


Any specified filesystem is tried first. If no filesystem is specified, or a mount using the specified filesystem fails for any reason, all filesystems currently enabled in the kernel (entries in /proc/filesystems that do not start with 'nodev') will be used to try to mount the configuration device.

For a floppy it could be LEAFCFG=/dev/fd0u1680:msdos for a harddisk something like LEAFCFG=/dev/sda1:vfat for a CD-ROM it could be LEAFCFG=/dev/cdrom:iso9660

Configuring leaf.cfg

Variables that may be set in leaf.cfg include:

VERBOSE - (if non-null enables additional output from linuxrc)

LRP - Packages to load

PKGPATH - Device(s) to load packages from

syst_size - Size of root ramdisk

tmp_size - Size of /tmp ramdisk

log_size - Size of /var/log ramdisk

CONFIGDB - name of the config database (Default: configdb.lrp)

MODDB - name of the modules database (Default: moddb.lrp)

Note that spaces, tabs, newlines, or commas may be used to separate entries in the LRP and PKGPATH variables.

Below an example from the base image:

LRP="root config etc local modules iptables dhcpcd keyboard shorwall ulogd dnscache dropbear weblet"

Additional capabilities of leaf.cfg

It's still possible to use "LRP" and "PKGPATH" in syslinux.cfg, they can be extended in leaf.cfg by doing: LRP="$KCMD_LRP extrapackage" and PKGPATH="$KCMD_PKGPATH,/dev/mydev:newfs".

Variables available for use in the leaf.cfg script include any kernel command line parameters (prefixed by KCMD_), the mount point of the LEAFCFG device (MNT), and available filesystems (FILESYSTEMS). See the linuxrc script for full details. Note that the leaf.cfg file is processed *BEFORE* any packages are loaded (in fact, before the package path and package list are finalized), so it would be possible, for example, to load any kernel modules or other software directly off the LEAFCFG= device required to read package files off of attached devices. It is only necessary to have support for the LEAFCFG= device either compiled into the kernel, or included in the /boot directory of the initial ramdisk.

In addition, the leaf.cfg file is sourced as a shell script, allowing the potential for extension of the leafcfg scripts without requiring a modification of the physical boot media - i.e.: anything from:

echo "Hi Mom!"


insmod $MNT/MyWeirdDevice.o --with-parameters
insmod $MNT/NewFileSystem.o
mknod /dev/mydevice -b 123 231

apkg Primer

Copy from

Prev Up Next