propellor-5.10.1: property-based host configuration management in haskell

Safe Haskell | None
Language | Haskell98

Propellor.Property.Parted.Types

Synopsis

- class PartedVal a where
  - pval :: a -> String
- data TableType
  - = MSDOS
  - | GPT
  - | AIX
  - | AMIGA
  - | BSD
  - | DVH
  - | LOOP
  - | MAC
  - | PC98
  - | SUN
- data PartTable = PartTable TableType Alignment [Partition]
- data Partition = Partition {
  - partType :: PartType
  - partSize :: PartSize
  - partFs :: Maybe Fs
  - partMkFsOpts :: MkfsOpts
  - partFlags :: [(PartFlag, Bool)]
  - partName :: Maybe String
  }
- mkPartition :: Maybe Fs -> PartSize -> Partition
- data PartType
  - = Primary
  - | Logical
  - | Extended
- data PartSize
  - = MegaBytes Integer
  - | Bytes Integer
- toPartSize :: ByteSize -> PartSize
- toPartSize' :: (Double -> Integer) -> ByteSize -> PartSize
- fromPartSize :: PartSize -> ByteSize
- reducePartSize :: PartSize -> PartSize -> PartSize
- newtype Alignment = Alignment ByteSize
- safeAlignment :: Alignment
- fromAlignment :: Alignment -> ByteSize
- data PartFlag
  - = BootFlag
  - | RootFlag
  - | SwapFlag
  - | HiddenFlag
  - | RaidFlag
  - | LvmFlag
  - | LbaFlag
  - | LegacyBootFlag
  - | IrstFlag
  - | EspFlag
  - | PaloFlag
  - | BiosGrubFlag

# Documentation

class PartedVal a where Source #

Methods

pval :: a -> String Source #

Instances

PartedVal Bool Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: Bool -> String Source #
PartedVal Fs Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: Fs -> String Source #
PartedVal PartFlag Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: PartFlag -> String Source #
PartedVal PartType Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: PartType -> String Source #
PartedVal TableType Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: TableType -> String Source #

data TableType Source #

Types of partition tables supported by parted.

Constructors

MSDOS |
GPT |
AIX |
AMIGA |
BSD |
DVH |
LOOP |
MAC |
PC98 |
SUN |

Instances

Show TableType Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods showsPrec :: Int -> TableType -> ShowS show :: TableType -> String showList :: [TableType] -> ShowS
PartedVal TableType Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: TableType -> String Source #

data PartTable Source #

A disk's partition table.

Constructors

PartTable TableType Alignment [Partition] |

Instances

Show PartTable Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods showsPrec :: Int -> PartTable -> ShowS show :: PartTable -> String showList :: [PartTable] -> ShowS
Semigroup PartTable Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods (<>) :: PartTable -> PartTable -> PartTable # sconcat :: NonEmpty PartTable -> PartTable stimes :: Integral b => b -> PartTable -> PartTable
Monoid PartTable Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods mempty :: PartTable # mappend :: PartTable -> PartTable -> PartTable # mconcat :: [PartTable] -> PartTable #

data Partition Source #

A partition on the disk.

Constructors

Partition |

Fields

- partType :: PartType
- partSize :: PartSize
- partFs :: Maybe Fs
- partMkFsOpts :: 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)

Instances

Show Partition Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods showsPrec :: Int -> Partition -> ShowS show :: Partition -> String showList :: [Partition] -> ShowS

mkPartition :: Maybe Fs -> PartSize -> Partition Source #

Makes a Partition with defaults for non-important values.

data PartType Source #

Type of a partition.

Constructors

Primary |
Logical |
Extended |

Instances

Show PartType Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods showsPrec :: Int -> PartType -> ShowS show :: PartType -> String showList :: [PartType] -> ShowS
PartedVal PartType Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: PartType -> String Source #

data PartSize Source #

Size of a partition.

Constructors

MegaBytes Integer |
Bytes Integer |

Instances

Show PartSize Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods showsPrec :: Int -> PartSize -> ShowS show :: PartSize -> String showList :: [PartSize] -> ShowS
Semigroup PartSize Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods (<>) :: PartSize -> PartSize -> PartSize # sconcat :: NonEmpty PartSize -> PartSize stimes :: Integral b => b -> PartSize -> PartSize
Monoid PartSize Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods mempty :: PartSize # mappend :: PartSize -> PartSize -> PartSize # mconcat :: [PartSize] -> PartSize #

toPartSize :: ByteSize -> PartSize Source #

Rounds up to the nearest MegaByte.

toPartSize' :: (Double -> Integer) -> ByteSize -> PartSize Source #

fromPartSize :: PartSize -> ByteSize Source #

reducePartSize :: PartSize -> PartSize -> PartSize Source #

newtype Alignment Source #

Partitions need to be aligned for optimal efficiency. The alignment is a number of bytes.

Constructors

Alignment ByteSize |

Instances

Eq Alignment Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods (==) :: Alignment -> Alignment -> Bool (/=) :: Alignment -> Alignment -> Bool
Ord Alignment Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods compare :: Alignment -> Alignment -> Ordering (<) :: Alignment -> Alignment -> Bool (<=) :: Alignment -> Alignment -> Bool (>) :: Alignment -> Alignment -> Bool (>=) :: Alignment -> Alignment -> Bool max :: Alignment -> Alignment -> Alignment min :: Alignment -> Alignment -> Alignment
Show Alignment Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods showsPrec :: Int -> Alignment -> ShowS show :: Alignment -> String showList :: [Alignment] -> ShowS

safeAlignment :: Alignment Source #

4MiB alignment is optimal for inexpensive flash drives and is a good safe default for all drives.

fromAlignment :: Alignment -> ByteSize Source #

data PartFlag Source #

Flags that can be set on a partition.

Constructors

BootFlag |
RootFlag |
SwapFlag |
HiddenFlag |
RaidFlag |
LvmFlag |
LbaFlag |
LegacyBootFlag |
IrstFlag |
EspFlag |
PaloFlag |
BiosGrubFlag |

Instances

Show PartFlag Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods showsPrec :: Int -> PartFlag -> ShowS show :: PartFlag -> String showList :: [PartFlag] -> ShowS
PartedVal PartFlag Source # |
Instance details Defined in Propellor.Property.Parted.Types Methods pval :: PartFlag -> String Source #