s/jre-somejunk/jre
[vserver-reference.git] / build.sh
1 #!/bin/bash
2 #
3 # Builds VServer reference image
4 #
5 # Mark Huang <mlhuang@cs.princeton.edu>
6 # Copyright (C) 2004-2006 The Trustees of Princeton University
7 #
8 # $Id: build.sh,v 1.20 2007/09/06 20:41:23 faiyaza Exp $
9 #
10
11 PATH=/sbin:/bin:/usr/sbin:/usr/bin
12
13 # In both a normal CVS environment and a PlanetLab RPM
14 # build environment, all of our dependencies are checked out into
15 # directories at the same level as us.
16 if [ -d ../build ] ; then
17     PATH=$PATH:../build
18     srcdir=..
19 else
20     echo "Error: Could not find $(cd .. && pwd -P)/build/"
21     exit 1
22 fi
23
24 export PATH
25
26 # build.common comes from the build module
27 . build.common
28
29 pl_process_fedora_options $@
30 shiftcount=$?
31 shift $shiftcount
32
33 # XXX this should be coming from some configuration file
34 # Packages to install
35 packagelist=(
36 bash
37 coreutils
38 iputils
39 kernel-vserver
40 bzip2
41 crontabs
42 diffutils
43 logrotate
44 openssh-clients
45 passwd
46 rsh
47 rsync
48 sudo
49 tcpdump
50 telnet
51 traceroute
52 time
53 vixie-cron
54 wget
55 which
56 yum
57 curl
58 gzip
59 perl
60 python
61 tar
62 jre
63 findutils
64 )
65
66 # vserver-reference packages used for reference image
67 for package in "${packagelist[@]}" ; do
68     packages="$packages -p $package"
69 done
70
71 # Do not tolerate errors
72 set -e
73
74 # Make /vservers
75 vroot=$PWD/vservers/.vref/default
76 install -d -m 755 $vroot
77
78 # Populate a minimal /dev in the reference image
79 pl_makedevs $vroot
80
81 # Populate image with vserver-reference packages
82 pl_setup_chroot $vroot $packages
83
84 exit 0