From c84005cbbf432a8296ee44fec83227b15ce18d38 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Oct 2015 20:22:52 -0400 Subject: propellor spin --- src/Propellor/Property/DiskImage.hs | 2 +- src/Propellor/Property/Mount.hs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index cb38cef3..dcd522a3 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -331,7 +331,7 @@ grubBooted bios = (Grub.installed' bios, boots) where boots mnt loopdevs = combineProperties "disk image boots using grub" -- bind mount host /dev so grub can access the loop devices - [ mounted "bind" "/dev" (inmnt "/dev") + [ bindMount "/dev" (inmnt "/dev") , mounted "proc" "proc" (inmnt "/proc") , mounted "sysfs" "sys" (inmnt "/sys") -- work around for http://bugs.debian.org/802717 diff --git a/src/Propellor/Property/Mount.hs b/src/Propellor/Property/Mount.hs index 25984afa..09016011 100644 --- a/src/Propellor/Property/Mount.hs +++ b/src/Propellor/Property/Mount.hs @@ -40,5 +40,11 @@ mounted :: FsType -> Source -> FilePath -> Property NoInfo mounted fs src mnt = property (mnt ++ " mounted") $ toResult <$> liftIO (mount fs src mnt) +-- | Bind mounts the first directory so its contents also appear +-- in the second directory. +bindMount :: FilePath -> FilePath -> Property NoInfo +bindMount src dest = cmdProperty "mount" ["--bind", src, dest] + `describe` ("bind mounted " ++ src ++ " to " ++ dest) + mount :: FsType -> Source -> FilePath -> IO Bool mount fs src mnt = boolSystem "mount" [Param "-t", Param fs, Param src, Param mnt] -- cgit v1.2.3