*BSD News Article 61890


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!aggedor.rmit.edu.au!phillip
From: phillip@mirriwinni.cse.rmit.edu.au (Phillip Musumeci)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: New Installation of FreeBSD 2.1R
Date: 13 Feb 1996 11:41:44 GMT
Organization: Computer Systems Engineering Department, RMIT Australia
Lines: 173
Message-ID: <PHILLIP.96Feb13224144@mirriwinni.cse.rmit.edu.au>
References: <4flmqt$nlo@preeda.internex.net.au> <311EE2A9.167EB0E7@FreeBSD.org>
Reply-To: phillip@rmit.edu.au
NNTP-Posting-Host: pm.cse.rmit.edu.au
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
In-reply-to: "Jordan K. Hubbard"'s message of Sun, 11 Feb 1996 22:48:09 -0800

>>>>> "Jordan" == Jordan K Hubbard <jkh@FreeBSD.org> writes:

    Jordan> John Gibney wrote:
    >> The directory I'm trying to install from looks like:
    >> 
    >> Volume in drive C is MS-DOS_620 Serial number is 2A09:1ACE Directory
    >> of c:\freebsd\packages\*.*
    >> 
    >> ALL <DIR> 2-09-96 7:13p APPLICAT <DIR> 2-10-96 1:01p

    Jordan> You copied all the stuff into your DOS partition to install
    Jordan> from, or..?

    Jordan> The dists will allow this, since they're all carefully 8.3
    Jordan> named, but not the packages.  The packages I recommend that you
    Jordan> install individually, NOT with the package installer, with the
    Jordan> pkg_add command.  Just copy the *.tgz files you want (being
    Jordan> careful to fudge the names when necessary) and run pkg_add on
    Jordan> each one.

Here is a script that I wrote to help installs via a DOS file system --- it
might help.  You might want to delete/ignore the fiddling with /compat and
/usr/X11* at the beginning.

phillip

---------------------------------------------------------------------------

#! /bin/sh
#
# We assume that the FreeBSD packages were copied into directory
# \packages\all on the DOS file system, and that this file system is
# mounted as /dos (i.e. the packages appear in /dos/packages/all but their
# names are in shortened 8+3 form.
#
# This script figures out the real name of a package so it can be copied
# across to /root and have pkg_add run on it.
#
# phillip@rmit.edu.au  12-feb-1996

DEST=/root

# if possible, locate a few directories within /home and setup softlinks
if [ -d /home ] ; then

  # create a temporary area for now (and later)
  if [ ! -d /home/tmp ] ; then
    mkdir /home/tmp
  fi
  export PKG_TMPDIR=/home/tmp		# pkg_add needs lots of space sometimes
  DEST=$PKG_TMPDIR

  if [ ! -h /usr/local ] ; then
    # remove any /usr/local and link it to /home/local
    if [ -d /usr/local ] ; then
      echo "Moving /usr/local into /home/local"
      x=`pwd`
      cd /usr ; tar cf - local | (cd /home ; tar xvpf -)
      /bin/rm -rf /usr/local
      cd $x
    else
      echo "Making /home/local"
      mkdir /home/local
    fi
    ln -s /home/local /usr/local
  else
    echo /usr/local is already a softlink
  fi

  if [ ! -h /usr/X11R6 ] ; then
    # setup /usr/X11R6 in /usr/local/X11R6
    if [ -d /usr/local/X11R6 ] ; then
      echo "Moving /usr/X11R6 into /home/local"
      x=`pwd`
      cd /usr ; tar cf - X11R6 | (cd /home ; tar xvpf -)
      /bin/rm -rf /usr/X11R6
      cd $x
    else
      echo "Making /home/local/X11R6"
      mkdir /home/local/X11R6
    fi
    ln -s /home/local/X11R6 /usr/X11R6
    /bin/rm -f /usr/X11
    ln -s /home/local/X11R6 /usr/X11
  else
    echo /usr/X11R6 is already a softlink
  fi

  if [ ! -h /compat ] ; then
    # setup /compat in /usr/local/compat
    if [ -d /compat ] ; then
      echo "Moving /compat into /home/local"
      x=`pwd`
      cd / ; tar cf - compat | (cd /home/local ; tar xvpf -)
      /bin/rm -rf /compat
      cd $x
    else
      echo "Making /home/local/compat"
      mkdir /home/local/compat
    fi
    ln -s /home/local/compat /compat
  else
    echo /compat is already a softlink
  fi

fi

###########################################################################

SRC=
echo
if [ x$SRC = x -a -d /dos/packages/all ] ; then
  SRC=/dos/packages/all
fi
if [ x$SRC = x -a -d /dosc/packages/all ] ; then
  SRC=/dosc/packages/all
fi
if [ x$SRC = x -a -d /dosd/packages/all ] ; then
  SRC=/dosd/packages/all
fi

if [ x$SRC != x ] ; then
  echo "Found packages in $SRC"
else
  echo "Please enter the directory where the packages are kept"
  read x
  if [ -d $x ] ; then
    SRC=$x
  else
    echo That does not seem to be a directory...
    exit
  fi
  echo "Using packages in $SRC"
fi

###########################################################################
cd $SRC
for x in * ; do
  if [ -n "`file $x | grep gzip`" ] ; then    # non-empty string --> GZIP data
    echo
    y=`tar xzOf $x +CONTENTS | grep @name | cut -d' ' -f2`.tgz	# get real name
    echo "File $x is really $y; install (n/y)? "
    read a
    case $a in

      y*|Y*)						# we install
        cp $x $DEST/$y					# copy to eal name
        echo "Executing: pkg_add $DEST/$y"
        pkg_add $DEST/$y				# and install
        /bin/rm $DEST/$y				# then delete tmp copy
        ;;

      q*|Q*) exit 0 ;;					# quit

      *) echo "Ignoring: $y" ;;

    esac
  fi
done

# end of script

-- 
[phillip@mirriwinni.cse.rmit.edu.au]
---------------------------------------------------------------------------
Dr Phillip Musumeci       __  /\  Postal Address:
Telephone:               /  \/  \     Dept. of Computer Systems Engineering 
 ++61 3 96605317(w1)    /        \    RMIT, GPO Box 2476V
 ++61 3 96605383(w2)   /         /    Melbourne 3001
 ++61 3 96605340(fax)  \   __   /     AUSTRALIA
RMIT Building 87.2.15,  `-'  \*/    WWW: http://pm.cse.rmit.edu.au/~phillip
410 Elizabeth Street.         .   EMAIL: phillip@rmit.edu.au
---------------------------------------------------------------------------