From 461b8cbd32352d9dc9614e16db7404df974faf91 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Jul 2014 03:16:18 -0400 Subject: propellor spin --- src/Propellor/Property/Grub.hs | 8 +++++--- src/Propellor/Property/HostingProvider/Linode.hs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs index b8e1b662..841861f4 100644 --- a/src/Propellor/Property/Grub.hs +++ b/src/Propellor/Property/Grub.hs @@ -7,6 +7,8 @@ import qualified Propellor.Property.Apt as Apt -- | Eg, hd0,0 or xen/xvda1 type GrubDevice = String +type TimeoutSecs = Int + -- | Use PV-grub chaining to boot -- -- Useful when the VPS's pv-grub is too old to boot a modern kernel image. @@ -15,12 +17,12 @@ type GrubDevice = String -- -- The rootdev should be in the form "hd0", while the bootdev is in the form -- "xen/xvda". -chainPVGrub :: GrubDevice -> GrubDevice -> Property -chainPVGrub rootdev bootdev = combineProperties desc +chainPVGrub :: GrubDevice -> GrubDevice -> TimeoutSecs -> Property +chainPVGrub rootdev bootdev timeout = combineProperties desc [ File.dirExists "/boot/grub" , "/boot/grub/menu.lst" `File.hasContent` [ "default 1" - , "timeout 30" + , "timeout " ++ show timeout , "" , "title grub-xen shim" , "root (" ++ rootdev ++ ")" diff --git a/src/Propellor/Property/HostingProvider/Linode.hs b/src/Propellor/Property/HostingProvider/Linode.hs index cfabe814..34d72184 100644 --- a/src/Propellor/Property/HostingProvider/Linode.hs +++ b/src/Propellor/Property/HostingProvider/Linode.hs @@ -6,5 +6,5 @@ import qualified Propellor.Property.Grub as Grub -- | Linode's pv-grub-x86_64 does not currently support booting recent -- Debian kernels compressed with xz. This sets up pv-grub chaing to enable -- it. -chainPVGrub :: Property +chainPVGrub :: Grub.TimeoutSecs -> Property chainPVGrub = Grub.chainPVGrub "hd0" "xen/xvda" -- cgit v1.3-2-g0d8e