Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!newshost.telstra.net!asstdc.scgt.oz.au!metro!metro!news.nsw.CSIRO.AU!mel.dit.csiro.au!munnari.OZ.AU!ihnp4.ucsd.edu!agate!reason.cdrom.com!usenet From: "Jordan K. Hubbard" <jkh@FreeBSD.org> Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: Problem installing packages from DOS partition Date: Wed, 27 Mar 1996 18:22:15 -0800 Organization: Walnut Creek CDROM Lines: 163 Message-ID: <3159F7D7.41C67EA6@FreeBSD.org> References: <4jcam6$ecq@news.mind.net> NNTP-Posting-Host: time.cdrom.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------446B9B3D2781E494167EB0E7" X-Mailer: Mozilla 2.0 (X11; I; FreeBSD 2.2-CURRENT i386) To: Michelle Brownsworth <michellb@efn.org> This is a multi-part message in MIME format. --------------446B9B3D2781E494167EB0E7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Michelle Brownsworth wrote: > The sysinstall utility didn't seem to want to install packages from a > DOS partion (I read in the FreeBSD newsgroup there was a problem doing > so), so I moved on to the pkg_add command. First, I mounted the DOS > filesystem (which has all the dists from the CD, including packages The basic problem which prevents sysinstall from loading packages from the DOS partition is the same one that prevents it from loading them from there at all, namely the fact that DOS has smashed all the names. This is compounded by the fact that pkg_add tries to be cute and determine whether or not the input is compressed (this was before I settled on making *all* packages compressed and end with .tgz - pkg_add will also cheerfully settle for pkg.tar file that's not gzip'd though nobody ever feeds those to it, so the extra smarts are entirely wasted anyway). I have a couple of suggestions: First, if your machine is Internet connected you could simply try installing packages over the net: Try, for example: pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/packages/All/apache-0.8.14.tgz I know that doesn't use your nifty little CDROM, but it's a way. Another possibility is to use the attached script, which I must confess to not even having tested - someone submitted it to me as a way of dealing with this exact issue. -- - Jordan Hubbard President, FreeBSD Project --------------446B9B3D2781E494167EB0E7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pkg_to_cd9660" #! /bin/sh # # Script dpa # URL = ftp://pm.cse.rmit.edu.au/ftp/pub/FreeBSD/misc/dpa # # The current pkg_add command cannot process packages in files that have # incorrect names e.g. packages that are being read off a DOS file system # where a shortened name is required. Shell script dpa (Dos Package Add) # figures out the real name of a package so it can be temporarily copied # across to $DEST (with its original name) and have pkg_add run on it. # # The user is prompted to have all packages available in the source # directory installed. # # Parameter 1 is taken as the directory holding the 8+3 named packages, # otherwise we look for a directory named /dos/packages or /dosc/packages # or /dosd/packages, # otherwise we ask where the hell these packages are supposed to be. # # Note: if you had chosen to mount a dos partition as /dos during the # installation, and used the DOS batch file fbsdmove.bat to copy some # initial packages into area \PACKAGES on the DOS disk, then this # script will figure out where your packages are hiding. # # Use: dpa (assumes packages in /dos/packages etc.) # dpa SRCDIR # # phillip@rmit.edu.au 1v0 15-feb-1996 DEST=/root # if a /home is present, we store temporary package copies there # (we assume that a large file system is available at /home) if [ -d /home ] ; then if [ ! -d /home/tmp ] ; then mkdir /home/tmp fi export PKG_TMPDIR=/home/tmp # pkg_add needs lots of space sometimes DEST=$PKG_TMPDIR fi ########################################################################### # take parameter 1 as the source directory containing the packages if [ "x$1" != x ] ; then SRC=$1 # otherwise, attempt to guess where the DOS file system is that contains # the FreeBSD packages else 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 # otherwise we just ask where the FreeBSD packages are if [ "x$SRC" = x ] ; then 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 fi fi echo "Using packages in $SRC" ########################################################################### # Procedure: # # a) examine each file to see if it is a gzip compressed file # b) if it is, we assume it is a .tgz package file and extract the +CONTENTS # file in which a line commencing with the string "@name" is used to give # us the original package's name # c) the user is then prompted to see if this package should be copied and # installed. 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 --------------446B9B3D2781E494167EB0E7--