3 # Common functions for MyPLC build scripts (build_devel.sh and
6 # Mark Huang <mlhuang@cs.princeton.edu>
7 # Copyright (C) 2006 The Trustees of Princeton University
9 # $Id: build.functions,v 1.10.2.1 2007/08/30 16:39:07 mef Exp $
12 PATH=/sbin:/bin:/usr/sbin:/usr/bin
14 # In both a normal CVS environment and a PlanetLab RPM
15 # build environment, all of our dependencies are checked out into
16 # directories at the same level as us.
17 if [ -d ../build ] ; then
21 echo "Error: Could not find $(cd .. && pwd -P)/build/"
29 pl_process_fedora_options $@
33 # XXX Backwards compatibility with old myplc-devel environment
34 # We may be running inside a myplc-devel environment, which can
35 # override these defaults.
36 if [ -f /etc/planetlab/plc_config ] ; then
37 . /etc/planetlab/plc_config
38 [ ! -z "$PLC_DEVEL_FEDORA_RELEASE" ] && pl_FEDORA_RELEASE=$PLC_DEVEL_FEDORA_RELEASE
39 [ ! -z "$PLC_DEVEL_FEDORA_ARCH" ] && pl_FEDORA_ARCH=$PLC_DEVEL_FEDORA_ARCH
40 [ ! -z "$PLC_DEVEL_FEDORA_URL" ] && pl_FEDORA_URL=$PLC_DEVEL_FEDORA_URL
43 # Do not tolerate errors
49 # Make a basic chroot at the specified location given the specified
58 groups="$groups -g \"$group\""
59 done < <(./plc-config --groups $config)
63 while read package ; do
64 packages="$packages -p \"$package\""
65 done < <(./plc-config --packages $config)
67 pl_setup_chroot $root $packages $groups
70 # Move specified directories out of the chroot and into a "data"
71 # directory that will be bind mounted on /data inside the chroot.
76 pl_move_dirs $root $data /data "$@"
79 # Make loopback filesystem from specified location
83 pl_make_image $root $image 100000000