    {-# LANGUAGE FlexibleInstances, DeriveDataTypeable #-}

    module Propellor.Types.Bootloader where

    import Propellor.Types
    import Propellor.Types.Info

    -- | Boot loader installed on a host.
    data BootloaderInstalled
    	= GrubInstalled GrubTarget
    	| FlashKernelInstalled
    	| UbootInstalled (FilePath -> FilePath -> Property Linux)
    	| NoBootloader
    	deriving (Typeable)

    -- | Platforms that grub can boot.
    data GrubTarget = PC | EFI64 | EFI32 | Coreboot | Xen

    instance Show BootloaderInstalled where
    	show :: BootloaderInstalled -> String
    show (GrubInstalled GrubTarget
    _) = String
    "GrubInstalled"
    	show BootloaderInstalled
    FlashKernelInstalled = String
    "FlashKernelInstalled"
    	show (UbootInstalled String -> String -> Property Linux
    _) = String
    "UbootInstalled"
    	show BootloaderInstalled
    NoBootloader = String
    "NoBootloader"

    instance IsInfo [BootloaderInstalled] where
    	propagateInfo :: [BootloaderInstalled] -> PropagateInfo
    propagateInfo [BootloaderInstalled]
    _ = Bool -> PropagateInfo
    PropagateInfo Bool
    False