Print this page
4526 nightly contains a great deal of effectively dead code


 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"
 365                 else
 366                         newdir="$dir/${OBJD}32"
 367                 fi
 368                 mkdir -p "$root/$newdir"
 369                 [ "$VERBOSE" = "V" ] && echo "mv $file $newdir"
 370                 mv "$root/$file" "$root/$newdir"
 371         done
 372 }
 373 
 374 #
 375 # usage: fixcrypto listfile ctop
 376 # Massage entries in listfile for crypto modules, so that they point
 377 # into ctop.
 378 #
 379 function fixcrypto {
 380         typeset listfile=$1
 381         typeset ctop=$2
 382 
 383         typeset ccontents=/tmp/crypto-toc$$
 384         find "$ctop" -type f -print > $ccontents
 385         typeset root=root_$MACH
 386         [ "$OBJD" = obj ] && root=root_$MACH-nd
 387 
 388         grep -v ^MOD $listfile > $listfile.no-mod
 389         grep ^MOD $listfile | while read tag srcdir module targdir size impl; do
 390                 #
 391                 # We don't just grep for ${OBJD}$size/$module because
 392                 # there can be generic and platform-dependent versions
 393                 # of a module.
 394                 #
 395                 newsrcfile=$(grep -w $root/$targdir/${OBJD}$size/$module $ccontents)
 396                 if [ -n "$newsrcfile" ]; then
 397                         # srcdir doesn't include final objNN or debugNN
 398                         echo $tag $module $targdir $size $impl \
 399                             $(dirname $(dirname "$newsrcfile"))
 400                 else
 401                         echo $tag $module $targdir $size $impl $srcdir
 402                 fi
 403         done > $listfile.mod
 404         cat $listfile.mod $listfile.no-mod > $listfile
 405 
 406         rm -f $listfile.mod
 407         rm -f $listfile.no-mod
 408         rm -f $ccontents
 409 }
 410 
 411 #
 412 # Copy a module, or create a link, as needed.
 413 #
 414 
 415 function copymod {
 416         case $1 in
 417         MOD)
 418                 targdir=$INSTALL_FILES/$4
 419                 tstmkdir $targdir
 420                 target=$targdir/$3
 421                 verbose "$INSTALL_CP $2/${OBJD}$5/$3 $target"
 422                 $INSTALL_CP $2/${OBJD}$5/$3 $target || \
 423                     fail "can't create $target"
 424                 ;;
 425         SYMLINK)
 426                 targdir=$INSTALL_FILES/$4
 427                 tstmkdir $targdir
 428                 target=$targdir/$5
 429                 rm -f $target
 430                 verbose "ln -s $3 $target"
 431                 ln -s $3 $target || fail "can't create $target"
 432                 ;;
 433         LINK)
 434                 targdir=$INSTALL_FILES/$5


 525                                         break;
 526                                 fi
 527                         fi
 528                 done
 529                 if [ -z $make ]; then
 530                         make=/usr/ccs/bin/make
 531                         echo "Warning: dmake 7.3 doesn't work with Install;" \
 532                                 "using $make"
 533                 fi
 534         fi
 535 
 536         #
 537         # Get a list of all modules, configuration files, and links
 538         # that we might want to install.
 539         #
 540         verbose "Building module list..."
 541         (cd $KARCH; MAKEFLAGS=e $make -K $MODSTATE modlist.karch) | \
 542             egrep "^MOD|^CONF|^LINK|^SYMLINK" > $modlist
 543         [ "$VERBOSE" = "V" ] && cat $modlist
 544         check_modlist $modlist
 545         if [ -n "$ON_CRYPTO_BINS" ]; then
 546                 cryptotar="$ON_CRYPTO_BINS"
 547                 if [ "$OBJD" = obj ]; then
 548                         isa=$(uname -p)
 549                         cryptotar=$(echo "$ON_CRYPTO_BINS" |
 550                             sed -e s/.$isa.tar.bz2/-nd.$isa.tar.bz2/)
 551                 fi
 552                 [ -f "$cryptotar" ] || fail "crypto ($cryptotar) doesn't exist"
 553                 cryptotree=$(mktemp -d /tmp/crypto.XXXXXX)
 554                 [ -n "$cryptotree" ] || fail "can't create tree for crypto"
 555                 unpack_crypto "$cryptotar" "$cryptotree"
 556                 #
 557                 # fixcrypto must come before fixglom, because
 558                 # fixcrypto uses the unglommed path to find things in
 559                 # the unpacked crypto.
 560                 #
 561                 fixcrypto $modlist "$cryptotree"
 562         fi
 563         if [ "$GLOM" = "yes" ]; then
 564                 fixglom $modlist $GLOMNAME
 565                 filtimpl $modlist $IMPL
 566         fi
 567         if [[ -n "$files" && "$files" != All ]]; then
 568                 filtmod $modlist "$files"
 569         fi
 570 
 571         #
 572         # Copy modules and create links.  For architectures with both
 573         # 32- and 64-bit modules, we'll likely have duplicate
 574         # configuration files, so do those after filtering out the
 575         # duplicates.
 576         #
 577         verbose "Copying files to ${INSTALL_FILES}..."
 578 
 579         #
 580         # The IFS is reset to the newline character so we can buffer the
 581         # output of grep without piping it directly to copymod, otherwise
 582         # if fail() is called, then it will deadlock in fail()'s wait call


 715         else
 716                 isadir="sparc"
 717                 b64srcdir="v9"
 718                 b64tgtdir="sparcv9"
 719                 b32srcdir="v7"
 720                 b32tgtdir="."
 721         fi
 722 
 723         typeset foundkmdb=no
 724         typeset kmdbpath=
 725         typeset destdir=
 726 
 727         platdir=$INSTALL_FILES/platform/$KARCH/$GLOMNAME
 728         if [[ $GLOM = "yes" ]] ; then
 729                 machdir=$platdir
 730         else
 731                 machdir=$INSTALL_FILES/kernel
 732         fi
 733 
 734         srctrees=$SRC
 735         if [ -z "$ON_CRYPTO_BINS" ]; then
 736                 echo "Warning: ON_CRYPTO_BINS not set; pre-signed" \
 737                     "crypto not provided."
 738         fi
 739         if [[ $WANT64 = "yes" ]] ; then
 740                 # kmdbmod for sparc and x86 are built and installed
 741                 # in different places
 742                 if [[ $(mach) = "i386" ]] ; then
 743                         kmdbpath=$SRC/cmd/mdb/$isadir/$b64srcdir/kmdb/kmdbmod
 744                         destdir=$machdir/misc/$b64tgtdir
 745                 else
 746                         kmdbpath=$SRC/cmd/mdb/$KARCH/$b64srcdir/kmdb/kmdbmod
 747                         destdir=$platdir/misc/$b64tgtdir
 748                 fi
 749 
 750                 if kmdb_copy_kmdbmod $kmdbpath $destdir ; then
 751                         foundkmdb="yes"
 752 
 753                         for tree in $srctrees; do
 754                                 kmdb_copy_machkmods \
 755                                     $tree/cmd/mdb/$isadir/$b64srcdir \
 756                                     $machdir/kmdb/$b64tgtdir
 757                                 kmdb_copy_karchkmods $tree/cmd/mdb/$KARCH \
 758                                     $platdir/kmdb/$b64tgtdir $b64srcdir




 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"
 365                 else
 366                         newdir="$dir/${OBJD}32"
 367                 fi
 368                 mkdir -p "$root/$newdir"
 369                 [ "$VERBOSE" = "V" ] && echo "mv $file $newdir"
 370                 mv "$root/$file" "$root/$newdir"
 371         done
 372 }
 373 
 374 #





































 375 # Copy a module, or create a link, as needed.
 376 #

 377 function copymod {
 378         case $1 in
 379         MOD)
 380                 targdir=$INSTALL_FILES/$4
 381                 tstmkdir $targdir
 382                 target=$targdir/$3
 383                 verbose "$INSTALL_CP $2/${OBJD}$5/$3 $target"
 384                 $INSTALL_CP $2/${OBJD}$5/$3 $target || \
 385                     fail "can't create $target"
 386                 ;;
 387         SYMLINK)
 388                 targdir=$INSTALL_FILES/$4
 389                 tstmkdir $targdir
 390                 target=$targdir/$5
 391                 rm -f $target
 392                 verbose "ln -s $3 $target"
 393                 ln -s $3 $target || fail "can't create $target"
 394                 ;;
 395         LINK)
 396                 targdir=$INSTALL_FILES/$5


 487                                         break;
 488                                 fi
 489                         fi
 490                 done
 491                 if [ -z $make ]; then
 492                         make=/usr/ccs/bin/make
 493                         echo "Warning: dmake 7.3 doesn't work with Install;" \
 494                                 "using $make"
 495                 fi
 496         fi
 497 
 498         #
 499         # Get a list of all modules, configuration files, and links
 500         # that we might want to install.
 501         #
 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
 510         fi
 511         if [[ -n "$files" && "$files" != All ]]; then
 512                 filtmod $modlist "$files"
 513         fi
 514 
 515         #
 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
 519         # duplicates.
 520         #
 521         verbose "Copying files to ${INSTALL_FILES}..."
 522 
 523         #
 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


 659         else
 660                 isadir="sparc"
 661                 b64srcdir="v9"
 662                 b64tgtdir="sparcv9"
 663                 b32srcdir="v7"
 664                 b32tgtdir="."
 665         fi
 666 
 667         typeset foundkmdb=no
 668         typeset kmdbpath=
 669         typeset destdir=
 670 
 671         platdir=$INSTALL_FILES/platform/$KARCH/$GLOMNAME
 672         if [[ $GLOM = "yes" ]] ; then
 673                 machdir=$platdir
 674         else
 675                 machdir=$INSTALL_FILES/kernel
 676         fi
 677 
 678         srctrees=$SRC




 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
 685                 else
 686                         kmdbpath=$SRC/cmd/mdb/$KARCH/$b64srcdir/kmdb/kmdbmod
 687                         destdir=$platdir/misc/$b64tgtdir
 688                 fi
 689 
 690                 if kmdb_copy_kmdbmod $kmdbpath $destdir ; then
 691                         foundkmdb="yes"
 692 
 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