#!/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).
		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
