X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=build.sh;h=be62285019b727ad6c7b19068b5af6b943a7f3a2;hb=f5965b780a226ccfc2998278da6631f4a381b376;hp=179e9d918dafb182485010d17d237a6dae4f3d13;hpb=e4b8ca672ec6f70f7f89d6f6723d34cca0f7d3e2;p=sliceimage.git diff --git a/build.sh b/build.sh index 179e9d9..be62285 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2004-2006 The Trustees of Princeton University # -# $Id: build.sh,v 1.6 2006/03/29 19:19:55 mlhuang Exp $ +# $Id: build.sh,v 1.18.2.1 2007/08/30 16:39:09 mef Exp $ # PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -17,16 +17,20 @@ if [ -d ../build ] ; then 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 -# Release and architecture to install -releasever=2 -basearch=i386 +# build.common comes from the build module +. build.common +pl_process_fedora_options $@ +shiftcount=$? +shift $shiftcount + +# XXX this should be coming from some configuration file # Packages to install packagelist=( bash @@ -48,54 +52,32 @@ traceroute time vixie-cron wget +which yum curl gzip perl python tar +findutils ) -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 -} - -# 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 # Do not tolerate errors set -e # Make /vservers -vroot=$PWD/vservers/vserver-reference +vroot=$PWD/vservers/.vref/default install -d -m 755 $vroot -# Install vserver-reference system -for package in "${packagelist[@]}" ; do - packages="$packages -p $package" -done -mkfedora -v -r $releasever -a $basearch $packages $vroot +# Populate a minimal /dev in the reference image +pl_makedevs $vroot -# 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 +# Populate image with vserver-reference packages +pl_setup_chroot $vroot $packages exit 0