summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2014-07-07 03:16:18 -0400
committerJoey Hess2014-07-07 03:16:18 -0400
commit461b8cbd32352d9dc9614e16db7404df974faf91 (patch)
treefdf43e1896af8f0482ec767e44e542ad48d79121 /src
parentdba84b8219d29506886065cc6bcd821d977d2bf8 (diff)
propellor spin
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/Grub.hs8
-rw-r--r--src/Propellor/Property/HostingProvider/Linode.hs2
2 files changed, 6 insertions, 4 deletions
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"