pute full path to bin/propellor inside shim
This commit is contained in:
parent
7c5188b202
commit
96ecbaad25
|
@ -88,7 +88,7 @@ propellChroot c@(Chroot loc _ _ _) mkproc systemdonly = property (chrootDesc c "
|
||||||
let me = localdir </> "propellor"
|
let me = localdir </> "propellor"
|
||||||
shim <- liftIO $ ifM (doesDirectoryExist d)
|
shim <- liftIO $ ifM (doesDirectoryExist d)
|
||||||
( pure (Shim.file me d)
|
( pure (Shim.file me d)
|
||||||
, Shim.setup me d
|
, Shim.setup me Nothing d
|
||||||
)
|
)
|
||||||
ifM (liftIO $ bindmount shim)
|
ifM (liftIO $ bindmount shim)
|
||||||
( chainprovision shim
|
( chainprovision shim
|
||||||
|
|
|
@ -263,7 +263,8 @@ fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $ do
|
||||||
, Param "sh"
|
, Param "sh"
|
||||||
, Param "-c"
|
, Param "-c"
|
||||||
, Param $ intercalate " && "
|
, Param $ intercalate " && "
|
||||||
[ "rm -rf /dev"
|
[ "apt-get -y install makedev"
|
||||||
|
, "rm -rf /dev"
|
||||||
, "mkdir /dev"
|
, "mkdir /dev"
|
||||||
, "cd /dev"
|
, "cd /dev"
|
||||||
, "/sbin/MAKEDEV std ptmx fd consoleonly"
|
, "/sbin/MAKEDEV std ptmx fd consoleonly"
|
||||||
|
|
|
@ -377,7 +377,7 @@ runningContainer cid@(ContainerId hn cn) image runps = containerDesc cid $ prope
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
clearProvisionedFlag cid
|
clearProvisionedFlag cid
|
||||||
createDirectoryIfMissing True (takeDirectory $ identFile cid)
|
createDirectoryIfMissing True (takeDirectory $ identFile cid)
|
||||||
shim <- liftIO $ Shim.setup (localdir </> "propellor") (localdir </> shimdir cid)
|
shim <- liftIO $ Shim.setup (localdir </> "propellor") Nothing (localdir </> shimdir cid)
|
||||||
liftIO $ writeFile (identFile cid) (show ident)
|
liftIO $ writeFile (identFile cid) (show ident)
|
||||||
ensureProperty $ boolProperty "run" $ runContainer img
|
ensureProperty $ boolProperty "run" $ runContainer img
|
||||||
(runps ++ ["-i", "-d", "-t"])
|
(runps ++ ["-i", "-d", "-t"])
|
||||||
|
|
|
@ -21,8 +21,8 @@ import System.Posix.Files
|
||||||
--
|
--
|
||||||
-- Propellor may be running from an existing shim, in which case it's
|
-- Propellor may be running from an existing shim, in which case it's
|
||||||
-- simply reused.
|
-- simply reused.
|
||||||
setup :: FilePath -> FilePath -> IO FilePath
|
setup :: FilePath -> Maybe FilePath -> FilePath -> IO FilePath
|
||||||
setup propellorbin dest = checkAlreadyShimmed propellorbin $ do
|
setup propellorbin propellorbinpath dest = checkAlreadyShimmed propellorbin $ do
|
||||||
createDirectoryIfMissing True dest
|
createDirectoryIfMissing True dest
|
||||||
|
|
||||||
libs <- parseLdd <$> readProcess "ldd" [propellorbin]
|
libs <- parseLdd <$> readProcess "ldd" [propellorbin]
|
||||||
|
@ -44,7 +44,7 @@ setup propellorbin dest = checkAlreadyShimmed propellorbin $ do
|
||||||
, "GCONV_PATH=" ++ shellEscape gconvdir
|
, "GCONV_PATH=" ++ shellEscape gconvdir
|
||||||
, "export GCONV_PATH"
|
, "export GCONV_PATH"
|
||||||
, "exec " ++ unwords (map shellEscape $ linker : linkerparams) ++
|
, "exec " ++ unwords (map shellEscape $ linker : linkerparams) ++
|
||||||
" " ++ shellEscape propellorbin ++ " \"$@\""
|
" " ++ shellEscape (fromMaybe propellorbin propellorbinpath) ++ " \"$@\""
|
||||||
]
|
]
|
||||||
modifyFileMode shim (addModes executeModes)
|
modifyFileMode shim (addModes executeModes)
|
||||||
return shim
|
return shim
|
||||||
|
|
|
@ -224,7 +224,7 @@ sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor
|
||||||
createDirectoryIfMissing True "bin"
|
createDirectoryIfMissing True "bin"
|
||||||
unlessM (boolSystem "cp" [File me, File "bin/propellor"]) $
|
unlessM (boolSystem "cp" [File me, File "bin/propellor"]) $
|
||||||
errorMessage "failed copying in propellor"
|
errorMessage "failed copying in propellor"
|
||||||
void $ Shim.setup "bin/propellor" "."
|
void $ Shim.setup "bin/propellor" (localdir </> "bin/propellor") "."
|
||||||
changeWorkingDirectory tmpdir
|
changeWorkingDirectory tmpdir
|
||||||
withTmpFile "propellor.tar." $ \tarball _ -> allM id
|
withTmpFile "propellor.tar." $ \tarball _ -> allM id
|
||||||
[ boolSystem "strip" [File me]
|
[ boolSystem "strip" [File me]
|
||||||
|
|
Loading…
Reference in New Issue