From e20599639212ca6223f94a88dbff6641ed54234f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 12 Jun 2016 09:47:23 +0900 Subject: re-organise Exoscale.distroKernel --- src/Propellor/Property/HostingProvider/Exoscale.hs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Propellor/Property/HostingProvider/Exoscale.hs b/src/Propellor/Property/HostingProvider/Exoscale.hs index a123c54a..6bf19cbc 100644 --- a/src/Propellor/Property/HostingProvider/Exoscale.hs +++ b/src/Propellor/Property/HostingProvider/Exoscale.hs @@ -5,6 +5,7 @@ module Propellor.Property.HostingProvider.Exoscale ( ) where import Propellor.Base +import qualified Propellor.Property.File as File import qualified Propellor.Property.Grub as Grub import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Reboot as Reboot @@ -15,12 +16,13 @@ import qualified Propellor.Property.Reboot as Reboot -- We reboot after doing this because 'Sbuild.built' will fail to set up an -- overlay-type chroot on an old kernel distroKernel :: Architecture -> Property DebianLike -distroKernel arch = combineProperties "boots distro kernel" $ props - & Grub.installed' Grub.PC - & Apt.installed ["linux-image-" ++ arch] - -- only these ones are not idempotent so need flag file - & flagFile - (Grub.boots "/dev/vda" - `before` Grub.mkConfig - `before` Reboot.now) - "/etc/propellor-distro-kernel" +distroKernel arch = go `flagFile` theFlagFile + where + go = combineProperties "boots distro kernel" $ props + & Apt.installed ["grub2", "linux-image-" ++ arch] + & Grub.boots "/dev/vda" + & Grub.mkConfig + -- Since we're rebooting we have to manually create the flagfile + & File.hasContent theFlagFile [""] + & Reboot.toDistroKernel + theFlagFile = "/etc/propellor-distro-kernel" -- cgit v1.2.3