Difference between revisions of "Bering-uClibc 4.x - User Guide - Basic Configuration - LEAF Packages"
Davidmbrooke (Talk | contribs) (Corrected navigation header and footer) |
Davidmbrooke (Talk | contribs) (Populated "Adding and Removing Packages" with content from http://leaf.sourceforge.net/doc/buci-lrpkg3.html) |
||
Line 9: | Line 9: | ||
− | + | ==Adding and Removing Packages== | |
− | * apkg Primer | + | |
+ | ===Introduction=== | ||
+ | The configuration is divided into two files: <code class="filename">syslinux.cfg</code> defines the place where <code class="filename">leaf.cfg</code> can be found during boot process. The packages to load and the devices to load from are defined in <code class="filename">leaf.cfg</code>. | ||
+ | |||
+ | '''Warning:''' Because <code class="filename">leaf.cfg</code> is sourced by <code class="filename">linuxrc</code> it is necessary to be aware of linefeed handling. That means you can break <code class="filename">leaf.cfg</code>, 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: http://gatekeeper.dec.com/pub/micro/pc/simtelnet/msdos/txtutl/dos2unix.zip | ||
+ | <br>Not any more - this link doesn't work! [[User:Davidmbrooke|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 <code class="filename">syslinux.cfg</code>. You have to configure the <tt>LEAFCFG</tt> variable instead. | ||
+ | |||
+ | This variable has the following syntax: | ||
+ | LEAFCFG=/dev/device[:filesystem] | ||
+ | |||
+ | 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 <tt>LEAFCFG=/dev/fd0u1680:msdos</tt> for a harddisk something like <tt>LEAFCFG=/dev/sda1:vfat</tt> for a CD-ROM it could be <tt>LEAFCFG=/dev/cdrom:iso9660</tt> | ||
+ | |||
+ | ===Configuring leaf.cfg=== | ||
+ | Variables that may be set in <code class="filename">leaf.cfg</code> 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" | ||
+ | PKGPATH="/dev/fd0u1680:msdos" | ||
+ | syst_size=6M | ||
+ | log_size=2M | ||
+ | |||
+ | ===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 <code class="filename">leaf.cfg</code> 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 <code class="filename">leaf.cfg</code> 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!" | ||
+ | |||
+ | to: | ||
+ | |||
+ | insmod $MNT/MyWeirdDevice.o --with-parameters | ||
+ | |||
+ | insmod $MNT/NewFileSystem.o | ||
+ | |||
+ | mknod /dev/mydevice -b 123 231 | ||
+ | |||
+ | PKGPATH="$KCMD_PKGPATH,/dev/mydev:newfs" | ||
+ | |||
+ | |||
+ | ==apkg Primer== | ||
+ | Copy from http://leaf.sourceforge.net/doc/buci-apkg3.html | ||
Revision as of 22:16, 6 November 2010
Basic Configuration - LEAF Packages | ||
---|---|---|
Prev | Bering-uClibc 4.x - User Guide | Next |
Contents
Adding and Removing Packages
Introduction
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: http://gatekeeper.dec.com/pub/micro/pc/simtelnet/msdos/txtutl/dos2unix.zip
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:
LEAFCFG=/dev/device[:filesystem]
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" PKGPATH="/dev/fd0u1680:msdos" syst_size=6M log_size=2M
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!"
to:
insmod $MNT/MyWeirdDevice.o --with-parameters
insmod $MNT/NewFileSystem.o
mknod /dev/mydevice -b 123 231
PKGPATH="$KCMD_PKGPATH,/dev/mydev:newfs"
apkg Primer
Copy from http://leaf.sourceforge.net/doc/buci-apkg3.html
Prev | Up | Next |