summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Grub.hs
diff options
context:
space:
mode:
authorJoey Hess2017-07-05 18:00:59 -0400
committerJoey Hess2017-07-05 18:02:30 -0400
commitab5652ff75a96ee0a3615a8fc82e7dfa0c0d9dc6 (patch)
tree466cd1f88d735dbdf77de877d5d12cc9ddae6fd4 /src/Propellor/Property/Grub.hs
parentddf39aa584c3f3e5c881e33c08de5b29ef989623 (diff)
Image.grubBooted no longer takes a BIOS parameter
* DiskImage.grubBooted no longer takes a BIOS parameter, and no longer implicitly adds Grub.installed to the properties of the disk image. If you used DiskImage.grubBooted, you'll need to update your propellor configuration, removing the BIOS parameter from grubBooted and adding a Grub.installed property to the disk image, eg: & Grub.installed PC (API change) * Grub.installed: Avoid running update-grub when used in a chroot, since it will get confused. * DiskImage.Finalization: Simplified this type since it does not need to be used to install packages anymore. (API change) The advantage of doing this comes when using hostChroot with imageBuilt, since the Host then has its Grub.installed property explicitly listed so propellor knows about it when otherwise deploying that host. Also, it simplifies the quite complex imageBuilt parameters. This commit was sponsored by Ewen McNeill.
Diffstat (limited to 'src/Propellor/Property/Grub.hs')
-rw-r--r--src/Propellor/Property/Grub.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs
index 9dd5e8e1..0eaab2bb 100644
--- a/src/Propellor/Property/Grub.hs
+++ b/src/Propellor/Property/Grub.hs
@@ -3,6 +3,7 @@ module Propellor.Property.Grub where
import Propellor.Base
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Apt as Apt
+import Propellor.Property.Chroot (inChroot)
-- | Eg, \"hd0,0\" or \"xen/xvda1\"
type GrubDevice = String
@@ -18,9 +19,10 @@ 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.
+-- This includes running update-grub, unless it's run in a chroot.
installed :: BIOS -> Property DebianLike
-installed bios = installed' bios `onChange` mkConfig
+installed bios = installed' bios
+ `onChange` (check (not <$> inChroot) mkConfig)
-- Run update-grub, to generate the grub boot menu. It will be
-- automatically updated when kernel packages are installed.