Safe Haskell | None |
---|---|
Language | Haskell98 |
- type FsType = String
- type Source = String
- type MountPoint = FilePath
- newtype MountOpts = MountOpts [String]
- mounted :: FsType -> Source -> MountPoint -> MountOpts -> Property Linux
- newtype SwapPartition = SwapPartition FilePath
- fstabbed :: [MountPoint] -> [SwapPartition] -> Property Linux
- genFstab :: [MountPoint] -> [SwapPartition] -> (MountPoint -> MountPoint) -> IO [String]
- noFstab :: IO Bool
Documentation
type MountPoint = FilePath Source
A mount point for a filesystem.
Filesystem mount options. Eg, MountOpts ["errors=remount-ro"]
For default mount options, use mempty
.
mounted :: FsType -> Source -> MountPoint -> MountOpts -> Property Linux Source
Ensures that /etc/fstab contains a line mounting the specified
Source
on the specified MountPoint
, and that it's currently mounted.
For example:
mounted "auto" "/dev/sdb1" "/srv" mempty
Note that if anything else is already mounted at the MountPoint
, it
will be left as-is by this property.
newtype SwapPartition Source
fstabbed :: [MountPoint] -> [SwapPartition] -> Property Linux Source
Replaces /etc/fstab with a file that should cause the currently mounted partitions to be re-mounted the same way on boot.
For each specified MountPoint, the UUID of each partition (or if there is no UUID, its label), its filesystem type, and its mount options are all automatically probed.
The SwapPartitions are also included in the generated fstab.
genFstab :: [MountPoint] -> [SwapPartition] -> (MountPoint -> MountPoint) -> IO [String] Source
Checks if /etc/fstab is not configured. This is the case if it doesn't exist, or consists entirely of blank lines or comments.
So, if you want to only replace the fstab once, and then never touch it again, allowing local modifications:
check noFstab (fstabbed mnts [])