X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=build_devel.sh;h=1f755ec6cb478530b35379032e8045f6984baab3;hb=391310e122de0536c08f62bd46acd3b3b7b13964;hp=edce0bc0a4f2a5f575c2b181b9807c9590e3a528;hpb=13deafa8992af49ddd78fdf994f0e16ed766bd52;p=myplc.git diff --git a/build_devel.sh b/build_devel.sh index edce0bc..1f755ec 100755 --- a/build_devel.sh +++ b/build_devel.sh @@ -10,41 +10,39 @@ # devel/data/cvs/ (local CVS repository) # devel/data/build/ (build area) # devel/data/etc/planetlab/ (configuration) +# devel/data/root (root's home dir) # # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: build_devel.sh,v 1.2 2006/07/24 19:32:23 mlhuang Exp $ +# $Id: build_devel.sh 1078 2007-11-15 13:38:27Z thierry $ # +echo "$0" not supported anymore +echo "need to figure a way to handle space in group names in .lst files" +exit 1 + . build.functions +# These directories are allowed to grow to unspecified size, so they +# are stored as symlinks to the /data partition. mkfedora and yum +# expect some of them to be real directories, however. +datadirs=( +/etc/planetlab +/root +/tmp +/usr/tmp +/var/tmp +/var/log +) + +pl_fixdirs devel/root "${datadirs[@]}" + + echo "* myplc-devel: Installing base filesystem" mkdir -p devel/root -make_chroot devel/root plc_devel_config.xml - -# Import everything (including ourself) into a private CVS tree -echo "* myplc-devel: Building CVS repository" -cvsroot=$PWD/devel/data/cvs -mkdir -p $cvsroot -cvs -d $cvsroot init - -myplc=$(basename $PWD) -pushd .. -for dir in * ; do - if [ ! -d $cvsroot/$dir ] ; then - pushd $dir - if [ "$dir" = "$myplc" ] ; then - # Ignore generated files - ignore="-I ! -I devel -I root -I root.img -I data" - else - ignore="-I !" - fi - cvs -d $cvsroot import -m "Initial import" -ko $ignore $dir planetlab $IMPORT_TAG - popd - fi -done -popd +# xxx need be pldistro & fcdistro dependant +make_chroot_from_lst devel/root planetlab-devel.lst # Install configuration file echo "* myplc-devel: Installing configuration file" @@ -56,6 +54,7 @@ echo "* myplc-devel: Installing configuration scripts" install -D -m 755 plc_config.py devel/root/tmp/plc_config.py chroot devel/root sh -c 'cd /tmp; python plc_config.py build; python plc_config.py install' install -D -m 755 plc-config devel/root/usr/bin/plc-config +install -D -m 755 plc-config-tty devel/root/usr/bin/plc-config-tty # Install initscripts echo "* myplc-devel: Installing initscripts" @@ -63,13 +62,40 @@ find plc.d/functions | cpio -p -d -u devel/root/etc/ install -D -m 755 guest.init devel/root/etc/init.d/plc chroot devel/root sh -c 'chkconfig --add plc; chkconfig plc on' +# Add a build user with the same ID as the current build user, who can +# then cross-mount their home directory into the image and build MyPLC +# in their home directory. +echo "* myplc-devel: Adding build user" +uid=${SUDO_UID:-2000} +gid=${SUDO_GID:-2000} +if ! grep -q "Automated Build" devel/root/etc/passwd ; then + chroot devel/root <devel/root/etc/sudoers <