moving the plc.d scripts for bootcd where they belong
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 18 Jan 2010 14:14:44 +0000 (14:14 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 18 Jan 2010 14:14:44 +0000 (14:14 +0000)
myplc.spec
plc.d/bootcd [deleted file]
plc.d/bootcd-kernel [deleted file]

index f2f6fba..b4951b2 100644 (file)
@@ -63,6 +63,7 @@ Requires: vixie-cron
 # planetlab stuff
 Requires: bootmanager
 Requires: bootcd-%{pldistro}-%{_arch}
+Requires: bootcd-initscripts
 Requires: PLCWWW
 Requires: www-register-wizard
 Requires: nodeconfig
@@ -110,17 +111,6 @@ popd
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-# If run under sudo
-if [ -n "$SUDO_USER" ] ; then
-    # Allow user to delete the build directory
-    chown -h -R $SUDO_USER .
-    # Some temporary cdroot files like /var/empty/sshd and
-    # /usr/bin/sudo get created with non-readable permissions.
-    find . -not -perm +0600 -exec chmod u+rw {} \;
-    # Allow user to delete the built RPM(s)
-    [ -d %{_rpmdir}/noarch ] && chown -h -R $SUDO_USER %{_rpmdir}/noarch
-fi
-
 %pre
 if [ -x %{_sysconfdir}/init.d/plc ] ; then
     %{_sysconfdir}/init.d/plc stop
diff --git a/plc.d/bootcd b/plc.d/bootcd
deleted file mode 100755 (executable)
index e628dd7..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-#
-# priority: 1000
-#
-# Rebuild the Boot CD
-#
-# Mark Huang <mlhuang@cs.princeton.edu>
-# Copyright (C) 2006 The Trustees of Princeton University
-#
-# $Id$
-#
-
-# Source function library and configuration
-. /etc/plc.d/functions
-. /etc/planetlab/plc_config
-
-# Be verbose
-set -x
-
-case "$1" in
-    start)
-       if [ "$PLC_BOOT_ENABLED" != "1" -a \
-            "$PLC_WWW_ENABLED" != "1" ] ; then
-           exit 0
-       fi
-
-       MESSAGE=$"Rebuilding Boot CD"
-       dialog "$MESSAGE"
-
-       ########## legacy myplcs - temporary code
-       # create /etc/planetlab/nodefamily if missing
-       [ -f /etc/planetlab/nodefamily ] || { mkdir -p /etc/planetlab ; echo "planetlab-i386" > /etc/planetlab/nodefamily ; }
-       # move if plain directories
-       for legacydir in /usr/share/bootcd /var/www/html/download ; do
-           if [ -d "${legacydir}" ] && [ ! -h ${legacydir} ] ; then
-               rm -rf ${legacydir}-legacy
-               mv -f ${legacydir} ${legacydir}-legacy
-           fi
-       done
-       ########## end
-
-       # get the default nodefamily
-       def_nodefamily=$(cat /etc/planetlab/nodefamily)
-       
-       # Customize the Boot CD : run build.sh on all available bootcd's
-       shopt -s nullglob
-       for bootcd in /usr/share/bootcd-* ; do
-           name=$(basename $bootcd)
-           nodefamily=$(echo $name | sed -e s,bootcd-,,)
-           download=/var/www/html/download-${nodefamily}
-           [ -d ${download} ] || mkdir -p ${download}
-
-           pushd ${download}
-           ${bootcd}/build.sh ${PLC_BUILD_ALL_BOOTCDS:+-a}
-           check
-           popd
-       
-           # the default: create symlinks to the actual locations
-           if [ "${nodefamily}" == "${def_nodefamily}" ] ; then
-               rm -rf /usr/share/bootcd
-               ln -s /usr/share/bootcd-${nodefamily} /usr/share/bootcd
-               rm -rf /var/www/html/download
-               ln -s /var/www/html/download-${nodefamily} /var/www/html/download
-           fi
-       done
-
-       result "$MESSAGE"
-       ;;
-esac
-
-exit $ERRORS
diff --git a/plc.d/bootcd-kernel b/plc.d/bootcd-kernel
deleted file mode 100755 (executable)
index 5125ada..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-#
-# priority: 0999
-#
-# $Id$
-# Build BootCD variants with kernels specified in /etc/planetlab/bootcd-variants
-
-# Source function library and configuration
-. /etc/plc.d/functions
-
-# Be verbose
-set -x
-
-case "$1" in
-    start)
-       MESSAGE=$"Creating BootCD variants"
-       dialog "$MESSAGE"
-
-       success=0
-       for i in /usr/share/bootcd-*; do
-               pushd $i
-               basearch=$(echo $i | awk -F- '{ print $NF }')
-               arch=$(echo $basearch | sed 's/i386/i686/')
-               for j in /etc/planetlab/bootcd-variants/*; do
-                       name="${j##*/}"
-                       url=$(cat "$j" | sed "s!@BASEARCH@!$basearch!g;s!@ARCH@!$arch!g")
-                       if test -d "$name"; then
-                               test build/isofs/bootcd.img -nt "$name/isofs/bootcd.img" || continue
-                       elif test "$name" = default; then
-                               # Not ideal, but...
-                               grep -q support@planet-lab.org build/isofs/kernel || continue
-                       fi
-                       if test "$url" != $(echo "$url" | sed s#[:/]##); then
-                               ./kvariant.sh "$name" "$url"
-                       else
-                               dir=$(mktemp -d -p /var/tmp)
-                               yumdownloader --disablerepo='*' \
-                                       --enablerepo=base \
-                                       --enablerepo=updates \
-                                       --destdir "$dir" "$url"
-                               ./kvariant.sh "$name" "$dir"/"$url"*
-                               rm -fr "$dir"
-                       fi
-                       if test "$name" = default; then
-                               rm -fr orig
-                               mv build orig
-                               mv default build
-                       fi
-               done
-               popd
-       done
-       test $success = 0
-       check
-
-       result "$MESSAGE"
-       ;;
-esac
-
-exit $ERRORS