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/Parted.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/Propellor/Property/Parted.hs') diff --git a/src/Propellor/Property/Parted.hs b/src/Propellor/Property/Parted.hs index 97cf815e..81b84972 100644 --- a/src/Propellor/Property/Parted.hs +++ b/src/Propellor/Property/Parted.hs @@ -62,8 +62,10 @@ partitioned eep disk parttable@(PartTable _ _ parts) = property' desc $ \w -> do where desc = disk ++ " partitioned" formatl devs = combineProperties desc (toProps $ map format (zip parts devs)) - format (p, dev) = Partition.formatted' (partMkFsOpts p) - Partition.YesReallyFormatPartition (partFs p) dev + format (p, dev) = case partFs p of + Just fs -> Partition.formatted' (partMkFsOpts p) + Partition.YesReallyFormatPartition fs dev + Nothing -> doNothing -- | Gets the total size of the disk specified by the partition table. partTableSize :: PartTable -> ByteSize @@ -81,12 +83,12 @@ calcPartedParamsSize (PartTable tabletype alignment parts) = , pval f , pval b ] - mkpart partnum startpos endpos p = - [ "mkpart" - , pval (partType p) - , pval (partFs p) - , partposexact startpos - , partposfuzzy endpos + mkpart partnum startpos endpos p = catMaybes + [ Just "mkpart" + , Just $ pval (partType p) + , fmap pval (partFs p) + , Just $ partposexact startpos + , Just $ partposfuzzy endpos ] ++ case partName p of Just n -> ["name", show partnum, n] Nothing -> [] -- cgit v1.2.3