#!/bin/sh

. /usr/share/os-prober/common.sh

partition=$1
mpoint=$2
type=$3

# Weed out stuff that doesn't apply to us
case "$type" in
  vfat) debug "$1 is a FAT32 partition" ;;
  msdos) debug "$1 is a FAT16 partition" ;;
  *) debug "$1 is not a FAT partition: exiting"; exit 1 ;;
esac

if [ -e "$2/kernel.sys" -a -e "$2/command.com" ]; then
  label=$(count_next_label FreeDOS)
  result "$1:FreeDOS:$label:chain"
  exit 0
else
  exit 1
fi
