use build/build.common functions
[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.18.2.1 2007/08/30 16:39:09 mef 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 findutils
63 )
64
65 # vserver-reference packages used for reference image
66 for package in "${packagelist[@]}" ; do
67     packages="$packages -p $package"
68 done
69
70 # Do not tolerate errors
71 set -e
72
73 # Make /vservers
74 vroot=$PWD/vservers/.vref/default
75 install -d -m 755 $vroot
76
77 # Populate a minimal /dev in the reference image
78 pl_makedevs $vroot
79
80 # Populate image with vserver-reference packages
81 pl_setup_chroot $vroot $packages
82
83 exit 0