Print this page
6414175 kcf.conf's supportedlist not providing much usefulness

Split Close
Expand all
Collapse all
          --- old/usr/src/pkgdefs/SUNWn2cp.v/postinstall
          +++ new/usr/src/pkgdefs/SUNWn2cp.v/postinstall
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14  # When distributing Covered Code, include this CDDL HEADER in each
  15   15  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16  # If applicable, add the following below this CDDL HEADER, with the
  17   17  # fields enclosed by brackets "[]" replaced with your own identifying
  18   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  
  23   23  #
  24      -# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
       24 +# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  25   25  # Use is subject to license terms.
  26   26  #
  27      -# ident "%Z%%M% %I%     %E% SMI"
  28      -#
  29   27  
  30   28  #
  31   29  # install the UltraSPARC-T2 Crypto Provider device driver
  32   30  #
  33   31  
  34   32  PATH="/usr/bin:/usr/sbin:${PATH}"
  35   33  export PATH
  36      -
  37      -# Add hardware provider section for the n2cp driver
  38      -# to /etc/crypto/kcf.conf
  39      -
  40      -pkg_start="# Start $PKGINST"
  41      -pkg_end="# End $PKGINST"
  42      -kcfconf=${BASEDIR}/etc/crypto/kcf.conf
  43      -tmpfile=/tmp/$$kcfconf
  44      -error=no
  45      -
  46      -#
  47      -# If /etc/crypto/kcf.conf doesn't exist, bail immediately
  48      -#
  49      -if [ ! -f "$kcfconf" ]
  50      -then
  51      -        echo "$0: ERROR - $kcfconf doesn't exist"
  52      -        exit 2
  53      -fi
  54      -
  55      -#
  56      -# If the package has been already installed, remove old entries
  57      -#
  58      -start=0
  59      -end=0
  60      -egrep -s "$pkg_start" $kcfconf && start=1
  61      -egrep -s "$pkg_end" $kcfconf && end=1
  62      -
  63      -if [ $start -ne $end ] ; then
  64      -        echo "$0: missing Start or End delimiters for $PKGINST in $kcfconf."
  65      -        echo "$0: $kcfconf may be corrupted and was not updated."
  66      -        error=yes
  67      -        exit 2
  68      -fi
  69      -
  70      -if [ $start -eq 1 ]
  71      -then
  72      -        cp -p $kcfconf $tmpfile || error=yes
  73      -        sed -e "/$pkg_start/,/$pkg_end/d" $kcfconf > $tmpfile || error=yes
  74      -else
  75      -        cp -p $kcfconf $tmpfile || error=yes
  76      -fi
  77      -
  78      -#
  79      -# Append the delimiters for this package
  80      -#
  81      -echo "$pkg_start driver_names=n2cp" >> $tmpfile || error=yes
  82      -echo "$pkg_end" >> $tmpfile || error=yes
  83      -
  84      -#
  85      -# Install the updated config file and clean up the tmp file
  86      -#
  87      -if [ "$error" = no ]
  88      -then
  89      -        mv $tmpfile $kcfconf || error=yes
  90      -fi
  91      -rm -f $tmpfile
  92      -
  93      -#
  94      -# All done, if any of the steps above fail, report the error
  95      -#
  96      -if [ "$error" = yes ]
  97      -then
  98      -        echo "$0: ERROR - failed to update $kcfconf."
  99      -        exit 2
 100      -fi
 101      -
 102   34  NAMEMAJOR="${BASEDIR}/etc/name_to_major"
 103   35  
 104   36  if [ "${BASEDIR:=/}" = "/" ]
 105   37  then
 106   38          ADD_DRV="/usr/sbin/add_drv"
 107   39  else
 108   40          ADD_DRV="/usr/sbin/add_drv -b ${BASEDIR}"
 109   41  fi
 110   42  
 111   43  grep -w n2cp ${NAMEMAJOR} > /dev/null 2>&1
 112   44  if [ $? -ne 0 ]
 113   45  then
 114   46      $ADD_DRV -i '"SUNW,n2-cwq" "SUNW,vf-cwq"' n2cp || exit 1
 115   47  fi
 116   48  
 117   49  exit 0
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX