Update of /cvsroot/leaf/doc/guide/install-bering-uclibc-v3
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13953
Modified Files:
book.xml
Added Files:
buci-apkg3.xml
Log Message:
add a chpt. about apkg
--- NEW FILE: buci-apkg3.xml ---
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="buci-apkg3">
<chapterinfo>
<authorgroup>
<author>
<firstname>K.P.</firstname>
<surname>Kirchdörfer</surname>
<affiliation>
<address><email>kapeka at users sourceforge.net</email></address>
</affiliation>
</author>
<author>
<firstname>Eric</firstname>
<surname>Spakman</surname>
<affiliation>
<address><email>espakman at users.sourceforge.net</email><firstname>
Luis</firstname><surname>Correia</surname><affiliation>
<address><email>lfcorreia at
users.sourceforge.net</email></address>
</affiliation></address>
</affiliation>
</author>
</authorgroup>
<revhistory>
<revision>
<revnumber>1.0</revnumber>
<date>2006-11-17</date>
<authorinitials>kp</authorinitials>
<revremark>Initial version</revremark>
</revision>
</revhistory>
</chapterinfo>
<title>apkg primer</title>
<section>
<title>What is apkg?</title>
<para><filename>apkg</filename> is the new tool for package management and
configuration in LEAF's <ulink
url="http://leaf.sourceforge.net/mod.php?mod=userpage&menu=910&page_id=36">Bering-uClibc</ulink>
branch.</para>
<para>It was first introduced with Bering-uClibc 3.0 and replaces the aged
<filename>lrpkg</filename> scripts.</para>
</section>
<section>
<title>Why is apkg better then lrpkg?</title>
<para><filename>apkg</filename> simplifies configuration saving, is
extensible and eases package updates.</para>
<para>The difference from the old <filename>lrpkg</filename> package
management scripts is that, from now on the <filename>.lrp</filename>
packages become effectively read-only, while the changes to the various
configuration files are saved in a new package called
<filename>configdb.lrp</filename>. As for the kernel modules (ie: the
files in <filename>/lib/modules</filename>), they are now stored in
another new package called <filename>moddb.lrp</filename>.</para>
<para>This approach improves not only the way packages are handled, by
saving only the information that has changed, but also provides new
options for preparing special base installations (such as a simple fileset
for WRAP boards), while providing easy package upgrades.</para>
</section>
<section>
<title>Using apkg</title>
<para><filename>apgk</filename> has two modes of operation, just like
<filename>lrpkg</filename>. The most used mode is interactive, it's the
one you see right after logging in. But it can also be used via the shell
prompt using switches.</para>
<para><note>
<para>The first time the router boots, there is no
<filename>configdb.lrp</filename> (unless added by hand). You may see
some 'not found' errors, this is an expected behaviour and will
disapear once you save the config.</para>
</note></para>
</section>
<section>
<title>Saving your configuration</title>
<section>
<title>Interactive mode</title>
<para>The "<computeroutput>LEAF configuration menu</computeroutput>" is
the first screen you'll see after login. You can always start it from
the shell prompt with the <command>lrcfg</command> command.</para>
<para>This menu has some changes in the lower right corner, the
available commands are now:</para>
<itemizedlist>
<listitem>
<para><command>s</command>) Save configuration</para>
</listitem>
</itemizedlist>
<itemizedlist>
<listitem>
<para><command>m</command>) Backup modules</para>
</listitem>
</itemizedlist>
<itemizedlist>
<listitem>
<para><command>c</command>) Show configuration changes since last
save</para>
</listitem>
</itemizedlist>
<itemizedlist>
<listitem>
<para><command>d</command>) Show configuration changes from
defaults</para>
</listitem>
</itemizedlist>
<para><command>s</command> - will save all changed configuration files
and directories to <filename>configdb.lrp</filename>.</para>
<para><command>m</command> -backs up the modules directory
<filename>/lib/modules</filename> to
<filename>moddb.lrp</filename>.</para>
<note>
<para>The file <filename>/etc/modules</filename> will be saved in
<filename>configdb.lrp</filename>. If you only changed the entries in
this file, "Save config" is enough. But if you add a new module and
changed <filename>/etc/modules</filename> you have to save both - the
configuration and the modules.</para>
</note>
<para>You can change the confirmation question before writing the lrp to
your storage media in /etc/config.cfg. Setting CWRT to "off" allows you
to save your completly configured box with only two keystrokes ("s" and
"m" ).</para>
<para>There are two more commands available regarding configuration
changes and saving:</para>
<itemizedlist>
<listitem>
<para><command>c</command>) Show configuration changes since last
save</para>
<para>This command shows the changes in all your configuration files
and directories since you saved your configuration.</para>
</listitem>
<listitem>
<para><command>d</command>) Show configuration changes from
defaults</para>
<para>This command shows all changes between your setup and the
distribution defaults as shipped.</para>
</listitem>
</itemizedlist>
<note>
<para>Both commands only work if you saved configurations at least
once.</para>
</note>
</section>
<section>
<title>Command line switches</title>
<para>apkg supports the following commands:</para>
<itemizedlist>
<listitem>
<para>-i [path]<package> install package</para>
</listitem>
<listitem>
<para>-u [path]<package> upgrade package</para>
</listitem>
<listitem>
<para>-c [path]<package> list contents of package</para>
</listitem>
<listitem>
<para>-l [<package>] list installed packages; if
<package> given, tell if it is installed</para>
</listitem>
<listitem>
<para>-h this help</para>
</listitem>
</itemizedlist>
</section>
</section>
<section>
<title>Upgrading packages</title>
<para>The new package and configuration management alleviate upgrading
packages. You can copy a new version of a package to your storage media
and with reboot the new version is loaded (from the <package>.lrp)
and your previous configuration, cause the configuration files in the
package are overwritten by those saved earlier in
<filename>configdb.lrp</filename>.</para>
<para>You can also use the <command>apkg -u</command> upgrade command.
When <command>apkg -u</command> is invoked, the user will be prompted for
each changed configuration file - you can 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.</para>
<note>
<para>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.</para>
</note>
</section>
<section>
<title>More insights for developers and interested users</title>
<para>Every package has a <filename><package>.local</filename> file
with files listed which shall be saved. At startup (linuxrc) the sha1sums
of everything listed in the <filename><package>.local</filename>
file are calculated and saved in <filename><package>.sha1</filename>
files. This part is done with a "find", so also directories can be listed
in <filename><package>.local</filename> files. Only use directories,
when this directory is unique for the package, otherwise the content is
processed multiple times which cost 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.</para>
<para>For example: when one package has an etc/ppp directory in
<filename><package>.local</filename> and another one an
<filename>etc/ppp/dsl-providers</filename> file listed, the
<filename>dsl-provider</filename> file would be find twice and also stored
twice in the <filename>configdb</filename>. Changed files are saved in
<filename>configdb.lrp</filename> with a "full" backup, this is dynamic so
installing (or removing) a package will also be taken into account.</para>
<para>The first device in the PKGPATH list is used as backup device. The
<filename>configdb</filename> and <filename>moddb</filename> will always
loaded last by linuxrc. This loading is automatic so there is no need to
specify <filename>configdb</filename> and <filename>moddb</filename> in
the packages list. Modules system, a very simple implementation: The
complete <filename>/lib/modules</filename> directory is backuped to
<filename>moddb.lrp</filename> and the /lib/modules/'kernel version' is
excluded. This also means that the <filename>modules.lrp</filename>
package now only contains the insmod logic and no modules.</para>
</section>
<section>
<title>Customizing packages</title>
<para>apkg only saves configuration files, declared in
<package>.local. It does never save the complete package. It is also
not recommended to add binaries to the configdb file.</para>
<para>So, if you want to customize a package, like replacing a file in the
LRP or adding new files to the LRP, it is suggested that you build a new
package from scratch.</para>
<para>Building a LRP for a few small scripts, that are added on a running
system and are not part of any package can shurely be overkill. By adding
those files to the /var/lib/lrpkg/local.local file, they will be forced to
be saved in the config database. The format is simple, just list the full
path to the file without a leading slash:
<filename>etc/init.d/example.sh</filename></para>
<para><emphasis>Don't remove the first entry in this
file.</emphasis></para>
</section>
<section>
<title>Acknowledgments and Thanks</title>
<para>"apkg" was rewritten by Eric Spakman a replacement for lrpkg. His
work was based on David Douthitt, Nathan Angelacos and Natanael Copa's
efforts towards a more advanced package management tool. Cedric Schieli
and Paul S. Traina added new features and helped to fix and cleanup Eric's
work.</para>
</section>
</chapter>
Index: book.xml
===================================================================
RCS file: /cvsroot/leaf/doc/guide/install-bering-uclibc-v3/book.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** book.xml 16 Nov 2006 18:08:49 -0000 1.1
--- book.xml 16 Nov 2006 18:48:19 -0000 1.2
***************
*** 20,23 ****
--- 20,24 ----
<!ENTITY TZ SYSTEM "buci-tz3.xml">
<!ENTITY webconf SYSTEM "buci-webconf3.xml">
+ <!ENTITY apkg SYSTEM "buci-apkg3.xml">
]>
<book id="buc-install3">
***************
*** 41,44 ****
--- 42,46 ----
&TZ;
&webconf;
+ &apkg;
</book>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
leaf-cvs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits