[bug-notifications] [cswclassutils 0004118]: Alternate root installation (via pkgadd -R): i.cswcpsampleconf throws chown/chmod errors

Mantis Bug Tracker noreply at opencsw.org
Tue Feb 9 10:22:50 CET 2010

A NOTE has been added to this issue. 
Reported By:                skayser
Assigned To:                bonivart
Project:                    cswclassutils
Issue ID:                   4118
Category:                   regular use
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Date Submitted:             2010-01-07 14:10 CET
Last Modified:              2010-02-09 10:22 CET
Summary:                    Alternate root installation (via pkgadd -R):
i.cswcpsampleconf throws chown/chmod errors
When one installs a package to an alternate root via -R, i.cswcpsampleconf
will throw chown/chmod errors (see additional information). Looks like the
following bit in i.cswcpsampleconf needs some tweaking of the "grep"

                echo Copying sample config to $confdest
                [ -x /usr/bin/pkgadm ] && /usr/bin/pkgadm sync > /dev/null
                contents=`grep "^$dest" /var/sadm/install/contents`
                mode=`echo $contents | awk '{print $4}'`
                user=`echo $contents | awk '{print $5}'`
                group=`echo $contents | awk '{print $6}'`
                cp $dest $confdest
                chmod $mode $confdest
                chown $user:$group $confdest

The "grep" needs to be given a $dest with a potential $PKG_INSTALL_ROOT
stripped while  /var/sadm/install/contents needs to be prepended with
$PKG_INSTALL_ROOT. Example which works in my case:

                file=`echo $dest | sed -e "s,$PKG_INSTALL_ROOT,,"`
                contents=`grep "^$file"

Additionally i suppose, the call to pkgadm also needs to be prefixed with
$PKG_INSTALL_ROOT (but that would need be cross-checked by someone who is
familiar with pkgadm).

Another interesting thing I noticed is that the CAS invoked during an
alternate-root installation are NOT the ones from the alternate root, but
the ones from the system where the alternate root is mounted. Does this
mean that our CAS are worthless for someone who does a Jumpstart
installation and installs our packages during the phase where the installed
system is still mounted at /a?

 (0007419) bonivart (manager) - 2010-02-09 10:22
I have tried this in r8430, both for cpsampleconf and preserveconf. I will
package 1.32 of cswclassutils so it can be tested.

More information about the bug-notifications mailing list