Solaris Software Packaging and Installation - PowerPoint PPT Presentation

About This Presentation
Title:

Solaris Software Packaging and Installation

Description:

Can place helper scripts in /var/sadm/ pkgname if desired. Exit status of 0 indicates no errors ... PKGSAV=/var/sadm/pkg/pfp/save. PSTAMP=pf200006161700. TZ ... – PowerPoint PPT presentation

Number of Views:265
Avg rating:3.0/5.0
Slides: 19
Provided by: CITR
Category:

less

Transcript and Presenter's Notes

Title: Solaris Software Packaging and Installation


1
Solaris Software Packaging and Installation
  • Paul Foster
  • 14/11/2000

2
Overview
  • Solaris package mechanism related tools
  • Building packages
  • Preparing packages for burning on CD
  • Sample Package

3
Seven Steps to a Package on CD
  • Build Install Tree
  • Build the pkginfo file
  • Build the prototype file
  • Write your post_install, pre_remove and request
    scripts
  • Build the package
  • Build an ISO Image using mkisofs
  • Burn a CD using the ISO Image

4
Solaris Package Process
pkginfo
mkisofs
SourceFiles
Install Scripts
ISO Image
pkgmk
Package
Burn CD
prototype
pkgproto
CD Package
5
Key files in a package
  • Key Files
  • pkginfo general information about
    the package
  • post_install runs after files are
    extracted
  • pre_remove runs prior to software removal
  • request prompts installer for
    extra information
  • prototype description of files
    permissions
  • 3 types of files
  • -i installation files (/var/sadm/ltpkgnamegt)
  • -f normal files
  • -d directories

6
post_install/pre_remove/request
  • Must be Bourne Shell Scripts (/bin/sh)
  • Scripts run as root - so use explicit paths (e.g.
    /bin/rm)
  • Make parts conditional ( if HPOV installed then
    do x,y,z)
  • Save modified files in a safe place to aid
    re-installing
  • Modifications to files use sed - especially for
    delete
  • Small progress messages / Detailed error messages
  • Request script can be used to read license keys,
    etc.
  • Can place helper scripts in /var/sadm/ltpkgnamegt
    if desired
  • Exit status of 0 indicates no errors

7
The pkginfo file
  • Specifies
  • name of the package (short long form)
  • where to install package (e.g. /opt/pfp)
  • revision information
  • contact details

8
Run-time Environment Settings
  • Exported variables are the settings from your
    pkginfo file
  • BASEDIR/opt/pfp
  • CLIENT_BASEDIR/opt/pfp
  • DESCPauls Sample Package
  • INSTDATENov 14 2000 0828
  • INST_DATADIR/scratch1/tmp/paul/packaging/installa
    tion_package
  • NAMEpfpEMS
  • OAMBASE/usr/sadm/sysadm
  • PKGpfp
  • PKGINSTpfp
  • PKGSAV/var/sadm/pkg/pfp/save
  • PSTAMPpf200006161700
  • TZAustralia/Queensland
  • VERSION2.0,REV2000.6.23.12.00

9
Making a Prototype(pkgproto ltpathnamegt)
  • i postinstall
  • i preremove
  • i request
  • i pkginfo
  • i preremove.sed
  • d none bin 0755 bin bin
  • f none bin/flex 0750 bin bin
  • f none bin/lcc 0751 bin bin

10
Making a Package(pkgmk -o -d ltpathgt -f prototype
-r ltprototype treegt)
  • Examplepkgmk -o -d ./installation_tree -f
    prototype -r ./prototype_tree
  • installation_tree is the target package
    directory
  • prototype describes how I want
    things installed
  • prototype_tree is my source files copied
    from the build area

11
Installing our package(pkgadd -d ltdrivegt
ltpkgnamegt)
  • bash /usr/sbin/pkgadd -d /scratch/tmp/paul/packag
    ing/installation_package pfp
  • Processing package instance ltpfpgt from
    lt/scratch1/tmp/paul/packaging/installation_package
    gt
  • pfpEMS
  • (sparc) 2.0,REV2000.6.23.12.00
  • CiTR Pty Ltd.
  • The selected base directory lt/opt/pfpgt must exist
    before installation is attempted.
  • Do you want this directory created now y,n,?,q
    y
  • Using lt/opt/pfpgt as the package base directory.
  • Processing package information.
  • Processing system information.
  • Verifying disk space requirements.
  • Checking for conflicts with packages already
    installed.
  • Checking for setuid/setgid programs.

12
Installing our Package (cont.)
  • This package contains scripts which will be
    executed with super-user
  • permission during the process of installing this
    package.
  • Do you want to continue with the installation of
    ltpfpgt y,n,? y
  • Installing pfpEMS as ltpfpgt
  • Installing part 1 of 1.
  • /opt/pfp/bin/flex
  • /opt/pfp/bin/lcc
  • verifying class ltnonegt
  • Executing postinstall script.
  • Installation of ltpfpgt was successful.

13
Information about our package(pkginfo -l -d
ltpathgt ltpkgnamegt)
  • bash /usr/bin/pkginfo -l -d /cdrom/cdrom0 pfp
  • PKGINST pfp
  • NAME pfpEMS
  • CATEGORY system
  • ARCH sparc
  • VERSION 2.0,REV2000.6.23.12.00
  • BASEDIR /opt/pfp
  • VENDOR CiTR Pty Ltd.
  • DESC Pauls Sample Package
  • PSTAMP pf200006161700
  • HOTLINE Please contact your local system
    administrator.
  • STATUS spooled
  • FILES 8 spooled pathnames
  • 1 directories
  • 2 executables
  • 5 package information files
  • 1067 blocks used (approx)

14
Removing our package(pkgrm ltpkgnamegt)
  • bash /usr/sbin/pkgrm pfp
  • The following package is currently installed
  • pfp pfpEMS
  • (sparc) 2.0,REV2000.6.23.12.00
  • Do you want to remove this package? y
  • Removing installed package instance ltpfpgt
  • This package contains scripts which will be
    executed with super-user
  • permission during the process of removing this
    package.
  • Do you want to continue with the removal of this
    package y,n,?,q y
  • Verifying package dependencies.
  • Processing package information.
  • Executing preremove script.
  • Removing pathnames in class ltnonegt
    (...Some stuff deleted...)
  • Updating system information.
  • Removal of ltpfpgt was successful.

15
/var/sadm/pkg
  • Your pre_remove script lives here until the
    package is removed
  • pkginfo file determines what gets put in here
  • If your package fails to remove cleanly
  • Hand cleanup
  • Edit the pre_remove to exit 0 immediately
  • Do the pkgrm

16
Burning the package onto a CD
  • mkisofs - builds an ISO9660 file
    systeme.g.mkisofs -l -o /tmp/cd.iso -a -r -v -A
    ems ./installation_package
  • Later versions (1.12) support a -J flag (Joilet
    support) and tools for verification of ISO images
  • Newer versions are downloadable off the net.
  • cd.iso suitable for burning onto a CD(Solaris
    readable by default, PC readable with -J flag)

17
A Working Example
  • For a very simple fully integrated/automated
    example
  • Build a prototype tree
  • Builds a prototype
  • Builds a package
  • Builds an ISO file system
  • Makefile to perform all tasks in correct order
  • See /home/foster/tweek/solaris_package.tar.gz

18
Other Thoughts
  • Alteration of Build Process to Instrument
    Binaries
  • Simple code generation of build information
  • Release Number, Build Description, Incremental
    Build No, etc.
  • Doesnt depend on revision control strings
    embedded in binary (not everyone uses RCS/CVS)
  • Manifest of installed binaries (e.g. TP414.1
    experience)
  • Solaris JumpStart Mechanism
  • Automated rebuilding of test machine (TV935.3
    experience)
Write a Comment
User Comments (0)
About PowerShow.com