Safe Haskell | None |
---|---|
Language | Haskell98 |
Disk image partition specification and combinators.
- type PartSpec = (Maybe MountPoint, MountOpts, PartSize -> Partition)
- defSz :: PartSize
- fudge :: PartSize -> PartSize
- swapPartition :: PartSize -> PartSpec
- partition :: Fs -> PartSpec
- mountedAt :: PartSpec -> FilePath -> PartSpec
- mountOpt :: ToMountOpts o => PartSpec -> o -> PartSpec
- errorReadonly :: MountOpts
- addFreeSpace :: PartSpec -> PartSize -> PartSpec
- setSize :: PartSpec -> PartSize -> PartSpec
- reservedSpacePercentage :: PartSpec -> Int -> PartSpec
- setFlag :: PartSpec -> PartFlag -> PartSpec
- extended :: PartSpec -> PartSpec
- adjustp :: PartSpec -> (Partition -> Partition) -> PartSpec
- data Partition
- newtype PartSize = MegaBytes Integer
- data PartFlag
- data TableType
- data Fs
- type MountPoint = FilePath
Documentation
type PartSpec = (Maybe MountPoint, MountOpts, PartSize -> Partition) Source #
Specifies a mount point, mount options, and a constructor for a Partition.
The size that is eventually provided is the amount of space needed to hold the files that appear in the directory where the partition is to be mounted. Plus a fudge factor, since filesystems have some space overhead.
Partitions that are not to be mounted (ie, LinuxSwap), or that have no corresponding directory in the chroot will have 128 MegaBytes provided as a default size.
fudge :: PartSize -> PartSize Source #
Add 2% for filesystem overhead. Rationalle for picking 2%: A filesystem with 1% overhead might just sneak by as acceptable. Double that just in case. Add an additional 3 mb to deal with non-scaling overhead of filesystems (eg, superblocks). Add an additional 200 mb for temp files, journals, etc.
swapPartition :: PartSize -> PartSpec Source #
Specifies a swap partition of a given size.
partition :: Fs -> PartSpec Source #
Specifies a partition with a given filesystem.
The partition is not mounted anywhere by default; use the combinators below to configure it.
mountOpt :: ToMountOpts o => PartSpec -> o -> PartSpec Source #
Specifies a mount option, such as "noexec"
errorReadonly :: MountOpts Source #
Mount option to make a partition be remounted readonly when there's an error accessing it.
addFreeSpace :: PartSpec -> PartSize -> PartSpec Source #
Adds additional free space to the partition.
setSize :: PartSpec -> PartSize -> PartSpec Source #
Forced a partition to be a specific size, instead of scaling to the size needed for the files in the chroot.
reservedSpacePercentage :: PartSpec -> Int -> PartSpec Source #
Sets the percent of the filesystem blocks reserved for the super-user.
The default is 5% for ext2 and ext4. Some filesystems may not support this.
All partition sizing is done in megabytes, so that parted can automatically lay out the partitions.
Note that these are SI megabytes, not mebibytes.
Flags that can be set on a partition.
Types of partition tables supported by parted.
Filesystems etc that can be used for a partition.
type MountPoint = FilePath Source #
A mount point for a filesystem.