From da8b19ea5b31637dd6a05bf662bf636b9c3e4910 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 12 Jun 2016 13:01:40 +0900 Subject: explanatory comments --- src/Propellor/Property/Reboot.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Propellor/Property/Reboot.hs b/src/Propellor/Property/Reboot.hs index f30621d4..7733c0d2 100644 --- a/src/Propellor/Property/Reboot.hs +++ b/src/Propellor/Property/Reboot.hs @@ -45,17 +45,19 @@ atEnd force resultok = property "scheduled reboot at end of propellor run" $ do -- -- This will only work if you have taken measures to ensure that the other -- kernel won't just get booted again. See 'Propellor.Property.DigitalOcean' --- for an example. +-- for an example of how to do this. toDistroKernel :: Property DebianLike toDistroKernel = check (not <$> runningInstalledKernel) now `describe` "running installed kernel" -- | Given a kernel version string @v@, reboots immediately if the running -- kernel version is strictly less than @v@ and there is an installed kernel --- version is greater than or equal to @v@ +-- version is greater than or equal to @v@. Dies if the requested kernel +-- version is not installed. -- --- This assumes that the installed kernel with the highest version number is the --- one that will be started if we reboot. +-- For this to be useful, you need to have ensured that the installed kernel +-- with the highest version number is the one that will be started after a +-- reboot. -- -- This is useful when upgrading to a new version of Debian where you need to -- ensure that a new enough kernel is running before ensuring other properties. @@ -69,6 +71,10 @@ toKernelNewerThan ver = if runningV >= wantV then noChange else if installedV >= wantV then ensureProperty w now + -- We error out here because other properties + -- may be incorrectly ensured on a version + -- that's too old. E.g. Sbuild.built can fail + -- to add the config line `union-type=overlay` else errorMessage ("kernel newer than " ++ ver ++ " not installed") -- cgit v1.2.3