git://git.onelab.eu
/
vserver-reference.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
s/jre-somejunk/jre
[vserver-reference.git]
/
build.sh
diff --git
a/build.sh
b/build.sh
index
58f8bcb
..
7aa40b9
100755
(executable)
--- a/
build.sh
+++ b/
build.sh
@@
-5,7
+5,7
@@
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2004-2006 The Trustees of Princeton University
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2004-2006 The Trustees of Princeton University
#
-# $Id: build.sh,v 1.
4 2006/03/21 14:57:29 mlhuang
Exp $
+# $Id: build.sh,v 1.
20 2007/09/06 20:41:23 faiyaza
Exp $
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
@@
-17,48
+17,68
@@
if [ -d ../build ] ; then
PATH=$PATH:../build
srcdir=..
else
PATH=$PATH:../build
srcdir=..
else
- echo "Error: Could not find
sources in either . or ..
"
+ echo "Error: Could not find
$(cd .. && pwd -P)/build/
"
exit 1
fi
export PATH
exit 1
fi
export PATH
-# Release and architecture to install
-releasever=2
-basearch=i386
+# build.common comes from the build module
+. build.common
-usage()
-{
- echo "Usage: build.sh [OPTION]..."
- echo " -r release Fedora release number (default: $releasever)"
- echo " -a arch Fedora architecture (default: $basearch)"
- echo " -h This message"
- exit 1
-}
+pl_process_fedora_options $@
+shiftcount=$?
+shift $shiftcount
+
+# XXX this should be coming from some configuration file
+# Packages to install
+packagelist=(
+bash
+coreutils
+iputils
+kernel-vserver
+bzip2
+crontabs
+diffutils
+logrotate
+openssh-clients
+passwd
+rsh
+rsync
+sudo
+tcpdump
+telnet
+traceroute
+time
+vixie-cron
+wget
+which
+yum
+curl
+gzip
+perl
+python
+tar
+jre
+findutils
+)
-# Get options
-while getopts "r:a:h" opt ; do
- case $opt in
- r)
- releasever=$OPTARG
- ;;
- a)
- basearch=$OPTARG
- ;;
- h|*)
- usage
- ;;
- esac
+# vserver-reference packages used for reference image
+for package in "${packagelist[@]}" ; do
+ packages="$packages -p $package"
done
done
+# Do not tolerate errors
+set -e
+
# Make /vservers
# Make /vservers
-vroot=$PWD/vservers/
vserver-reference
+vroot=$PWD/vservers/
.vref/default
install -d -m 755 $vroot
install -d -m 755 $vroot
-# Install vserver-reference system
-mkfedora -v -r $releasever -a $basearch -g VServer $vroot
+# Populate a minimal /dev in the reference image
+pl_makedevs $vroot
+
+# Populate image with vserver-reference packages
+pl_setup_chroot $vroot $packages
-# This tells the Boot Manager that it is okay to update
-# /etc/resolv.conf and /etc/hosts whenever the network configuration
-# changes. Users are free to delete this file.
-touch $vroot/etc/AUTO_UPDATE_NET_FILES
+exit 0