How I created a Fedora Core 2 vserver-reference image
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 30 Jul 2004 16:44:38 +0000 (16:44 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 30 Jul 2004 16:44:38 +0000 (16:44 +0000)
distrib/install-fc2 [new file with mode: 0644]

diff --git a/distrib/install-fc2 b/distrib/install-fc2
new file mode 100644 (file)
index 0000000..bf8f76b
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+# based on distrib/install-rh9.0 by Jacques Gelinas
+#  
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#  
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#  
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This script creates a vserver from RedHat 9.0 CD. Only
+# the first CD is used and must be mounted in /mnt/cdrom.
+# Specify the name of the vserver
+# "install-rh9.0 test" will create /vservers/test
+
+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
+test -e "$UTIL_VSERVER_VARS" || {
+    echo "Can not find util-vserver installation; aborting..."
+    exit 1
+}
+. "$UTIL_VSERVER_VARS"
+
+USR_LIB_VSERVER=$PKGLIBDIR
+
+if [ $# -lt 1 ] ; then
+       echo $0 vserver-id [ group ]
+elif [ -d $VROOTDIR/$1/var/lib/rpm ] ; then
+       echo $VROOTDIR/$1 already exist
+else
+       VROOT=$VROOTDIR/$1
+       $USR_LIB_VSERVER/install-pre.sh $1
+       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
+       yum --installroot="$VROOT" -y groupinstall "$2"
+       umount $VROOT/proc
+       umount $VROOT/dev/pts
+       $USR_LIB_VSERVER/install-post.sh $1
+fi