From bc6045c8b5333ac5d407e8f4b96bb0d9f50dfa9a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 6 Jan 2018 14:48:34 -0400 Subject: changes to allow GPT BIOS boot partitions * Parted: Allow partitions to have no filesystem, for eg, GPT BIOS boot partitions. (API change) * Added rawPartition to PartSpec, for specifying partitions with no filesystem. * Added BiosGrubFlag to PartFlag. Note that man parted does not list the "bios_boot" flag, but I found it in its html documentation. Other flags may also be missing. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon. --- src/Propellor/Property/DiskImage/PartSpec.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/DiskImage') diff --git a/src/Propellor/Property/DiskImage/PartSpec.hs b/src/Propellor/Property/DiskImage/PartSpec.hs index 942cfa3e..b78e4280 100644 --- a/src/Propellor/Property/DiskImage/PartSpec.hs +++ b/src/Propellor/Property/DiskImage/PartSpec.hs @@ -9,6 +9,7 @@ module Propellor.Property.DiskImage.PartSpec ( partition, -- * PartSpec combinators swapPartition, + rawPartition, mountedAt, addFreeSpace, setSize, @@ -48,11 +49,15 @@ import Data.Ord -- The partition is not mounted anywhere by default; use the combinators -- below to configure it. partition :: Monoid t => Fs -> PartSpec t -partition fs = (Nothing, mempty, mkPartition fs, mempty) +partition fs = (Nothing, mempty, mkPartition (Just fs), mempty) -- | Specifies a swap partition of a given size. swapPartition :: Monoid t => PartSize -> PartSpec t -swapPartition sz = (Nothing, mempty, const (mkPartition LinuxSwap sz), mempty) +swapPartition sz = (Nothing, mempty, const (mkPartition (Just LinuxSwap) sz), mempty) + +-- | Specifies a partition without any filesystem, of a given size. +rawPartition :: Monoid t => PartSize -> PartSpec t +rawPartition sz = (Nothing, mempty, const (mkPartition Nothing sz), mempty) -- | Specifies where to mount a partition. mountedAt :: PartSpec t -> MountPoint -> PartSpec t -- cgit v1.2.3