summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Grub.hs
diff options
context:
space:
mode:
authorJoey Hess2015-10-22 14:10:52 -0400
committerJoey Hess2015-10-22 14:10:52 -0400
commitcc8fbeda82774f6c9a223a87187408496fcd0d2b (patch)
treecac18ab6afcae783cfb765caea9a063d426b2bdd /src/Propellor/Property/Grub.hs
parente73f67c381d41c65f33fb94dccdcbb7b120ad9a8 (diff)
avoid grub install failure in chroot
Diffstat (limited to 'src/Propellor/Property/Grub.hs')
-rw-r--r--src/Propellor/Property/Grub.hs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs
index 6b763d08..ea54295b 100644
--- a/src/Propellor/Property/Grub.hs
+++ b/src/Propellor/Property/Grub.hs
@@ -18,14 +18,19 @@ data BIOS = PC | EFI64 | EFI32 | Coreboot | Xen
-- | Installs the grub package. This does not make grub be used as the
-- bootloader.
--
--- This includes running update-grub, so that the grub boot menu is
--- created. It will be automatically updated when kernel packages are
--- installed.
+-- This includes running update-grub.
installed :: BIOS -> Property NoInfo
-installed bios =
- Apt.installed [pkg] `describe` "grub package installed"
- `before`
- cmdProperty "update-grub" []
+installed bios = installed' bios `before` mkConfig
+
+-- Run update-grub, to generate the grub boot menu. It will be
+-- automatically updated when kernel packages are
+-- -- installed.
+mkConfig :: Property NoInfo
+mkConfig = cmdProperty "update-grub" []
+
+-- | Installs grub; does not run update-grub.
+installed' :: BIOS -> Property NoInfo
+installed' bios = Apt.installed [pkg] `describe` "grub package installed"
where
pkg = case bios of
PC -> "grub-pc"