#!/bin/bash # $Id$ # $URL$ # # priority: 999 # # 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 $(ls -d /etc/planetlab/bootcd-variants/* 2> /dev/null); 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@ 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 --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