This commit is contained in:
Joey Hess 2014-11-22 21:50:49 -04:00
parent cc8babccc8
commit 5360e466d3
1 changed files with 13 additions and 11 deletions

View File

@ -108,15 +108,6 @@ built target system@(System _ arch) config =
, return False , 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 :: IO [FilePath]
mountPoints = lines <$> readProcess "findmnt" ["-rn", "--output", "target"] mountPoints = lines <$> readProcess "findmnt" ["-rn", "--output", "target"]
@ -243,6 +234,15 @@ makeWrapperScript dir = do
] ]
modifyFileMode wrapperScript (addModes $ readModes ++ executeModes) 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 -- Work around for http://bugs.debian.org/770217
makeDevicesTarball :: IO () makeDevicesTarball :: IO ()
makeDevicesTarball = do makeDevicesTarball = do
@ -256,8 +256,9 @@ makeDevicesTarball = do
tarcmd = "(cd / && tar cf - dev) | gzip > devices.tar.gz" tarcmd = "(cd / && tar cf - dev) | gzip > devices.tar.gz"
fixForeignDev :: FilePath -> IO () fixForeignDev :: FilePath -> IO ()
fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $ fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $ do
void $ boolSystem "chroot" de <- debootstrapEnv
void $ boolSystemEnv "chroot"
[ File target [ File target
, Param "sh" , Param "sh"
, Param "-c" , Param "-c"
@ -268,6 +269,7 @@ fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $
, "/sbin/MAKEDEV std ptmx fd consoleonly" , "/sbin/MAKEDEV std ptmx fd consoleonly"
] ]
] ]
(Just de)
foreignDevFlag :: FilePath foreignDevFlag :: FilePath
foreignDevFlag = "/dev/.propellor-foreign-dev" foreignDevFlag = "/dev/.propellor-foreign-dev"