From c240cc8c338570eb165681e7be39e31f67e6b158 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 29 Nov 2017 11:23:10 -0400 Subject: bug --- doc/todo/privdata_propigation_into_diskimages.mdwn | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/todo/privdata_propigation_into_diskimages.mdwn (limited to 'doc') diff --git a/doc/todo/privdata_propigation_into_diskimages.mdwn b/doc/todo/privdata_propigation_into_diskimages.mdwn new file mode 100644 index 00000000..1ffd26d0 --- /dev/null +++ b/doc/todo/privdata_propigation_into_diskimages.mdwn @@ -0,0 +1,4 @@ +When building a disk image with propellor bootstrapped in it, the decrypted +privdata file is not written, so propellor can't be run on the booted +system without first doing a propellor --spin from the dev laptop. Not a +big problem but worth fixing some time. --[[Joey]] -- cgit v1.3-2-g0d8e From c485aba3663333b5518c86b68b12d92ed51def01 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 29 Nov 2017 11:53:58 -0400 Subject: bootstrappedFrom: Set up local privdata file. Avoid needing to --spin host deployed from disk image to let its propellor access its privdata. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon. --- config.hs | 2 +- debian/changelog | 6 ++++++ doc/todo/privdata_propigation_into_diskimages.mdwn | 2 ++ privdata/relocate | 1 + src/Propellor/Property/Bootstrap.hs | 14 +++++++++++++- 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 privdata/relocate (limited to 'doc') diff --git a/config.hs b/config.hs index ec313725..97d90636 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -config-simple.hs \ No newline at end of file +joeyconfig.hs \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index ef3e66ac..b738f874 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (5.1.1) UNRELEASED; urgency=medium + + * bootstrappedFrom: Set up local privdata file. + + -- Joey Hess Wed, 29 Nov 2017 11:45:08 -0400 + propellor (5.1.0) unstable; urgency=medium [ Sean Whitton ] diff --git a/doc/todo/privdata_propigation_into_diskimages.mdwn b/doc/todo/privdata_propigation_into_diskimages.mdwn index 1ffd26d0..80a42d23 100644 --- a/doc/todo/privdata_propigation_into_diskimages.mdwn +++ b/doc/todo/privdata_propigation_into_diskimages.mdwn @@ -2,3 +2,5 @@ When building a disk image with propellor bootstrapped in it, the decrypted privdata file is not written, so propellor can't be run on the booted system without first doing a propellor --spin from the dev laptop. Not a big problem but worth fixing some time. --[[Joey]] + +> [[fixed|done]] --[[Joey]] diff --git a/privdata/relocate b/privdata/relocate new file mode 100644 index 00000000..271692d8 --- /dev/null +++ b/privdata/relocate @@ -0,0 +1 @@ +.joeyconfig 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 -- cgit v1.3-2-g0d8e