X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=build_devel.sh;h=e8bce859f8f78d580cbf7773078ffe2f831fb720;hb=c9eb7474b9052dc999d6ed550ae5dc506e8532be;hp=77893b3006e1ce4ea1daae39989109cf696779dd;hpb=1dc466186b2ba51649ffc000429fe9496ca467bb;p=myplc.git diff --git a/build_devel.sh b/build_devel.sh index 77893b3..e8bce85 100755 --- a/build_devel.sh +++ b/build_devel.sh @@ -10,15 +10,37 @@ # 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$ +# $Id: build_devel.sh,v 1.6 2007/01/11 21:49:52 mlhuang Exp $ # . 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 +/build +/cvs +/root +/tmp +/usr/tmp +/var/tmp +/var/log +) +for datadir in "${datadirs[@]}" ; do + # If we are being re-run, it may be a symlink + if [ -h devel/root/$datadir ] ; then + rm -f devel/root/$datadir + mkdir -p devel/root/$datadir + fi +done + echo "* myplc-devel: Installing base filesystem" mkdir -p devel/root make_chroot devel/root plc_devel_config.xml @@ -40,8 +62,7 @@ for dir in * ; do else ignore="-I !" fi - date=$(date +%Y-%m-%d) - cvs -d $cvsroot import -m "Initial import" -ko $ignore $dir planetlab planetlab-$date + cvs -d $cvsroot import -m "Initial import" -ko $ignore $dir planetlab $IMPORT_TAG popd fi done @@ -57,6 +78,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" @@ -64,10 +86,21 @@ 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' +# handle root's homedir and tweak root prompt +echo "* myplc-devel: root's homedir and prompt" +roothome=devel/data/root +mkdir -p $roothome +cat << EOF > $roothome/.profile +export PS1=" \$PS1" +EOF +chmod 644 $roothome/.profile + # Move "data" directories out of the installation echo "* myplc-devel: Moving data directories out of the installation" -move_datadirs devel/root devel/data \ - /etc/planetlab /build /cvs +move_datadirs devel/root devel/data "${datadirs[@]}" + +# Fix permissions on tmp directories +chmod 1777 devel/data/tmp devel/data/usr/tmp devel/data/var/tmp # Make image out of directory echo "* myplc-devel: Building loopback image"