Solaris IPS documentation

November 21st, 2011

Oracle’s Image Packaging Service (IPS) is documented here: http://www.oracle.com/technetwork/server-storage/solaris11/technologies/ips-323421.html

From here there is a step by step example of creating a package here:  http://wikis.sun.com/download/attachments/240520636/oracle-solaris-11-ips-dev-guide.pdf

Here are some of the steps

 

  mkdir proto
  mkdir proto/opt
  # add the package files in opt
  pkgsend generate proto | pkgfmt > mypkg.p5m.1
  cat  << EOF > mypkg.mog
set name=pkg.fmri value=mypkg@1.0,5.11-0
set name=pkg.summary value="This is our example package"
set name=pkg.description value="This is a full description of \
all the interesting attributes of this example package."
set name=variant.arch value=\$(ARCH)
set name=info.classification \
    value=org.opensolaris.category.2008:Applications/Accessories
link path=usr/share/man/index.d/mysoftware target=opt/mysoftware/man
drop>
EOF
  pkgmogrify -DARCH=`uname -p` mypkg.p5m.1 mypkg.mog  | pkgfmt > mypkg.p5m.2
  pkgdepend generate -md proto mypkg.p5m.2 | pkgfmt > mypkg.p5m.3
  pkgdepend resolve -m mypkg.p5m.3
  pkglint mypkg.p5m.3.res
  pkgrepo create /scratch/my-repository
  pkgrepo -s /scratch/my-repository set publisher/prefix=mypublisher

Now  with these steps done, the package is ready to  be published. Here is the command as stated in the documentation.

  pkgsend -s /scratch/my-repository/ publish -d proto mypkg.p5m.4.res

What happens? The pkgsend command just hangs.
After using “truss” it’s easy to see that pkgsend is waiting for input from stdin.

  24440:  read(0, 0xFEF79C20, 1024)       (sleeping...)

Hitting control D, “^D”, gives:

   pkgsend: The URI '/scratch/my-repository/' contains an unsupported scheme ''.

which leads to https://defect.opensolaris.org/bz/show_bug.cgi?id=17143 point to a slightly different syntax:

   pfexec pkgsend -s file:///scratch/my-repository/ publish -d proto mypkg.p5m.4.res

hitting ^D gives:

  'The specified FMRI, 'pkg:/mypkg.p5m.4.res', has an invalid version.

There is not much information on this error, but some here https://defect.opensolaris.org/bz/show_bug.cgi?id=1348

In every case, pkgsend is trying to read from standard in. The documentation does say that pkgsend will read from standard in when the manifest is not on the command line:
http://download.oracle.com/docs/cd/E23824_01/html/E21796/pkgsend-1.html

publish [-b bundle …] [-d source …] [-s repo_uri_or_path] [-T pattern] [--no-catalog] [manifest …]

Publishes a package using the specified package manifests to the target package repository, retrieving files for the package from the provided sources. If multiple manifests are specified, they are joined in the order provided. If a manifest is not specified, the manifest is read from stdin.

But on the command line used, the manifest is  specified, so what is happening?

Scanning the command like options turns up:

  Usage:
        pkgsend [options] command [cmd_options] [operands]
  Packager subcommands:
        pkgsend open [-en] pkg_fmri
        pkgsend add action arguments
        pkgsend import [-T pattern] [--target file] bundlefile ...
        pkgsend include [-d basedir] ... [-T pattern] [manifest] ...
        pkgsend close [-A | [--no-index] [--no-catalog]]
        pkgsend publish [-d basedir] ... [-T pattern] [--no-index]
          [--fmri-in-manifest | pkg_fmri] [--no-catalog] [manifest] ...
        pkgsend generate [-T pattern] [--target file] bundlefile ...
        pkgsend refresh-index
  Options:
        -s repo_uri     target repository URI
        --help or -?    display usage message
  Environment:
        PKG_REPO

and there is an interesting command line option that looks a bit reminiscent of the last error “–fmri-in-manifest“. Giving it a shot:

  pfexec pkgsend -s file:///scratch/my-repository/ publish -d proto --fmri-in-manifest mypkg.p5m.4.res
  pkg://mypublisher/mypkg@1.0,5.11-0:20111121T141936Z
  PUBLISHED

 

And it works!


Uncategorized

  1. Trackbacks

  2. No trackbacks yet.
  1. Comments

  2. No comments yet.
You must be logged in to post a comment.