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/Types.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property/Parted') diff --git a/src/Propellor/Property/Parted/Types.hs b/src/Propellor/Property/Parted/Types.hs index e5c62739..cfd8760d 100644 --- a/src/Propellor/Property/Parted/Types.hs +++ b/src/Propellor/Property/Parted/Types.hs @@ -31,7 +31,7 @@ instance Monoid PartTable where data Partition = Partition { partType :: PartType , partSize :: PartSize - , partFs :: Partition.Fs + , partFs :: Maybe Partition.Fs , partMkFsOpts :: Partition.MkfsOpts , partFlags :: [(PartFlag, Bool)] -- ^ flags can be set or unset (parted may set some flags by default) , partName :: Maybe String -- ^ optional name for partition (only works for GPT, PC98, MAC) @@ -39,7 +39,7 @@ data Partition = Partition deriving (Show) -- | Makes a Partition with defaults for non-important values. -mkPartition :: Partition.Fs -> PartSize -> Partition +mkPartition :: Maybe Partition.Fs -> PartSize -> Partition mkPartition fs sz = Partition { partType = Primary , partSize = sz @@ -105,7 +105,7 @@ fromAlignment :: Alignment -> ByteSize fromAlignment (Alignment n) = n -- | Flags that can be set on a partition. -data PartFlag = BootFlag | RootFlag | SwapFlag | HiddenFlag | RaidFlag | LvmFlag | LbaFlag | LegacyBootFlag | IrstFlag | EspFlag | PaloFlag +data PartFlag = BootFlag | RootFlag | SwapFlag | HiddenFlag | RaidFlag | LvmFlag | LbaFlag | LegacyBootFlag | IrstFlag | EspFlag | PaloFlag | BiosGrubFlag deriving (Show) instance PartedVal PartFlag where @@ -120,6 +120,7 @@ instance PartedVal PartFlag where pval IrstFlag = "irst" pval EspFlag = "esp" pval PaloFlag = "palo" + pval BiosGrubFlag = "bios_grub" instance PartedVal Bool where pval True = "on" -- cgit v1.2.3