7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
22 if [ "$PLC_BOOT_ENABLED" != "1" -a \
23 "$PLC_WWW_ENABLED" != "1" ] ; then
27 MESSAGE=$"Rebuilding Boot CD"
30 ########## legacy myplcs - temporary code
31 # create /etc/planetlab/nodefamily if missing
32 [ -f /etc/planetlab/nodefamily ] || { mkdir -p /etc/planetlab ; echo "planetlab-i386" > /etc/planetlab/nodefamily ; }
33 # move if plain directories
34 for legacydir in /usr/share/bootcd /var/www/html/download ; do
35 if [ -d "${legacydir}" ] && [ ! -h ${legacydir} ] ; then
36 rm -rf ${legacydir}-legacy
37 mv -f ${legacydir} ${legacydir}-legacy
42 # get the default nodefamily
43 def_nodefamily=$(cat /etc/planetlab/nodefamily)
45 # Customize the Boot CD : run build.sh on all available bootcd's
47 for bootcd in /usr/share/bootcd-* ; do
48 name=$(basename $bootcd)
49 nodefamily=$(echo $name | sed -e s,bootcd-,,)
50 download=/var/www/html/download-${nodefamily}
51 [ -d ${download} ] || mkdir -p ${download}
54 ${bootcd}/build.sh ${PLC_BUILD_ALL_BOOTCDS:+-a}
58 # the default: create symlinks to the actual locations
59 if [ "${nodefamily}" == "${def_nodefamily}" ] ; then
60 rm -rf /usr/share/bootcd
61 ln -s /usr/share/bootcd-${nodefamily} /usr/share/bootcd
62 rm -rf /var/www/html/download
63 ln -s /var/www/html/download-${nodefamily} /var/www/html/download