Bering-uClibc 3.x provides a new package management and configuration backup
tool - apkg.
Eric Spakman re-wrote "apkg" as a replacement for lrpkg. His work is based on
David Douthitt's, Nathan Angelacos and Natanael Copa's efforts towards a more
advanced package management tool.
apkg simplifies configuration saving, is extendable and eases package updates.
The most visible difference is that all changes to the various configuration
files and directories are saved in configdb.lrp. Modules are saved in
moddb.lrp.
Both the configdb and moddb names can be changed in leaf.cfg, the defaults are
configdb.lrp and moddb.lrp.
1) Saving configuration changes
The "LEAF configuration menu" is the first screen you'll see after login. You
can always start it from the shell prompt with the "lrcfg" command.
In this menu you'll find in the lower right corner the commands to save
configurations ("s) Save config") and backup the modules ("m) Backup
modules).
The first one will save all changed configuration files and directories.
You can change the options "always writing to /tmp before /mnt" and the
confirmation question before writing the lrp to your storage media
in /etc/config.cfg.
Setting CWRT to "off" allows you to save your configured box completly with
only two keystrokes ("s" and "m" ).
2) apkg command line options
apkg supports the following commands:
-i [path]<package> install package
-u [path]<package> upgrade package
-c [path]<package> list contents of package
-l [<package>] list installed packages; if <package> given, tell if
it is installed
-h this help
3) Upgrading packages
The new package and configuration management alleviate upgrading packages.
Just copy a new version of a package to your storage media and reboot. The new
version is loaded (from <package>.lrp) with your previous configuration,
because the configuration files in the package are overwritten by those saved
earlier in configdb.lrp.
You can also use the apkg -u upgrade command, created by Cedric Schieli. When
apkg -u is invoked, the user will be prompted for each changed configuration
file - you have the choice to keep the old file, install the new file, view a
diff or edit a merged version. If a configuration file has not changed
between two releases (e.g. no new defaults, no new options etc), the file
modified by the user will be kept without asking.
The new package has to be copied to the storage media before the upgrade to
survive a reboot and for the same reason the config has to be saved after the
upgrade.
4) Some more insights for developers and interested users
- Every package has a <package>.local file with files listed which shall be
saved.
- At startup (linuxrc) the sha1 sums of everything listed in the
<package>.local file are calculated and saved in <package>.sha1 files. This
part is done with a "find", so also directories can be listed in
<package>.local files. But only use directories in a local file, when this
directory is unique for the package, otherwise the content is processed
multiple times which costs time and processing power.
- During backup the sha1sums of the files in memory are compared with the
saved *.sha1 sums, new files are detected and duplicates are filtered out.
For example: when one package has an etc/ppp directory in <package>.local and
another one an etc/ppp/dsl-providers file listed, the dsl-provider file would
be find twice and also stored twice in the configdb.
Changed files are saved in "configdb".lrp with a "full" backup, this is
dynamic so installing (or removing) a package will also be taken into
account.
- The first device in the PKGPATH list is used as backup device.
- The configdb and moddb will always loaded last by linuxrc. This loading is
automatic so there is no need to specify configdb and moddb in the packages
list.
Modules system, a very simple implementation:
- The complete /lib/modules directory is backuped to "moddb".lrp and
the /lib/modules/'kernel version' is excluded. This also means that the
modules.lrp package now only contains the insmod logic and no modules.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
------------------------------------------------------------------------
leaf-user mailing list: [email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/