#!/bin/sh

. common.sh

cd ${ZIPSPEAK_DIST_DIR}
cp ${ZIPSPEAK_SOURCE_DIR}/bootdisk.img bootdisk.ns

mkdir -p ${ZIPSPEAK_BUILD_ROOT}/bootdisk
ZIPSPEAK_BOOTDISK_ROOT=${ZIPSPEAK_BUILD_ROOT}/bootdisk

for synth in `cat ${ZIPSPEAK_SYNTH_FILE} | tr A-Z a-z`
do
  dd if=${ZIPSPEAK_SOURCE_DIR}/bootdisk.img of=/dev/fd0 bs=1024 count=1020
  mount /dev/fd0 ${ZIPSPEAK_BOOTDISK_ROOT}
  cp ${synth} ${ZIPSPEAK_BOOTDISK_ROOT}/vmlinuz
  echo  >> ${ZIPSPEAK_BOOTDISK_ROOT}/boot/message
  ${ZIPSPEAK_STAGE_ROOT}/sbin/lilo -r ${ZIPSPEAK_BOOTDISK_ROOT}
  umount /dev/fd0
  dd if=/dev/fd0 of=${synth}.img bs=1024 count=1020
done
