# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: build_devel.sh,v 1.7 2007/01/12 14:48:02 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
/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
+
+pl_fixdirs devel/root "${datadirs[@]}"
+
echo "* myplc-devel: Installing base filesystem"
mkdir -p devel/root
-make_chroot devel/root plc_devel_config.xml
+# xxx need be pldistro & fcdistro dependant
+make_chroot_from_lst devel/root planetlab-devel.lst
# Install configuration file
echo "* myplc-devel: Installing configuration file"
gid=${SUDO_GID:-2000}
if ! grep -q "Automated Build" devel/root/etc/passwd ; then
chroot devel/root <<EOF
-groupadd -g $gid build
-useradd -c "Automated Build" -u $uid -g $gid -n -d /data/build -M -s /bin/bash build
+groupadd -o -g $gid build
+useradd -o -c 'Automated Build' -u $uid -g $gid -n -d /data/build -M -s /bin/bash build
+exit 0
EOF
fi
# Allow build user to build certain RPMs as root
cat >devel/root/etc/sudoers <<EOF
root ALL=(ALL) ALL
-build ALL=(root) NOPASSWD: /usr/bin/rpmbuild
+#build ALL=(root) NOPASSWD: /usr/bin/rpmbuild
+build ALL=(ALL) NOPASSWD: ALL
EOF
# Move "data" directories out of the installation
echo "* myplc-devel: Moving data directories out of the installation"
-move_datadirs devel/root devel/data "${datadirs[@]}"
+pl_move_dirs devel/root devel/data /data "${datadirs[@]}"
# Fix permissions on tmp directories
-chmod 1777 devel/data/tmp devel/data/usr/tmp devel/data/var/tmp
+pl_fixtmp_permissions devel/data
# Make image out of directory
echo "* myplc-devel: Building loopback image"
-make_image devel/root devel/root.img
+pl_make_image devel/root devel/root.img 100000000
exit 0