#!/bin/sh
set -e

ARCH="$(archdetect)"

case $ARCH in
    i386/mac|amd64/mac)
	# x86-based Apple systems use elilo, but only if EFI is available
	# (not booting in BIOS compatibility mode).
	# Note: depends on partman-efi to load the efivars module!
	if [ -d /sys/firmware/efi ]; then
		exit 0
	else
		exit 1
	fi
	;;
    i386/*|amd64/*)
	# Everyone else on x86 should use a different boot loader.
	exit 1
	;;
esac

# All ia64 systems use elilo.
exit 0
