summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Parted
diff options
context:
space:
mode:
authorJoey Hess2018-01-06 14:48:34 -0400
committerJoey Hess2018-01-06 14:48:34 -0400
commitbc6045c8b5333ac5d407e8f4b96bb0d9f50dfa9a (patch)
tree303bf5f1e584e58a31bfb45f6b8c714b2e3d622e /src/Propellor/Property/Parted
parent48196467d11a856f411208ba5eadb20dd9455c10 (diff)
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.
Diffstat (limited to 'src/Propellor/Property/Parted')
-rw-r--r--src/Propellor/Property/Parted/Types.hs7
1 files changed, 4 insertions, 3 deletions
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"