summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2014-11-22 22:24:09 -0400
committerJoey Hess2014-11-22 22:24:09 -0400
commitca09087caf5298b01f05bae4a4601fce47966c4f (patch)
tree9a960709a610b15fabf57b5c4b845e308a42bece /src
parent1a6a317e64526af51160a338189be45f67b50738 (diff)
propellor spin
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Engine.hs3
-rw-r--r--src/Propellor/Property/Debootstrap.hs4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs
index b551ca05..0b65fb7e 100644
--- a/src/Propellor/Engine.hs
+++ b/src/Propellor/Engine.hs
@@ -11,6 +11,8 @@ import "mtl" Control.Monad.Reader
import Control.Exception (bracket)
import System.PosixCompat
import System.Posix.IO
+import System.FilePath
+import System.Directory
import Propellor.Types
import Propellor.Message
@@ -60,6 +62,7 @@ onlyProcess :: FilePath -> IO a -> IO a
onlyProcess lockfile a = bracket lock unlock (const a)
where
lock = do
+ createDirectoryIfMissing True (takeDirectory lockfile)
l <- createFile lockfile stdFileMode
setLock l (WriteLock, AbsoluteSeek, 0, 0)
`catchIO` const alreadyrunning
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index f85eb2e6..32e892bb 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -263,10 +263,12 @@ fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $ do
, Param "sh"
, Param "-c"
, Param $ intercalate " && "
- [ "apt-get -y install makedev"
+ [ "apt-get update"
+ , "apt-get -y install makedev"
, "rm -rf /dev"
, "mkdir /dev"
, "cd /dev"
+ , "mount -t proc proc /proc"
, "/sbin/MAKEDEV std ptmx fd consoleonly"
]
]