Download presentation
Presentation is loading. Please wait.
Published byCalvin Townsend Modified over 9 years ago
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 Source Files pkginfo prototype Install Scripts pkgmk Package mkisofs ISO Image CD Package pkgproto Burn CD
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/ ) –-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/ 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 DESC=Pauls Sample Package INSTDATE=Nov 14 2000 08:28 INST_DATADIR=/scratch1/tmp/paul/packaging/installation_package NAME=pfpEMS OAMBASE=/usr/sadm/sysadm PKG=pfp PKGINST=pfp PKGSAV=/var/sadm/pkg/pfp/save PSTAMP=pf200006161700 TZ=Australia/Queensland VERSION=2.0,REV=2000.6.23.12.00
9
Making a Prototype (pkgproto ) 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 -f prototype -r ) Example: pkgmk -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 ) bash# /usr/sbin/pkgadd -d /scratch/tmp/paul/packaging/installation_package pfp Processing package instance from pfpEMS (sparc) 2.0,REV=2000.6.23.12.00 CiTR Pty Ltd. The selected base directory must exist before installation is attempted. Do you want this directory created now [y,n,?,q] y Using 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 [y,n,?] y Installing pfpEMS as ## Installing part 1 of 1. /opt/pfp/bin/flex /opt/pfp/bin/lcc [ verifying class ] ## Executing postinstall script. Installation of was successful.
13
Information about our package (pkginfo -l [-d ] ) bash# /usr/bin/pkginfo -l -d /cdrom/cdrom0 pfp PKGINST: pfp NAME: pfpEMS CATEGORY: system ARCH: sparc VERSION: 2.0,REV=2000.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 ) bash# /usr/sbin/pkgrm pfp The following package is currently installed: pfp pfpEMS (sparc) 2.0,REV=2000.6.23.12.00 Do you want to remove this package? y ## Removing installed package instance 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 (...Some stuff deleted...) ## Updating system information. Removal of 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 system e.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. Doesn’t 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)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.