---
name: "SystemInstaller::Package"
section: "3pm"
platform: "linux"
package: "systeminstaller"
version: "1.04-3"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/SystemInstaller::Package"
---

# SystemInstaller::Package(3pm)

Interface to packaging for SystemInstaller

## NAME

SystemInstaller::Package - Interface to packaging for SystemInstaller

## SYNOPSIS

```
 use SystemInstaller::Package;
```

```
 $location=     "<package file location>";
 $root=         "<image root location>";
 $arch=         "<image architecture>";
 @filename=     "<package list filenames>";
```

```
 unless (&pkg_install($location,$root,$arch,@filename) {
        printf "install failed\n";
 }
```

## DESCRIPTION

SystemInstaller::Package provides an interface to package installation for SystemInstaller.

## ARGUMENTS

- $location

  The location (directory) that contains the package install files.

- $root

  The directory that will contain the image.

- $arch

  The target architecture for the image.

- @filename

  A list of package list files.

## Module API specification

SystemInstaller::Package uses Perl modules to provide the actual functions for specific package types. In order to add support for a new package  type the following must be provided in a perl module file named  \<pkgtype\>.pm in the Package subdirectory of the SystemInstaller library. Additionally, the module name must be added to the `@PKGMODS` array in  the Package.pm module. The order of the modules in the array determines the heirarchy. The Rpm module should remain last as the default. Finally, a use statement must be added for the new module in the Package.pm library.

THIS API IS NOT YET FINAL!!! It may (and probably will) change somewhat in the near future.

- sub files\_find($class,$path,$arch,@pkglist)

  Find the best files for the given packages. `$path` contains the location of the package files, `$arch` is the desired image architecture, `@pkglist` contains the names of the desired packages. Returns: list of filenames  (without leading directories) or 0 on failure.

- sub files\_pre\_install($class,$imgpath,$path)

  Perform any required pre-installation action in the image.  `$imgpath` contains the root directory for the image, `$path` contains the  location of package files. Returns: 1 on success, 0 on failure.

- sub files\_install($class,$imgpath,$path,@filelist)

  Install the package files into the image. `$imgpath` contains the root directory for the image, `$path` contains the location of package files, `@filelist` contains the list of filenames as returned from &files\_find. Returns: 1 on success, 0 on failure.

- sub files\_post\_install($class,$imgpath,$path)

  Perform any required post-installation action in the image.  `$imgpath` contains the root directory for the image, `$path` contains the  location of package files. Returns: 1 on success, 0 on failure.

- sub footprint($class,$mode,$path,$imgpath);

  Determine if this modules subroutine for the specific mode should be used. `$path` contains the location of the package files. `$imgpath` is the location of the image and is only available for **post\_install** and **kernel** modes. Returns: 1 if this module's subroutine is to be used, 0 if not.

  Valid modes are:

  - files

    Finding the best files to use, the &files\_find subroutine.

  - pre\_install

    Before the packages are installed, the &files\_pre\_install subroutine.

  - install

    Installing the packages, the &files\_install subroutine.

  - post\_install

    After the packages are installed, the &files\_post\_install subroutine.

## AUTHOR

Michael Chase-Salerno \<mchasal@users.sourceforge.net\>

## SEE ALSO

SystemInstaller::Package::Rpm SystemInstaller::Package::Deb SystemInstaller::Package::Suse SystemInstaller::Package::Turbo mksiimage
