diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-12-03 14:23:22 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-12-03 14:23:22 -0400 |
| commit | d6cbcbecdf58910002744deb9cf31cd14af06ead (patch) | |
| tree | c194e6151a1f78663de9946b4b6a3ec8e32e738d /src/Propellor/Property/Bootstrap.hs | |
| parent | bf492dc0c78c6d2405ed592fbf20004a3a2c92a5 (diff) | |
| parent | 2476617d9c0c90fc017bedadd4993ad46d2c3ae6 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/Bootstrap.hs')
| -rw-r--r-- | src/Propellor/Property/Bootstrap.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Propellor/Property/Bootstrap.hs b/src/Propellor/Property/Bootstrap.hs index f0759dae..25a6af33 100644 --- a/src/Propellor/Property/Bootstrap.hs +++ b/src/Propellor/Property/Bootstrap.hs @@ -14,6 +14,8 @@ import Propellor.Base import Propellor.Bootstrap import Propellor.Types.Info import Propellor.Property.Chroot +import Propellor.PrivData.Paths +import Utility.FileMode import Data.List import qualified Data.ByteString as B @@ -63,8 +65,18 @@ bootstrappedFrom reposource = check inChroot $ go :: Property Linux go = property "Propellor bootstrapped" $ do system <- getOS + -- gets Host value representing the chroot this is run in + chroothost <- ask + -- load privdata from outside the chroot, and filter + -- to only the privdata needed inside the chroot. + privdata <- liftIO $ filterPrivData chroothost + <$> readPrivDataFile privDataLocal bootstrapper <- getBootstrapper - assumeChange $ exposeTrueLocaldir $ const $ + assumeChange $ exposeTrueLocaldir $ const $ do + liftIO $ createDirectoryIfMissing True $ + takeDirectory privDataLocal + liftIO $ writeFileProtected privDataLocal $ + show privdata runShellCommand $ buildShellCommand [ "cd " ++ localdir , checkDepsCommand bootstrapper system |
