--- /dev/null
+#!/bin/sh
+
+# This script can be used to install packages from the
+# the installation CD-ROM.
+
+RC=/usr/etc/rc.package
+CDMP=/mnt
+CDPACK=${CDMP}/install/packages
+PACKSUM=pkg_summary.bz2
+cdpackages=""
+cdmounted=""
+
+if [ -f "$RC" ]
+then . "$RC"
+fi
+
+# Is there a usable CD to install packages from?
+if [ -n "$cddrive" ]
+then pack=${cddrive}p2
+ umount $pack >/dev/null 2>&1 || true
+ echo "Checking for CD in $pack."
+ if mount -r $pack $CDMP 2>/dev/null
+ then fn="$CDPACK/$PACKSUM"
+ echo "Found."
+ cdmounted=1
+ cdpackages=$fn
+ if [ ! -f $cdpackages ]
+ then cdpackages=""
+ echo "No package summary found on CD in $fn."
+ exit 1
+ fi
+ else echo "Not found."
+ exit 1
+ fi
+else echo "Don't know where the install CD is. You can set it in $RC."
+ exit 1
+fi
+
+# Set package repo to CD and populate package db
+export PKG_REPOS=${CDPACK}
+pkgin update
+
+# Run pkgin
+pkgin $@
-To install the X Window System, run 'packman' with the install CD still
-in the drive. To start X Windows after you have installed it, login as
-root and type: 'xdm'. For more information about configuring X Windows,
-see www.minix3.org.
+To install additional packages, run 'pkgin'. First do a 'pkgin update'
+to update the list of available packages, and then do a 'pkgin' to get
+a list of commands. For example, 'pkgin install vim' installs the
+'vim' package, and 'pkgin available' will list all available packages.
-If you do not have sufficient memory to run X, standard MINIX 3 supports
-multiple virtual terminals. Just use ALT+F1, F2, F3 and F4 to navigate
-among them.
+MINIX 3 supports multiple virtual terminals. Just use ALT+F1, F2, F3
+and F4 to navigate among them.
-To get rid of this message, edit /etc/motd.
+For more information on how to use MINIX 3, see the wiki:
+http://wiki.minix3.org.
-To install X Windows, run 'packman' with the install CD still in the
-drive. To start X Windows after you have installed it, login as root
-and type: 'xdm'. For more information about configuring X Windows, see
-www.minix3.org.
+To install additional packages, run 'pkgin'. First do a 'pkgin update'
+to update the list of available packages, and then do a 'pkgin' to get
+a list of commands. For example, 'pkgin install vim' installs the
+'vim' package, and 'pkgin available' will list all available packages.
-If you do not have sufficient memory to run X Windows, standard MINIX 3
-supports multiple virtual terminals. Just use ALT+F1, F2, F3 and F4 to
-navigate among them.
+MINIX 3 supports multiple virtual terminals. Just use ALT+F1, F2, F3
+and F4 to navigate among them.
-To get rid of this message, edit /etc/motd.
+For more information on how to use MINIX 3, see the wiki:
+http://wiki.minix3.org.
XBIN=usr/xbin
SRC=src
-# size of /tmp during build
-PACKAGEDIR=/usr/bigports/Packages
-PACKAGESOURCEDIR=/usr/bigports/Sources
+PACKAGEDIR=/usr/pkgsrc/packages
# List of packages included on installation media
PACKAGELIST=packages.install
-# List of package source included on installation media
-PACKAGESOURCELIST=package_sources.install
secs=`expr 32 '*' 64`
export SHELL=/bin/sh
{
dir=$1
list=`pwd`/$2
- url=http://www.minix3.org/$3
-BIGPORTS=bigports
+ url=${PACKAGEURL}
(
cd $dir || exit 1
echo " * Updating $dir
from $url
with $list"
- files=`awk <$list '{ print "'$url'/" $1 ".tar.bz2" }'`
- wget -c $url/List $files || true
+ files=`awk <$list '{ print "'$url'/" $1 ".tgz" }'`
+ fetch -r $files || true
)
}
RELEASEDIR=/usr/r-staging
RELEASEMNTDIR=/usr/r
RELEASEPACKAGE=${RELEASEDIR}/usr/install/packages
-RELEASEPACKAGESOURCES=${RELEASEDIR}/usr/install/package-sources
IMAGE=../boot/cdbootblock
ROOTIMAGE=rootimage
fi
if [ $PACKAGES -ne 0 ]
-then mkdir -p $PACKAGEDIR || true
- mkdir -p $PACKAGESOURCEDIR || true
- rm -f $PACKAGEDIR/List
- retrieve $PACKAGEDIR $PACKAGELIST packages/`uname -p`/`uname -r`
- retrieve $PACKAGESOURCEDIR $PACKAGESOURCELIST software
+then mkdir -p $PACKAGEDIR/All || true
+ retrieve $PACKAGEDIR/All $PACKAGELIST packages/`uname -p`/`uname -r`
fi
if [ "$COPY" -ne 1 ]
mkdir -p $RELEASEDIR/usr/bin
mkdir -p $RELEASEDIR/bin
mkdir -p $RELEASEPACKAGE
-mkdir -p $RELEASEPACKAGESOURCES
echo " * Transfering bootstrap dirs to $RELEASEDIR"
cp -p /bin/* /usr/bin/* /sbin/* $RELEASEDIR/$XBIN
cp -rp /bin/sh /bin/echo $RELEASEDIR/bin
cp -rp /usr/bin/make /usr/bin/install /usr/bin/yacc /usr/bin/lex /usr/bin/asmconv $RELEASEDIR/usr/bin
-if [ -d $PACKAGEDIR -a -d $PACKAGESOURCEDIR -a -f $PACKAGELIST -a -f $PACKAGESOURCELIST -a $PACKAGES -ne 0 ]
-then echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
- : >$RELEASEPACKAGE/List
+if [ -d $PACKAGEDIR -a -f $PACKAGELIST -a $PACKAGES -ne 0 ]
+then
+ index=pkg_summary
+ indexpath=$PACKAGEDIR/.index
+
+ if [ ! -d $indexpath ]
+ then mkdir $indexpath
+ fi
+ if [ ! -d $indexpath ]
+ then echo "Couldn't create $indexpath."
+ exit 1
+ fi
+
+ echo "" >$PACKAGEDIR/All/$index
+
+ echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
for p in `cat $PACKAGELIST`
- do if [ -f $PACKAGEDIR/$p.tar.bz2 ]
- then
- cp $PACKAGEDIR/$p.tar.bz2 $RELEASEPACKAGE/
- grep "^$p|" $PACKAGEDIR/List >>$RELEASEPACKAGE/List || echo "$p not found in List"
- else
- echo "Can't copy $PACKAGEDIR/$p.tar.bz2. Missing."
- fi
- done
-
- echo " * Transfering $PACKAGESOURCEDIR to $RELEASEPACKAGESOURCES"
- for p in `cat $PACKAGESOURCELIST`
- do
- if [ -f $PACKAGESOURCEDIR/$p.tar.bz2 ]
+ do if [ -f $PACKAGEDIR/All/$p.tgz ]
then
- cp $PACKAGESOURCEDIR/$p.tar.bz2 $RELEASEPACKAGESOURCES/
+ # Copy package and create package's index
+ (
+ cd $PACKAGEDIR/All
+ cp $p.tgz $RELEASEPACKAGE/
+
+ f=$p.tgz
+ indexname=$indexpath/$f.$index
+ pkg_info -X $f >$indexname
+
+ if [ ! -f $indexname ]
+ then echo Missing $indexname.
+ exit 1
+ fi
+
+ if [ "`wc -l $indexname`" -lt 3 ]
+ then $indexname is too short.
+ rm $indexname
+ exit 1
+ fi
+
+ cat $indexname >>$PACKAGEDIR/All/$index
+ )
else
- echo "Can't copy $PACKAGESOURCEDIR/$p.tar.bz2. Missing."
+ echo "Can't copy $PACKAGEDIR/$p.tgz. Missing."
fi
done
+
+ bzip2 -f $PACKAGEDIR/All/$index
+ cp $PACKAGEDIR/All/$index.bz2 $RELEASEPACKAGE/
fi
# Make sure compilers and libraries are root-owned
echo " * Make hierarchy"
chroot $RELEASEDIR "PATH=/$XBIN sh -x /usr/$SRC/tools/chrootmake.sh etcfiles" || exit 1
-if [ "$COPY" -ne 1 ]
-then for p in $PREINSTALLED_PACKAGES
- do echo " * Pre-installing: $p from $url"
- pkg_add -P $RELEASEDIR $PACKAGEURL/$p
- done
-fi
+for p in $PREINSTALLED_PACKAGES
+do echo " * Pre-installing: $p from $url"
+ pkg_add -P $RELEASEDIR $PACKAGEURL/$p
+done
echo " * Chroot build"
chroot $RELEASEDIR "PATH=/$XBIN MAKEMAP=$MAKEMAP sh -x /usr/$SRC/tools/chrootmake.sh" || exit 1