summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2016-11-04 12:31:57 -0400
committerJoey Hess2016-11-04 12:31:57 -0400
commita9fb42faeb101d2ba33b21787d65a79569457a6e (patch)
treeb16ca9df5051a43bedfdd6554ace206fd20234aa /src/Propellor/Property
parente8dfd6b6d8ddf11eb062eaff5eea2335f78acf2f (diff)
parenta271e8abe2845461585c94274884d3d616c77595 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/HostingProvider/Linode.hs19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/Propellor/Property/HostingProvider/Linode.hs b/src/Propellor/Property/HostingProvider/Linode.hs
index 71719d87..fca3df63 100644
--- a/src/Propellor/Property/HostingProvider/Linode.hs
+++ b/src/Propellor/Property/HostingProvider/Linode.hs
@@ -5,9 +5,22 @@ import qualified Propellor.Property.Grub as Grub
import qualified Propellor.Property.File as File
import Utility.FileMode
--- | Linode's pv-grub-x86_64 does not currently support booting recent
--- Debian kernels compressed with xz. This sets up pv-grub chaining to enable
--- it.
+-- | Configures grub to use the serial console as set up by Linode.
+-- Useful when running a distribution supplied kernel.
+-- <https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-distribution-supplied-kernel-with-kvm>
+serialGrub :: Property DebianLike
+serialGrub = "/etc/default/grub" `File.containsLines`
+ [ "GRUB_CMDLINE_LINUX=\"console=ttyS0,19200n8\""
+ , "GRUB_DISABLE_LINUX_UUID=true"
+ , "GRUB_SERIAL_COMMAND=\"serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1\""
+ , "GRUB_TERMINAL=serial"
+ ]
+ `onChange` Grub.mkConfig
+ `requires` Grub.installed Grub.PC
+
+-- | Linode's pv-grub-x86_64 (only used for its older XEN instances)
+-- does not support booting recent Debian kernels compressed
+-- with xz. This sets up pv-grub chaining to enable it.
chainPVGrub :: Grub.TimeoutSecs -> Property DebianLike
chainPVGrub = Grub.chainPVGrub "hd0" "xen/xvda"