5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
25 # Author: Jeff Bonwick
27 # Please report any bugs to bonwick@eng.
31 # Install performs the following steps:
33 # 1. Get the list of modules, configuration files, and links
36 # 2. Create the requested subset of /kernel in Install's temp space
37 # (/tmp/Install.username by default.)
39 # 3. Create a tar file (/tmp/Install.username/Install.tar) based on (3).
41 # 4. If -n was specified, exit. If a target was specified using -T,
42 # rcp the tarfile to the target and exit. If a target was specified
43 # using -t, rsh to the target machine and untar the tarfile in the
46 # If any of these steps fail, Install will give you an error message and,
47 # in most cases, suggest corrective measures. Then, you can recover the
48 # install with "Install -R". (This is not required; it's just faster than
49 # starting from scratch.)
51 # One final comment: Unfortunately, tar and I disagree on what
52 # constitutes a fatal error. (tar -x will exit 0 even if it can't write
53 # anything in the current directory.) Thus, I am reduced to grepping stderr
54 # for (what I consider) fatal and nonfatal error messages. If you run into
55 # a situation where this doesn't behave the way you think it should (either
56 # an "Install failed" message after a successful install, or an "Install
57 # complete" message after it bombs), please let me know.
60 # The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
61 # under certain circumstances, which can really screw things up; unset it.
68 TRAILER
="Install.$LOGNAME"
69 INSTALL_STATE
=${INSTALL_STATE-$HOME/.Install.state}
71 INSTALL_DIR
=${INSTALL_DIR-/tmp/$TRAILER}
72 if [ "`basename $INSTALL_DIR`" != "$TRAILER" ]; then
73 INSTALL_DIR
="$INSTALL_DIR/$TRAILER"
76 INSTALL_LIB
=${INSTALL_LIB-$HOME/LibInstall}
78 INSTALL_RC
=${INSTALL_RC-$HOME/.Installrc}
80 INSTALL_CP
=${INSTALL_CP-"cp -p"}
82 INSTALL_RCP
=${INSTALL_RCP-"rcp -p"}
87 DEFAULT_OPTIONS
="-naq"
94 modlist
=/tmp
/modlist$$
95 # dummy directory for make state files.
96 modstatedir
=/tmp
/modstate$$
98 trap 'fail "User Interrupt" "You can resume by typing \"$INSTALL -R\""' 1 2 3 15
104 Usage: Install [ -w workspace ]
105 [ -s srcdir (default: usr/src/uts) ]
106 [ -k karch (e.g. sun4u; required if not deducible from pwd) ]
107 [ -t target (extract tar file on target, e.g. user@machine:/) ]
108 [ -T target (copy tar file to target, e.g. user@machine:/tmp) ]
109 [ -n (no target, just create tar file in /tmp (default)) ]
110 [ -u (install unix only) ]
111 [ -m (install modules only) ]
112 [ -a (install everything, i.e. unix + modules (default)) ]
113 [ -v (verbose output) ]
114 [ -V (REALLY verbose output) ]
115 [ -q (quiet (default)) ]
116 [ -c (clean up (remove temp files) when done (default) ]
117 [ -p (preserve temp files -- useful for debugging) ]
118 [ -L (library create: put tarfile in $INSTALL_LIB/env.karch) ]
119 [ -l lib (library extract: use $INSTALL_LIB/lib as source) ]
120 [ -D libdir (default: $HOME/LibInstall) ]
121 [ -d tempdir (Install work area (default: /tmp)) ]
122 [ -G glomname (put all files under platform/karch/glomname) ]
123 [ -i impl (e.g. sunfire; recommended with -G) ]
124 [ -x (update /etc/name_to_major et al) ]
125 [ -X (do not update /etc/name_to_major et al (default)) ]
126 [ -P (update /etc/path_to_inst -- generally not advisable) ]
127 [ -h (help -- prints this message) ]
128 [ -R (recover a previous Install) ]
129 [ -o objdir (object directory - either obj or debug (the default)) ]
130 [ -K (do not copy kmdb) ]
131 [ -3 32-bit modules only ]
132 [ -6 64-bit modules only ]
133 [ list of modules to install ]
137 man -M /ws/on297-gate/public/docs Install
143 # Save the current state of Install
146 function save_state
{
148 (echo "# State of previous Install
154 INSTALL_DIR=$INSTALL_DIR
155 INSTALL_LIB=$INSTALL_LIB
165 STATE=$STATE" >$INSTALL_STATE) || verbose
"Warning: cannot save state"
169 # Restore the previous state of Install
172 function restore_state
{
173 test -s $INSTALL_STATE || fail
"Can't find $INSTALL_STATE"
174 eval "`cat $INSTALL_STATE`"
178 # Install failed -- print error messages and exit 2
184 # We might have gotten here via a trap. So wait for any
185 # children (especially "make modlist") to exit before giving
186 # the error message or cleaning up.
196 echo "Install failed"
201 # Echo a string in verbose mode only
205 test "$VERBOSE" != "q" && echo $1
209 # hack for tmpfs bug -- remove files gradually
212 function remove_dir
{
217 rm -f `find . -type f -print`
223 # Create a directory if it doesn't already exist.
224 # mkdir will provide an error message, so don't provide an additional
229 [ -d $1 ] || mkdir
-p $1 || fail
233 # Patch up target directories for glommed kernel.
234 # usage: fixglom listfile glomname
241 $1 == "MOD" || $1 == "SYMLINK" {
242 sub(/^platform.*kernel/, "platform/" karch "/" glomname, $4)
243 sub(/^kernel/, "platform/" karch "/" glomname, $4)
244 sub(/^usr.kernel/, "platform/" karch "/" glomname, $4)
248 sub(/^platform.*kernel/, "platform/" karch "/" glomname, $3)
249 sub(/^kernel/, "platform/" karch "/" glomname, $3)
250 sub(/^usr.kernel/, "platform/" karch "/" glomname, $3)
251 sub(/^platform.*kernel/, "platform/" karch "/" glomname, $5)
252 sub(/^kernel/, "platform/" karch "/" glomname, $5)
253 sub(/^usr.kernel/, "platform/" karch "/" glomname, $5)
257 sub(/^platform.*kernel/, "platform/" karch "/" glomname, $3)
258 sub(/^kernel/, "platform/" karch "/" glomname, $3)
259 sub(/^usr.kernel/, "platform/" karch "/" glomname, $3)
267 # Filter out implementation-specific modules, unless that
268 # implementation was requested by the user.
269 # usage: filtimpl listfile implname
275 $1 == "MOD" || $1 == "SYMLINK" {
276 if ($6 == "all" || $6 == impl)
280 if ($5 == "all" || $5 == impl)
284 if ($7 == "all" || $7 == impl)
292 # Filter the module list to match the user's request.
293 # Usage: filtmod listfile modules
296 nawk
-v reqstring
="$2" '
297 function modmatch(modname) {
298 if (reqstring == "All") {
300 } else if (reqstring == "Modules") {
301 if (modname != "unix" && modname != "genunix")
304 if (modname in reqmods)
311 # The split call creates indexes 1, 2, 3, ... We want
312 # the module names as indexes.
314 split(reqstring, tmpmods)
316 reqmods[tmpmods[i]] = 1
339 # Unpack the crypto tarball into the given tree, then massage the
340 # tree so that the binaries are all in objNN or debugNN directories.
342 function unpack_crypto
{
345 [ -d "$ctop" ] || fail
"Can't create tree for crypto modules."
347 [ "$VERBOSE" = "V" ] && echo "unpacking crypto tarball into $ctop..."
348 bzcat
"$tarfile" |
(cd "$ctop"; tar xf
-)
350 typeset root
="$ctop/proto/root_$MACH"
351 [ $OBJD = obj
] && root
="$ctop/proto/root_$MACH-nd"
352 [ -d "$root" ] || fail
"Can't unpack crypto tarball."
354 (cd "$root"; for d
in platform kernel usr
/kernel
; do
355 [ ! -d $d ] && continue
356 find $d -type f
-print
357 done) |
while read file; do
358 typeset dir
=$
(dirname "$file")
359 typeset base
=$
(basename "$file")
360 typeset
type=$
(basename "$dir")
361 if [ "$type" = amd64
]; then
362 newdir
="$dir/${OBJD}64"
363 elif [ "$type" = sparcv9
]; then
364 newdir
="$dir/${OBJD}64"
366 newdir
="$dir/${OBJD}32"
368 mkdir
-p "$root/$newdir"
369 [ "$VERBOSE" = "V" ] && echo "mv $file $newdir"
370 mv "$root/$file" "$root/$newdir"
375 # Copy a module, or create a link, as needed.
380 targdir
=$INSTALL_FILES/$4
383 verbose
"$INSTALL_CP $2/${OBJD}$5/$3 $target"
384 $INSTALL_CP $2/${OBJD}$5/$3 $target || \
385 fail
"can't create $target"
388 targdir
=$INSTALL_FILES/$4
392 verbose
"ln -s $3 $target"
393 ln -s $3 $target || fail
"can't create $target"
396 targdir
=$INSTALL_FILES/$5
400 verbose
"ln $INSTALL_FILES/$3/$4 $target"
401 ln $INSTALL_FILES/$3/$4 $target || fail
"can't create $target"
404 target
=$INSTALL_FILES/$3
405 tstmkdir
`dirname $target`
406 conffile
=`basename $3`
407 verbose
"$INSTALL_CP $4/$conffile $target"
408 $INSTALL_CP $4/$conffile $target
411 fail
"unrecognized modlist entry: $*"
416 # Sanity-check the given module list.
417 function check_modlist
{
423 nfields["SYMLINK"] = 7
426 # This also catches unknown tags.
427 if (nfields[$1] != NF) {
428 print "error: invalid modlist record:"
430 print "expected", nfields[$1], "fields, found", NF
437 ' $1 || fail
"Errors in kernel module list"
441 # Copy kernel modules to $INSTALL_DIR
444 function copy_kernel
{
447 sun4
*) ISA
=sparc
; MACH
=sparc
;;
448 i86
*) ISA
=intel
; MACH
=i386
;;
449 *) fail
"${KARCH}: invalid kernel architecture";;
453 if [ "$GLOM" = "no" ]; then
454 verbose
"Source = $UTS, ISA = $ISA, kernel = $KARCH"
456 verbose
"Source = $UTS, ISA = $ISA, kernel = $KARCH, impl = $IMPL"
459 test -d $KARCH || fail
"${KARCH}: invalid kernel architecture"
460 test -d $ISA || fail
"${ISA}: invalid instruction set architecture"
462 tstmkdir
$INSTALL_FILES
464 tstmkdir
$modstatedir
465 export MODSTATE
=$modstatedir/state
468 # Figure out which "make" to use. dmake is faster than serial
469 # make, but dmake 7.3 has a bug that causes it to lose log
470 # output, which means the modlist might be incomplete.
473 dmvers
=`$make -version`
474 if [ $?
-ne 0 ]; then
475 make=/usr
/ccs
/bin
/make
476 elif [[ $dmvers = *Distributed?Make?
7.3* ]]; then
478 searchpath
="/ws/onnv-tools/SUNWspro/SOS10/bin
479 /opt/SUNWspro/SOS10/bin
481 for dmpath
in $searchpath; do
482 verbose
"Trying $dmpath/dmake"
483 if [ -x $dmpath/dmake
]; then
484 dmvers
=`$dmpath/dmake -version`
485 if [[ $dmvers != *Distributed?Make?
7.3* ]]; then
491 if [ -z $make ]; then
492 make=/usr
/ccs
/bin
/make
493 echo "Warning: dmake 7.3 doesn't work with Install;" \
499 # Get a list of all modules, configuration files, and links
500 # that we might want to install.
502 verbose
"Building module list..."
503 (cd $KARCH; MAKEFLAGS
=e
$make -K $MODSTATE modlist.karch
) | \
504 egrep "^MOD|^CONF|^LINK|^SYMLINK" > $modlist
505 [ "$VERBOSE" = "V" ] && cat $modlist
506 check_modlist
$modlist
507 if [ "$GLOM" = "yes" ]; then
508 fixglom
$modlist $GLOMNAME
509 filtimpl
$modlist $IMPL
511 if [[ -n "$files" && "$files" != All
]]; then
512 filtmod
$modlist "$files"
516 # Copy modules and create links. For architectures with both
517 # 32- and 64-bit modules, we'll likely have duplicate
518 # configuration files, so do those after filtering out the
521 verbose
"Copying files to ${INSTALL_FILES}..."
524 # The IFS is reset to the newline character so we can buffer the
525 # output of grep without piping it directly to copymod, otherwise
526 # if fail() is called, then it will deadlock in fail()'s wait call
531 set -- `grep -v "^CONF" $modlist`;
533 for onemod
in "$@"; do
540 set -- `grep "^CONF" $modlist | sort | uniq`;
542 for onemod
in "$@"; do
547 # Add the glommed kernel name to the root archive
549 if [[ $GLOM == "yes" ]];
551 filelist
="$INSTALL_FILES/etc/boot/solaris/filelist.ramdisk"
552 mkdir
-p `dirname $filelist`
553 echo "platform/$KARCH/$GLOMNAME" >$filelist
556 STATE
=1 # all kernel modules copied correctly
564 if [[ ! -d $dest ]] ; then
565 [[ "$VERBOSE" != "q" ]] && echo "mkdir -p $destdir"
567 mkdir
-p $destdir || fail
"failed to create $destdir"
570 [[ "$VERBOSE" != "q" ]] && echo "cp $src $destdir"
572 cp $src $destdir || fail
"failed to copy $src to $destdir"
575 function kmdb_copy_machkmods
{
581 [[ ! -d $modbase ]] && return
583 for dir
in $
(find $modbase -name kmod
) ; do
584 set -- $
(echo $dir |
tr '/' ' ')
586 [[ $# -lt 2 ]] && fail
"invalid mach kmod dir $dir"
591 [[ ! -f $dir/$kmod ]] && continue
593 kmdb_copy
$dir/$kmod $destdir
597 function kmdb_copy_karchkmods
{
605 [[ ! -d $modbase ]] && return
607 for dir
in $
(find $modbase -name kmod
) ; do
608 set -- $
(echo $dir |
tr '/' ' ')
610 [[ $# -lt 3 ]] && fail
"invalid karch kmod dir $dir"
616 [[ $bdir != $bitdir ]] && continue
617 [[ ! -f $dir/$1 ]] && continue
619 kmdb_copy
$dir/$kmod $destdir
623 function kmdb_copy_kmdbmod
{
624 typeset kmdbpath
="$1"
627 [[ ! -f $kmdbpath ]] && return 1
629 kmdb_copy
$kmdbpath $destdir
635 typeset kmdbtgtdir
=$INSTALL_FILES/platform
/$KARCH/$GLOMNAME/misc
645 if [[ $KMDB = "no" ||
! -d $SRC/cmd
/mdb
]] ; then
646 # The kmdb copy was suppressed or the workspace doesn't contain
647 # the mdb subtree. Either way, there's nothing to do.
653 if [[ $
(mach
) = "i386" ]] ; then
671 platdir
=$INSTALL_FILES/platform
/$KARCH/$GLOMNAME
672 if [[ $GLOM = "yes" ]] ; then
675 machdir
=$INSTALL_FILES/kernel
679 if [[ $WANT64 = "yes" ]] ; then
680 # kmdbmod for sparc and x86 are built and installed
681 # in different places
682 if [[ $
(mach
) = "i386" ]] ; then
683 kmdbpath
=$SRC/cmd
/mdb
/$isadir/$b64srcdir/kmdb
/kmdbmod
684 destdir
=$machdir/misc
/$b64tgtdir
686 kmdbpath
=$SRC/cmd
/mdb
/$KARCH/$b64srcdir/kmdb
/kmdbmod
687 destdir
=$platdir/misc
/$b64tgtdir
690 if kmdb_copy_kmdbmod
$kmdbpath $destdir ; then
693 for tree
in $srctrees; do
694 kmdb_copy_machkmods \
695 $tree/cmd
/mdb
/$isadir/$b64srcdir \
696 $machdir/kmdb
/$b64tgtdir
697 kmdb_copy_karchkmods
$tree/cmd
/mdb
/$KARCH \
698 $platdir/kmdb
/$b64tgtdir $b64srcdir
703 if [[ $WANT32 = "yes" ]] ; then
704 kmdbpath
=$SRC/cmd
/mdb
/$isadir/$b32srcdir/kmdb
/kmdbmod
705 destdir
=$machdir/misc
/$b32tgtdir
707 if kmdb_copy_kmdbmod
$kmdbpath $destdir ; then
710 for tree
in $srctrees; do
711 kmdb_copy_machkmods \
712 $tree/cmd
/mdb
/$isadir/$b32srcdir \
713 $machdir/kmdb
/$b32tgtdir
714 kmdb_copy_karchkmods
$tree/cmd
/mdb
/$KARCH \
715 $platdir/kmdb
/$b32tgtdir $b32srcdir
720 # A kmdb-less workspace isn't fatal, but it is potentially problematic,
721 # as the changes made to uts may have altered something upon which kmdb
722 # depends. We will therefore remind the user that they haven't built it
724 if [[ $foundkmdb != "yes" ]] ; then
725 echo "WARNING: kmdb isn't built, and won't be included"
737 function make_tarfile
{
738 echo "Creating tarfile $TARFILE"
739 test -d $INSTALL_FILES || fail
"Can't find $INSTALL_FILES"
743 # We don't want to change the permissions or ownership of pre-existing
744 # directories on the target machine, so we're going to take care to
745 # avoid including directories in the tarfile. On extraction, tar won't
746 # modify pre-existing directories, and will create non-existent ones as
747 # the user doing the extraction.
748 find .
! -type d
-print |fgrep
-vx './files' >files
749 tar cf
$TARFILE -I files || fail
"Couldn't create tarfile $TARFILE"
754 # Routines to copy files to the target machine
757 function remote_fail
{
759 "Make sure that $TARGET_MACHINE is up." \
760 "Check .rhosts in the home directory of user $TARGET_USER on $TARGET_MACHINE." \
761 "Check /etc/hosts.equiv, /etc/passwd, and /etc/shadow." \
762 "Change permissions on $TARGET_MACHINE as necessary." \
763 "Then, use \"$INSTALL -R\" to resume the install." ""
766 function remote_install
{
767 if [ "$IMODE" = "n" ]; then
771 test -s $TARFILE || fail
"$TARFILE missing or empty"
772 verbose
"Installing system on $TARGET"
773 test -d $INSTALL_DIR || fail
"Can't find $INSTALL_DIR"
775 rm -f errors fatal nonfatal
776 if [ "$IMODE" = "T" ]; then
777 EMESG
="Can't rcp to $TARGET"
779 sh
-e${SHV}c
"$INSTALL_RCP $TARFILE $TARGET/Install.tar"
781 EMESG
="Can't rsh to $TARGET_MACHINE"
782 rsh -l $TARGET_USER $TARGET_MACHINE \
783 "(cd $TARGET_DIR; /usr/bin/tar x${V}f -)" \
786 test $?
-ne 0 && remote_fail
"$EMESG"
788 egrep "set time|warning|blocksize" errors
>nonfatal
789 egrep -v "set time|warning|blocksize" errors
>fatal
790 if [ -s fatal
]; then
791 echo "Fatal errors from rsh:"
793 remote_fail
"Can't install on $TARGET_MACHINE"
795 if [ -s nonfatal
-a "$VERBOSE" != "q" ]; then
796 echo "Non-fatal errors from rsh:"
799 rm -f fatal nonfatal errors
800 test "$IMODE" = "T" && echo "Files can be extracted on \
801 $TARGET_MACHINE using 'tar xvf $TARGET_DIR/Install.tar'"
807 test "$CLEANUP" = c
&& remove_dir
$INSTALL_DIR
811 [ -n "$cryptotree" ] && rm -rf "$cryptotree"
812 verbose
"Install complete"
827 test -s $INSTALL_RC && RCOPTS
=`cat $INSTALL_RC`
828 set $INSTALL $DEFAULT_OPTIONS $RCOPTS $
*
831 while getopts acd
:D
:G
:hi
:k
:Kl
:Lmno
:pPqRs
:t
:T
:uvVw
:xX36 opt
834 w
) ENV_PATH
="$OPTARG"; SRC
="$ENV_PATH/usr/src";;
837 t|T
) TARGET
="$OPTARG"; IMODE
=$opt; CLEANUP
="c";;
838 n
) TARGET
=""; IMODE
="n"; CLEANUP
="p";;
839 u
) files
="unix genunix";;
842 v|V|q
) VERBOSE
=$opt;;
844 L
) LIBCREATE
="yes"; CLEANUP
="c";;
845 l
) LIBSRC
="$OPTARG";;
846 D
) INSTALL_LIB
="$OPTARG";;
847 d
) INSTALL_DIR
="$OPTARG/$TRAILER";;
848 G
) GLOM
=yes; GLOMNAME
="$OPTARG";;
849 P|X|x
) echo "-$opt is obsolete; ignored";;
850 h
) usage
"${INSTALL}: installs unix and modules";;
851 R
) x
=$OPTIND; restore_state
; OPTIND
=$x;;
857 \?) usage
"Illegal option";;
860 shift `expr $OPTIND - 1`
862 ENV_NAME
=`basename $ENV_PATH`
865 # The rest of the command line is a list of individual files to copy.
866 # If non-null, this list overrides the -uma options.
869 if [[ $# -gt 0 ]] ; then
876 V
) V
="v"; SHV
="x"; set -x;;
881 # Create temp directory for Install's files
884 tstmkdir
$INSTALL_DIR
886 TARFILE
=$INSTALL_DIR/Install.
${KARCH}.
tar
887 INSTALL_FILES
=$INSTALL_DIR/$KARCH
890 # Extract the target machine and target directory from a target of the
891 # form [user@]machine:/dir .
894 if [ "$IMODE" != "n" ]; then
895 eval `echo $TARGET | nawk -F':' '{
896 if (NF != 2 || !length($1) || !length($2))
897 print "usage \"Invalid target\""
900 k = split($1, f, "@");
901 if (k != 2 || !length(f[1]) || !length (f[2]))
902 print "usage \"Invalid target\""
905 print "TARGET_USER=" u ";"
906 print "TARGET_MACHINE=" m ";"
907 print "TARGET_DIR=" d ";"
909 if [ -z "$TARGET_USER" ]; then
915 # Allow the use of library source or target for the install
918 if [ -n "$LIBSRC" ]; then
919 LIBSRC
="`basename $LIBSRC .tar`.tar"
920 TARFILE
=$INSTALL_LIB/$LIBSRC
921 test -s $TARFILE || fail
"Can't find tarfile $TARFILE"
922 verbose
"Installing from library tarfile $TARFILE"
924 elif [ "$LIBCREATE" = "yes" ]; then
925 tstmkdir
$INSTALL_LIB
926 TARFILE
="$INSTALL_LIB/${ENV_NAME}.${KARCH}.tar"
930 # The next few lines allow recovery and activation with -R,
931 # and library installs with -l.
934 [[ $STATE -eq 1 ]] && copy_kmdb
935 [[ $STATE -eq 2 ]] && make_tarfile
936 [[ $STATE -eq 3 ]] && remote_install
937 [[ $STATE -eq 4 ]] && okexit
945 # Try to be smart: if DOTDOT ends in uts, then infer UTS and KARCH from DOT
946 # Otherwise, if SRC is set, infer UTS = $SRC/uts.
949 if [ "`basename $DOTDOT`" = "uts" ]; then
951 KARCH
=`basename $DOT`
952 if [ ! -n "$SRC" ]; then
953 SRC
=`dirname $DOTDOT`
954 verbose
"Setting SRC to $SRC"
959 if [ -z "$UTS" -a -n "$SRC" ]; then
961 test -n "$KARCH" || fail
"no karch specified (e.g. -k sun4u)"
964 if [ "$LIBCREATE" = "yes" ]; then
965 TARFILE
=$INSTALL_LIB/${ENV_NAME}.
${KARCH}.
tar
967 TARFILE
=$INSTALL_DIR/Install.
${KARCH}.
tar
969 INSTALL_FILES
=$INSTALL_DIR/$KARCH
973 test -z "$UTS" && fail
'Cannot find kernel sources -- $SRC not set'
974 test -d "$UTS" || fail
"${UTS}: no such directory"
977 # Convert UTS into an absolute path.
983 test "`basename $UTS`" = "uts" || \
984 verbose
"Warning: source path $UTS doesn't end in 'uts'"
986 remove_dir
$INSTALL_DIR/$KARCH
989 copy_kernel
# sets STATE=1 if successful
990 copy_kmdb
# sets STATE=2 if successful
991 make_tarfile
# sets STATE=3 if successful
992 remote_install
# sets STATE=4 if successful