- 1 Introduction
- 1.1 Solaris Packages and JET
- 1.2 Building Solaris Packages
- 1.2.1 Give your Package a Name
- 1.2.2 Create the source directory structure
- 1.2.3 Create a pkginfo file
- 1.2.4 Create a preinstall script
- 1.2.5 Create a postinstall script
- 1.2.6 Supply your files to be packaged
- 1.2.7 Create a prototype file
- 1.2.8 Make your package
- 1.2.9 Copy package to the JET install area
- 1.2.10 Test the package install
- 1.2.11 Copy this new package to the JET install area (making it available for JET installs)
This document contains the procedures to follow when creating custom ACME packages for use within Solaris 9 and Solaris 8 builds that can then form part of your JET Builds. Packages within Solaris 10 have changed a bit and are ‘zone aware’ …… this is not covered in this document.
Solaris Packages and JET
The Solaris build methodology in use within ACME is JET. JET (Jumpstart Enterprise Toolkit) can use either
- Custom scripts OR
- Custom packages
As of Solaris 9 the decision was made to move away from custom scripts and over to custom packages.
Packages have more advantages of scripts in that they are self checking and under version control. The remainder of this document walks the reader through an example of how to make such custom packages.
Package source directory on JET (jet-master) The package source at the time of writing this document was
Building Solaris Packages
Give your Package a Name
A package needs a unique name and traditionally the first 4 characters help to identify the vendor. For this example we will use.
Create the source directory structure
# mkdir –p /export/source/pkgs/ACMEaardvark/1.0/ # cd /export/source/pkgs/ACMEaardvark/1.0/
Create a pkginfo file
# vi pkginfo PKG="ACMEaardvark" NAME="ACME aardvark package” ARCH="sparc" VERSION="1.0" CATEGORY="application" VENDOR="ACME" EMAIL="firstname.lastname@ACME.co.uk" PSTAMP"15th August 2006" BASEDIR="/etc" CLASSES="none"
Create a preinstall script
# vi preinstall #!/bin/ksh #do nothing
Create a postinstall script
# vi postinstall #!/bin/ksh #do nothing
Supply your files to be packaged
# touch aardvark.txt # echo “this is the ACMEaardvark package” >> aardvark.txt
Create a prototype file
# cd /export/source/pkgs/ACMEaardvark/1.0/ # find . -print | pkgproto >> prototype
Edit this file and modify it so it looks similar to the one shown below
i pkginfo=./pkginfo i preinstall=./preinstall i postinstall=./postinstall f none aardvark.txt 0644 root other
Make your package
# cd /export/source/pkgs/ACMEaardvark/1.0/ # pkgmk -r `pwd`
Copy package to the JET install area
# mkdir -p /export/install/pkgs/ACMEaardvark/1.0/ # mv /var/spool/pkg/ACMEaardvark /export/install/pkgs/ACMEaardvark/1.0/
Test the package install
As root on a test server(jet-client) do the following
root@jet-client# cd /net/jet-server/export/install/pkgs/ACMEaardvark/1.0/ root@jet-client# /net/jet-server/export/install/pkgs/ACMEaardvark/1.0> pkgadd -d . The following packages are available: 1 ACMEaardvark ACME aardvark package (sparc) 1.0 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: Processing package instance <ACMEaardvark> from </net/jet-server/export/install/pkgs/ACMEaardvark/1.0>
ACME aardvark package (sparc) 1.0 ACME Using </etc> 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. 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 <ACMEaardvark> [y,n,?] y Installing ACME aardvark package as <ACMEaardvark>
## Executing preinstall script. ## Installing part 1 of 1. /etc/aardvark.txt [ verifying class <none> ] ## Executing postinstall script. Installation of <ACMEaardvark> was successful. The following packages are available: 1 ACMEaardvark ACME aardvark package (sparc) 1.0 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: q
Copy this new package to the JET install area (making it available for JET installs)
Should you wish to make your new package available during a JET build perform the following on the JET master (jet-server):
root@jet-client# copy_custom_packages /export/install/pkgs/ACMEaardvark/1.0/ sparc ACMEaardvark ACMEaardvark Transferring <ACMEaardvark> package instance Transferring <ACMEaardvark> package instance Packages copied
The ACMEaardvark package is now available for installs via post-install and during a JET build.
To add ACMEaardvark to a JET template do similar to that shown below:
Change the following line in your template
You will then have to re run `make_client –f <jet-client>` as per the standard JET install instructions.