#!/bin/sh

# copyright 2004 vagrant@freegeek.org, distributed under the terms of the
# GNU General Public License version 2 or any later version.

CONFDIR="/etc/lessdisks/mkinitrd"

script_dir="$CONFDIR/install_scripts/"

if [ -z "$INITRDDIR" ]; then
  echo "where the heck am i going to copy files to?"
  exit 1
fi

if [ -z "$script_dir" -o ! -d "$script_dir" ]; then
  echo "no script directory found! $script_dir"
  exit 1
fi

for script in $script_dir/* ; do
  cp $script $INITRDDIR/scripts/
done

if [ -s $CONFDIR/network_cards ]; then
  cp $CONFDIR/network_cards $INITRDDIR/etc/network_cards
fi

# set up dhclient options...
echo "request root-path;" >> $INITRDDIR/etc/dhclient.conf

# try to get the root server somehow...
echo "request next-server;" >> $INITRDDIR/etc/dhclient.conf
echo "request tftp-server-name;" >> $INITRDDIR/etc/dhclient.conf
echo "request server-name;" >> $INITRDDIR/etc/dhclient.conf
