summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorSean Whitton2016-09-05 11:27:41 -0700
committerSean Whitton2016-09-05 11:34:51 -0700
commit695f3f1aa70468671dc09894324d92f23d5283ae (patch)
tree8a6083cd69dde5d929d52ebe4644ceb98349153d /src/Propellor
parent172a5c2003001e81d101904df465d65bde9357c8 (diff)
schroot config additions now ensured on each spin
Previously, they were only ensured when first building the schroot.
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/Sbuild.hs21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs
index d385b2a6..c05f47e7 100644
--- a/src/Propellor/Property/Sbuild.hs
+++ b/src/Propellor/Property/Sbuild.hs
@@ -136,7 +136,7 @@ builtFor sys = go <!> deleted
-- | Build and configure a schroot for use with sbuild
built :: SbuildSchroot -> Apt.Url -> RevertableProperty DebianLike UnixLike
built s@(SbuildSchroot suite arch) mirror =
- (go
+ ((go `before` enhancedConf)
`requires` ccachePrepared
`requires` installed
`requires` overlaysKernel)
@@ -157,10 +157,7 @@ built s@(SbuildSchroot suite arch) mirror =
]
ifM (liftIO $
boolSystemEnv "sbuild-createchroot" params (Just de))
- ( ensureProperty w $
- fixConfFile s
- `before` aliasesLine
- `before` commandPrefix
+ ( ensureProperty w $ fixConfFile s
, return FailedChange
)
-- TODO we should kill any sessions still using the chroot
@@ -172,6 +169,16 @@ built s@(SbuildSchroot suite arch) mirror =
("/etc/sbuild/chroot" </> show s ++ "-sbuild")
makeChange $ nukeFile (schrootConf s)
+ enhancedConf =
+ combineProperties ("enhanced schroot conf for " ++ show s) $ props
+ & aliasesLine
+ -- enable ccache and eatmydata for speed
+ & ConfFile.containsIniSetting (schrootConf s)
+ [ show s ++ "-sbuild"
+ , "command-prefix"
+ , "/var/cache/ccache-sbuild/sbuild-setup,eatmydata"
+ ]
+
-- if we're building a sid chroot, add useful aliases
-- In order to avoid more than one schroot getting the same aliases, we
-- only do this if the arch of the chroot equals the host arch.
@@ -186,10 +193,6 @@ built s@(SbuildSchroot suite arch) mirror =
schrootConf s `File.containsLine` aliases
else return NoChange
- -- enable ccache and eatmydata for speed
- commandPrefix = File.containsLine (schrootConf s)
- "command-prefix=/var/cache/ccache-sbuild/sbuild-setup,eatmydata"
-
-- If the user has indicated that this host should use
-- union-type=overlay schroots, we need to ensure that we have rebooted
-- to a kernel supporting OverlayFS before we execute