diff options
| -rw-r--r-- | debian/changelog | 1 | ||||
| -rw-r--r-- | src/Propellor/Property/DiskImage/PartSpec.hs | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 8361403a..24552b21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ propellor (4.3.1) UNRELEASED; urgency=medium * Added Propellor.Property.FreeDesktop module. + * Added reservedSpacePercentage to the PartSpec EDSL. -- Joey Hess <id@joeyh.name> Wed, 05 Jul 2017 22:57:42 -0400 diff --git a/src/Propellor/Property/DiskImage/PartSpec.hs b/src/Propellor/Property/DiskImage/PartSpec.hs index 4b05df03..2b14baa0 100644 --- a/src/Propellor/Property/DiskImage/PartSpec.hs +++ b/src/Propellor/Property/DiskImage/PartSpec.hs @@ -69,6 +69,14 @@ addFreeSpace (mp, o, p) freesz = (mp, o, \sz -> p (sz <> freesz)) setSize :: PartSpec -> PartSize -> PartSpec setSize (mp, o, p) sz = (mp, o, const (p sz)) +-- | Sets the percent of the filesystem blocks reserved for the super-user. +-- +-- The default is 5% for ext2 and ext4. Some filesystems may not support +-- this. +reservedSpacePercentage :: PartSpec -> Int -> PartSpec +reservedSpacePercentage s percent = adjustp s $ \p -> + p { partMkFsOpts = ("-m"):show percent:partMkFsOpts p } + -- | Sets a flag on the partition. setFlag :: PartSpec -> PartFlag -> PartSpec setFlag s f = adjustp s $ \p -> p { partFlags = (f, True):partFlags p } |
