summaryrefslogtreecommitdiff
path: root/src/Propellor/Types
diff options
context:
space:
mode:
authorJoey Hess2017-12-21 00:12:01 -0400
committerJoey Hess2017-12-21 00:12:01 -0400
commit4b2f46e510080b6d5df0ee04a3fae8e53df1ea7a (patch)
tree57297d14f190e3d3d79d8bc5810b2088a7eb9c75 /src/Propellor/Types
parent5c0dce561b037c6152fa9d02e5190daad7ee805d (diff)
Grub.boots, Grub.bootsMounted: Pass --target to grub-install.
This is to support eg, coreboot. The GrubTarget passed to Grub.installed is introspected to determine --target. If multiple grubs are installed, it currently doesn't pass any --target. Might make more sense to run grub-install repeatedly, but I don't know if that case is sane at all. The Xen -> "x86_64-xen" mapping is kind of arbitrarily chosen since there's a i386-xen available too. I don't know when that case would be used in any case though; chainPVGrub uses installed Xen, but it does not run grub-install. If this does become a problem, would probably need to split it into Xen64 and Xen32. Renamed BIOS to GrubTarget in passing to match grub's terminology; BIOS was kind of a joke term for this in propellor. This commit was sponsored by Francois Marier on Patreon.
Diffstat (limited to 'src/Propellor/Types')
-rw-r--r--src/Propellor/Types/Bootloader.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Propellor/Types/Bootloader.hs b/src/Propellor/Types/Bootloader.hs
index fd929d7e..65117bd2 100644
--- a/src/Propellor/Types/Bootloader.hs
+++ b/src/Propellor/Types/Bootloader.hs
@@ -7,13 +7,16 @@ import Propellor.Types.Info
-- | Boot loader installed on a host.
data BootloaderInstalled
- = GrubInstalled
+ = GrubInstalled GrubTarget
| FlashKernelInstalled
| UbootInstalled (FilePath -> FilePath -> Property Linux)
deriving (Typeable)
+-- | Platforms that grub can boot.
+data GrubTarget = PC | EFI64 | EFI32 | Coreboot | Xen
+
instance Show BootloaderInstalled where
- show GrubInstalled = "GrubInstalled"
+ show (GrubInstalled _) = "GrubInstalled"
show FlashKernelInstalled = "FlashKernelInstalled"
show (UbootInstalled _) = "UbootInstalled"