diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-06-10 15:21:47 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-06-10 15:21:47 +0900 |
commit | 19b3eb8ff90092748d8718d751d5fd6865b6e7cd (patch) | |
tree | 466321e4bf273a01439adda82de94f070b1c329d /src/Propellor/Property/Schroot.hs | |
parent | de50503e4dbdea853e899f01e8828cf4f454dd57 (diff) | |
parent | 2cdc8a2eb9a3cf87c3f5ac09ee8c00931a666997 (diff) |
Record propellor (3.0.5-1) in archive suite sid
Diffstat (limited to 'src/Propellor/Property/Schroot.hs')
-rw-r--r-- | src/Propellor/Property/Schroot.hs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Propellor/Property/Schroot.hs b/src/Propellor/Property/Schroot.hs new file mode 100644 index 00000000..c53ce4f1 --- /dev/null +++ b/src/Propellor/Property/Schroot.hs @@ -0,0 +1,42 @@ +-- | Maintainer: Sean Whitton <spwhitton@spwhitton.name> + +module Propellor.Property.Schroot where + +import Propellor.Base +import qualified Propellor.Property.File as File +import qualified Propellor.Property.Apt as Apt + +import Utility.FileMode + +-- | Configure schroot such that all schroots with @union-type=overlay@ in their +-- configuration will run their overlays in a tmpfs. +-- +-- Shell script from <https://wiki.debian.org/sbuild>. +overlaysInTmpfs :: Property DebianLike +overlaysInTmpfs = go `requires` installed + where + f = "/etc/schroot/setup.d/04tmpfs" + go :: Property UnixLike + go = f `File.hasContent` + [ "#!/bin/sh" + , "" + , "set -e" + , "" + , ". \"$SETUP_DATA_DIR/common-data\"" + , ". \"$SETUP_DATA_DIR/common-functions\"" + , ". \"$SETUP_DATA_DIR/common-config\"" + , "" + , "" + , "if [ $STAGE = \"setup-start\" ]; then" + , " mount -t tmpfs overlay /var/lib/schroot/union/overlay" + , "elif [ $STAGE = \"setup-recover\" ]; then" + , " mount -t tmpfs overlay /var/lib/schroot/union/overlay" + , "elif [ $STAGE = \"setup-stop\" ]; then" + , " umount -f /var/lib/schroot/union/overlay" + , "fi" + ] + `onChange` (f `File.mode` (combineModes (readModes ++ executeModes))) + `describe` "schroot overlays in tmpfs" + +installed :: Property DebianLike +installed = Apt.installed ["schroot"] |