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

Safe Haskell | None
Language | Haskell98

Propellor.Property.Partition

Synopsis

- data Fs
  - = EXT2
  - | EXT3
  - | EXT4
  - | BTRFS
  - | REISERFS
  - | XFS
  - | FAT
  - | VFAT
  - | NTFS
  - | LinuxSwap
- parseFs :: String -> Maybe Fs
- data Eep = YesReallyFormatPartition
- formatted :: Eep -> Fs -> FilePath -> Property DebianLike
- type MkfsOpts = [String]
- formatted' :: MkfsOpts -> Eep -> Fs -> FilePath -> Property DebianLike
- data LoopDev = LoopDev {
  - partitionLoopDev :: FilePath
  - wholeDiskLoopDev :: FilePath
  }
- isLoopDev :: LoopDev -> IO Bool
- isLoopDev' :: FilePath -> IO Bool
- kpartx :: FilePath -> ([LoopDev] -> Property DebianLike) -> Property DebianLike
- kpartxParse :: String -> [LoopDev]

# Documentation

data Fs Source #

Filesystems etc that can be used for a partition.

Constructors

EXT2 |
EXT3 |
EXT4 |
BTRFS |
REISERFS |
XFS |
FAT |
VFAT |
NTFS |
LinuxSwap |

Instances

Eq Fs Source # |
Methods (==) :: Fs -> Fs -> Bool (/=) :: Fs -> Fs -> Bool
Show Fs Source # |
Methods showsPrec :: Int -> Fs -> ShowS show :: Fs -> String showList :: [Fs] -> ShowS
PartedVal Fs Source # |
Methods pval :: Fs -> String Source #

parseFs :: String -> Maybe Fs Source #

Parse commonly used names of filesystems.

data Eep Source #

Constructors

YesReallyFormatPartition |

formatted :: Eep -> Fs -> FilePath -> Property DebianLike Source #

Formats a partition.

type MkfsOpts = [String] Source #

Options passed to a mkfs.* command when making a filesystem.

Eg, ["-m0"]

formatted' :: MkfsOpts -> Eep -> Fs -> FilePath -> Property DebianLike Source #

data LoopDev Source #

Constructors

LoopDev |

Fields

- partitionLoopDev :: FilePath

  device for a loop partition

- wholeDiskLoopDev :: FilePath

  corresponding device for the whole loop disk

Instances

Show LoopDev Source # |
Methods showsPrec :: Int -> LoopDev -> ShowS show :: LoopDev -> String showList :: [LoopDev] -> ShowS

isLoopDev :: LoopDev -> IO Bool Source #

isLoopDev' :: FilePath -> IO Bool Source #

kpartx :: FilePath -> ([LoopDev] -> Property DebianLike) -> Property DebianLike Source #

Uses the kpartx utility to create device maps for partitions contained within a disk image file. The resulting loop devices are passed to the property, which can operate on them. Always cleans up after itself, by removing the device maps after the property is run.

kpartxParse :: String -> [LoopDev] Source #