#!/bin/sh -e

if [ -z ${MITTOS64+x} ]; then >&2 echo "Unsupported environment! See README"; exit 1; fi

sysroot=${BUILDROOT}sysroot
iso=${BUILDROOT}mittos64.iso

mkdir -p ${sysroot}

# Grub configuration file
# set to boot /kernel with minimal wait
mkdir -p ${sysroot}/boot/grub
cat > ${sysroot}/boot/grub/grub.cfg << EOF
set timeout=1
set default=0

menuentry "mittos64" {
  multiboot2 /kernel
}

EOF

grub-mkrescue -o ${iso} ${sysroot}
