#!/bin/sh # This script creates a vserver from SuSE 9.0 DVD. Only # the first DVD is used and must be mounted in /mnt/dvd or /mnt/cdrom. # Specify the name of the vserver # "install-suse9.0 test minimal" will create /vservers/test USR_LIB_VSERVER=/usr/lib/vserver source $USR_LIB_VSERVER/install-function.sh checkargs install-suse9.0 $* readconf $1 checkexist CDROM=/mnt/dvd PKGDIR=suse/i586 if [ ! -d /mnt/dvd/$PKGDIR ] ; then CDROM=/mnt/cdrom fi checkrpms $CDROM/$PKGDIR $USR_LIB_VSERVER/install-pre.sh $1 $VROOT mkdir -p $VROOT/proc mount -t proc none $VROOT/proc mount -t devpts none $VROOT/dev/pts mkdir -p $VROOT/var/lib/rpm rpm --root $VROOT --initdb if [ "$2" = "minimum" ] ; then echo `cat $USR_LIB_VSERVER/suse9.0-minimum | wc -l` packages to install cd $CDROM/$PKGDIR rpm --root $VROOT -Uvh `cat $USR_LIB_VSERVER/suse9.0-minimum` else cd $CDROM/$PKGDIR PKGS=`ls *.i586.rpm` MINPKGS=`cat $USR_LIB_VSERVER/suse9.0-minimum` PKGS=`$USR_LIB_VSERVER/subarg $PKGS -- $MINPKGS` echo `echo $MINPKGS $PKGS | wc -w` packages to install rpm --root $VROOT -Uvh $MINPKGS rpm --root $VROOT -Uvh $PKGS --nodeps fi umount $VROOT/proc umount $VROOT/dev/pts $USR_LIB_VSERVER/install-post.sh $1