From 7776dd215ec165576c67f39741688e79c7c7e11c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Jul 2017 17:02:17 -0400 Subject: Added reservedSpacePercentage to the PartSpec EDSL. --- src/Propellor/Property/DiskImage/PartSpec.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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 } -- cgit v1.2.3