#!/bin/sh

if [ -z $TFTPROOT ]; then
  TFTPROOT=/tftpboot
fi

if [ -z $NETWORK ]; then
  NETWORK="192.168.2."
fi

if [ -z $NUMSLAVES ]; then
  NUMSLAVES=70
fi


mkdir $TFTPROOT

SLAVE=2
while [ $SLAVE -le 70 ]; do
  mkdir $TFTPROOT/$NETWORK$SLAVE
#  cd $TFTPROOT/$NETWORK$SLAVE
  # create sybolix links
  ln -s ../yaboot $TFTPROOT/$NETWORK$SLAVE
  ln -s ../initrd.gz $TFTPROOT/$NETWORK$SLAVE
  ln -s ../bootlinux $TFTPROOT/$NETWORK$SLAVE/bootme
  ln -s ../yaboot.conf-postinst $TFTPROOT/$NETWORK$SLAVE/yaboot.conf
  ln -s ../vmlinux-allnodes $TFTPROOT/$NETWORK$SLAVE/vmlinux
#  cp -av 192.168.2.34/* $NETWORK$SLAVE/
  SLAVE=`expr $SLAVE + 1`
done

# need to create the nice files themselves in $TFTPROOT
