3 # Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 # based on distrib/install-rh8.0 by Jacques Gelinas
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # This script creates a vserver from RedHat 8.0 CD. Only
21 # the first CD is used and must be mounted in /mnt/cdrom.
22 # Specify the name of the vserver
23 # "install-rh8.0 test" will create /vservers/test
25 : ${UTIL_VSERVER_VARS:=$(dirname $0)/util-vserver-vars}
26 test -e "$UTIL_VSERVER_VARS" || {
27 echo "Can not find util-vserver installation; aborting..."
30 . "$UTIL_VSERVER_VARS"
32 USR_LIB_VSERVER=$PKGLIBDIR
34 if [ $# -lt 1 ] ; then
35 echo install-rh8.0 vserver-id [ type ]
36 echo type minimum means, minimum package for a server
37 echo type large means, all packages on the first CD
38 elif [ -d $VROOTDIR/$1/var/lib/rpm ] ; then
39 echo $VROOTDIR/$1 already exist
40 elif [ ! -d /mnt/cdrom/RedHat/RPMS ] ; then
41 echo No rpms in /mnt/cdrom/RedHat/RPMS. Is the CD mounted \?
44 $USR_LIB_VSERVER/install-pre.sh $1
46 mount -t proc none $VROOT/proc
47 mount -t devpts none $VROOT/dev/pts
48 mkdir -p $VROOT/var/lib/rpm
49 rpm --root $VROOT --initdb
50 if [ "$2" = "minimum" ] ; then
51 echo `cat $USR_LIB_VSERVER/rh8.0-minimum | wc -l` packages to install
52 cd /mnt/cdrom/RedHat/RPMS
53 rpm --root $VROOT -Uvh `cat $USR_LIB_VSERVER/rh8.0-minimum`
55 PKGS=`ls /mnt/cdrom/RedHat/RPMS/*.noarch.rpm \
56 /mnt/cdrom/RedHat/RPMS/*.i386.rpm`
57 for except in control-center iptables kernel-pcmcia-cs\
58 nfs-utils pciutils quota rp-pppoe tcpdump \
59 lokkit kudzu-devel pciutils-devel
61 PKGS=`ls $PKGS | grep -v $except`
63 echo `echo $PKGS | wc -w` packages to install
64 rpm --root $VROOT -Uvh $PKGS
68 $USR_LIB_VSERVER/install-post.sh $1