Howto upgrade the on a target FREESCO

This article will describe a technique used in package installation scripts to handle the upgrade of on a target FREESCO 0.3.x system.

Why is this so different from other libs?

The library is always in use on the target system because most of the linux software is written in the C (or C++) language. The library is the so called run time library and it contains routines that are used by almost all software that's running on linux. This is why it's not possible to handle this lib as any other, because when you try the target system will crash!

Why do I need to upgrade?

The stock on the FREESCO floppy is a stripped version of the library and only contains the most common functions. More elaborate software, like f.i. Apache need the full blown version of and thus the installation package should provide a way to upgrade the library. The best way to try if your package needs the full blown file, is to install your package on a fresh FREESCO system and see if the software runs with the stripped down version or not.

The technique

  • create a directory called libc in the pkg directory of your new package
  • compress the full blown, this file is 614840 bytes in size and compressed with gzip max. compression level it reduces to 246017 bytes. You can get the full blown version from your zipslack 3.9 development system.
gzip -9
  • Place the resulting file in the pkg/libc directory
  • In the postinstall section of the package installation script, add a check for the presence of the upgraded on the target system:

                if [ ! -f /pkg/lib/ ]; then
                   echo "${CR}Upgrading${CD}"
                   zcat < /pkg/libc/ > /pkg/lib/
                   chmod +x /pkg/lib/
                rm -fr /pkg/libc 2>/dev/null
                pkg -rescan

As you can see this code checks for a file in /pkg/lib on the target system and if not found uses the zcat tool (default present on FREESCO) to unpack the compressed file to /pkg/lib. It also adds the executable bit to the resulting Then it cleans up by removing the libc directory from the /pkg directory. Finally it flushes the disk cache (twice to make sure) and runs the pkg script in rescan mode to make sure all symlinks are created.

  • Now package your package as usual and of course you'll need to test it by installing it on a bare bone FREESCO box. The first time it should upgrade the library (message “Upgrading” is printed during installation), the 2nd installation on the same box, it should not perform the upgrade (library files are never removed, even when a package is uninstalled).

Of course, there are many other possible solutions to upgrade the library (f.i. see the OpenSSL package, where the file is downloaded during the preinstall section), so you're welcome to try other techniques if you like.

dingetje 2005/05/31 11:50

freesco/howtos/package_libc.txt (43725 views) · Last modified: 2005/09/14 00:49 (external edit)
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki