summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Debootstrap.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-22 21:50:49 -0400
committerJoey Hess2014-11-22 21:50:49 -0400
commit5360e466d35d01f83f782496ee672206530a85cd (patch)
tree7fd421e10a4163038309e5c2241585df71c16585 /src/Propellor/Property/Debootstrap.hs
parentcc8babccc8992f0f169c5613d583ae5d82373272 (diff)
reorg
Diffstat (limited to 'src/Propellor/Property/Debootstrap.hs')
-rw-r--r--src/Propellor/Property/Debootstrap.hs24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index b04bda71..a8c80348 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -108,15 +108,6 @@ built target system@(System _ arch) config =
, return False
)
--- workaround for http://bugs.debian.org/770658
-debootstrapEnv :: IO [(String, String)]
-debootstrapEnv = do
- path <- getEnvDefault "PATH" "/bin"
- addEntry "PATH" (path ++ debianPath)
- <$> getEnvironment
- where
- debianPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-
mountPoints :: IO [FilePath]
mountPoints = lines <$> readProcess "findmnt" ["-rn", "--output", "target"]
@@ -243,6 +234,15 @@ makeWrapperScript dir = do
]
modifyFileMode wrapperScript (addModes $ readModes ++ executeModes)
+-- workaround for http://bugs.debian.org/770658
+debootstrapEnv :: IO [(String, String)]
+debootstrapEnv = do
+ path <- getEnvDefault "PATH" "/bin"
+ addEntry "PATH" (path ++ debianPath)
+ <$> getEnvironment
+ where
+ debianPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
-- Work around for http://bugs.debian.org/770217
makeDevicesTarball :: IO ()
makeDevicesTarball = do
@@ -256,8 +256,9 @@ makeDevicesTarball = do
tarcmd = "(cd / && tar cf - dev) | gzip > devices.tar.gz"
fixForeignDev :: FilePath -> IO ()
-fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $
- void $ boolSystem "chroot"
+fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $ do
+ de <- debootstrapEnv
+ void $ boolSystemEnv "chroot"
[ File target
, Param "sh"
, Param "-c"
@@ -268,6 +269,7 @@ fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $
, "/sbin/MAKEDEV std ptmx fd consoleonly"
]
]
+ (Just de)
foreignDevFlag :: FilePath
foreignDevFlag = "/dev/.propellor-foreign-dev"