From ebe81e975882ca3d4fcfe8e80fe9747f0128e2bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Jul 2017 22:18:29 -0400 Subject: Added Mount.isMounted. * Added Mount.isMounted. * Grub.bootsMounted: Bugfix. --- src/Propellor/Property/Grub.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property/Grub.hs') diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs index dbc34f4b..d0516dc8 100644 --- a/src/Propellor/Property/Grub.hs +++ b/src/Propellor/Property/Grub.hs @@ -132,7 +132,12 @@ bootsMounted mnt wholediskdev = combineProperties desc $ props cleanupmounts :: Property Linux cleanupmounts = property desc $ liftIO $ do - umountLazy (inmnt "/sys") - umountLazy (inmnt "/proc") - umountLazy (inmnt "/dev") + cleanup "/sys" + cleanup "/proc" + cleanup "/dev" return NoChange + where + cleanup m = + let mp = inmnt m + in whenM (isMounted mp) $ + umountLazy mp -- cgit v1.2.3