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. --- debian/changelog | 1 + src/Propellor/Property/DiskImage/PartSpec.hs | 8 ++++++++ 2 files changed, 9 insertions(+) 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 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 } -- cgit v1.2.3