b9-1.0.1: A tool and library for building virtual machine images.

Safe HaskellNone
LanguageHaskell2010

B9.DiskImages

Contents

Description

Data types that describe all B9 relevant elements of virtual machine disk images.

Synopsis

Data types for disk image description, e.g. ImageTarget,

data ImageTarget Source #

Build target for disk images; the destination, format and size of the image to generate, as well as how to create or obtain the image before a VmScript is executed with the image mounted at a MountPoint.

Instances
Eq ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Data ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImageTarget -> c ImageTarget #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ImageTarget #

toConstr :: ImageTarget -> Constr #

dataTypeOf :: ImageTarget -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ImageTarget) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ImageTarget) #

gmapT :: (forall b. Data b => b -> b) -> ImageTarget -> ImageTarget #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImageTarget -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImageTarget -> r #

gmapQ :: (forall d. Data d => d -> u) -> ImageTarget -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageTarget -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImageTarget -> m ImageTarget #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageTarget -> m ImageTarget #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageTarget -> m ImageTarget #

Read ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Show ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Generic ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep ImageTarget :: Type -> Type #

Arbitrary ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Hashable ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Binary ImageTarget Source # 
Instance details

Defined in B9.DiskImages

NFData ImageTarget Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: ImageTarget -> () #

type Rep ImageTarget Source # 
Instance details

Defined in B9.DiskImages

data MountPoint Source #

A mount point or NotMounted

Instances
Eq MountPoint Source # 
Instance details

Defined in B9.DiskImages

Data MountPoint Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MountPoint -> c MountPoint #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MountPoint #

toConstr :: MountPoint -> Constr #

dataTypeOf :: MountPoint -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MountPoint) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MountPoint) #

gmapT :: (forall b. Data b => b -> b) -> MountPoint -> MountPoint #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MountPoint -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MountPoint -> r #

gmapQ :: (forall d. Data d => d -> u) -> MountPoint -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MountPoint -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MountPoint -> m MountPoint #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MountPoint -> m MountPoint #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MountPoint -> m MountPoint #

Read MountPoint Source # 
Instance details

Defined in B9.DiskImages

Show MountPoint Source # 
Instance details

Defined in B9.DiskImages

Generic MountPoint Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep MountPoint :: Type -> Type #

Arbitrary MountPoint Source # 
Instance details

Defined in B9.DiskImages

Hashable MountPoint Source # 
Instance details

Defined in B9.DiskImages

Binary MountPoint Source # 
Instance details

Defined in B9.DiskImages

NFData MountPoint Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: MountPoint -> () #

type Rep MountPoint Source # 
Instance details

Defined in B9.DiskImages

type Rep MountPoint = D1 (MetaData "MountPoint" "B9.DiskImages" "b9-1.0.1-inplace" False) (C1 (MetaCons "MountPoint" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)) :+: C1 (MetaCons "NotMounted" PrefixI False) (U1 :: Type -> Type))

data ImageDestination Source #

The destination of an image.

Constructors

Share String ImageType ImageResize

Create the image and some meta data so that other builds can use them as ImageSources via From.

LiveInstallerImage String FilePath ImageResize

DEPRECATED Export a raw image that can directly be booted.

LocalFile Image ImageResize

Write an image file to the path in the first argument., possible resizing it,

Transient

Do not export the image. Usefule if the main objective of the b9 build is not an image file, but rather some artifact produced by executing by a containerize build.

Instances
Eq ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Data ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImageDestination -> c ImageDestination #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ImageDestination #

toConstr :: ImageDestination -> Constr #

dataTypeOf :: ImageDestination -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ImageDestination) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ImageDestination) #

gmapT :: (forall b. Data b => b -> b) -> ImageDestination -> ImageDestination #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImageDestination -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImageDestination -> r #

gmapQ :: (forall d. Data d => d -> u) -> ImageDestination -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageDestination -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImageDestination -> m ImageDestination #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageDestination -> m ImageDestination #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageDestination -> m ImageDestination #

Read ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Show ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Generic ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep ImageDestination :: Type -> Type #

Arbitrary ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Hashable ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Binary ImageDestination Source # 
Instance details

Defined in B9.DiskImages

NFData ImageDestination Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: ImageDestination -> () #

type Rep ImageDestination Source # 
Instance details

Defined in B9.DiskImages

data ImageSource Source #

Specification of how the image to build is obtained.

Constructors

EmptyImage String FileSystem ImageType ImageSize

Create an empty image file having a file system label (first parameter), a file system type (e.g. Ext4) and an ImageSize

CopyOnWrite Image

DEPRECATED

SourceImage Image Partition ImageResize

Clone an existing image file; if the image file contains partitions, select the partition to use, b9 will extract that partition by reading the offset of the partition from the partition table and extract it using dd.

From String ImageResize

Use an image previously shared by via Share.

Instances
Eq ImageSource Source # 
Instance details

Defined in B9.DiskImages

Data ImageSource Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImageSource -> c ImageSource #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ImageSource #

toConstr :: ImageSource -> Constr #

dataTypeOf :: ImageSource -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ImageSource) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ImageSource) #

gmapT :: (forall b. Data b => b -> b) -> ImageSource -> ImageSource #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImageSource -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImageSource -> r #

gmapQ :: (forall d. Data d => d -> u) -> ImageSource -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageSource -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImageSource -> m ImageSource #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageSource -> m ImageSource #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageSource -> m ImageSource #

Read ImageSource Source # 
Instance details

Defined in B9.DiskImages

Show ImageSource Source # 
Instance details

Defined in B9.DiskImages

Generic ImageSource Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep ImageSource :: Type -> Type #

Arbitrary ImageSource Source # 
Instance details

Defined in B9.DiskImages

Hashable ImageSource Source # 
Instance details

Defined in B9.DiskImages

Binary ImageSource Source # 
Instance details

Defined in B9.DiskImages

NFData ImageSource Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: ImageSource -> () #

type Rep ImageSource Source # 
Instance details

Defined in B9.DiskImages

data Partition Source #

The partition to extract.

Constructors

NoPT

There is no partition table on the image

Partition Int

Extract partition n n must be in 0..3

Instances
Eq Partition Source # 
Instance details

Defined in B9.DiskImages

Data Partition Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Partition -> c Partition #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Partition #

toConstr :: Partition -> Constr #

dataTypeOf :: Partition -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Partition) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Partition) #

gmapT :: (forall b. Data b => b -> b) -> Partition -> Partition #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Partition -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Partition -> r #

gmapQ :: (forall d. Data d => d -> u) -> Partition -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Partition -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Partition -> m Partition #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Partition -> m Partition #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Partition -> m Partition #

Read Partition Source # 
Instance details

Defined in B9.DiskImages

Show Partition Source # 
Instance details

Defined in B9.DiskImages

Generic Partition Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep Partition :: Type -> Type #

Arbitrary Partition Source # 
Instance details

Defined in B9.DiskImages

Hashable Partition Source # 
Instance details

Defined in B9.DiskImages

Binary Partition Source # 
Instance details

Defined in B9.DiskImages

NFData Partition Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: Partition -> () #

type Rep Partition Source # 
Instance details

Defined in B9.DiskImages

type Rep Partition = D1 (MetaData "Partition" "B9.DiskImages" "b9-1.0.1-inplace" False) (C1 (MetaCons "NoPT" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Partition" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

data Image Source #

A vm disk image file consisting of a path to the image file, and the type and file system.

Instances
Eq Image Source # 
Instance details

Defined in B9.DiskImages

Methods

(==) :: Image -> Image -> Bool #

(/=) :: Image -> Image -> Bool #

Data Image Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Image -> c Image #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Image #

toConstr :: Image -> Constr #

dataTypeOf :: Image -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Image) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Image) #

gmapT :: (forall b. Data b => b -> b) -> Image -> Image #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Image -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Image -> r #

gmapQ :: (forall d. Data d => d -> u) -> Image -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Image -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Image -> m Image #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Image -> m Image #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Image -> m Image #

Read Image Source # 
Instance details

Defined in B9.DiskImages

Show Image Source # 
Instance details

Defined in B9.DiskImages

Methods

showsPrec :: Int -> Image -> ShowS #

show :: Image -> String #

showList :: [Image] -> ShowS #

Generic Image Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep Image :: Type -> Type #

Methods

from :: Image -> Rep Image x #

to :: Rep Image x -> Image #

Arbitrary Image Source # 
Instance details

Defined in B9.DiskImages

Methods

arbitrary :: Gen Image #

shrink :: Image -> [Image] #

Hashable Image Source # 
Instance details

Defined in B9.DiskImages

Methods

hashWithSalt :: Int -> Image -> Int #

hash :: Image -> Int #

Binary Image Source # 
Instance details

Defined in B9.DiskImages

Methods

put :: Image -> Put #

get :: Get Image #

putList :: [Image] -> Put #

NFData Image Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: Image -> () #

type Rep Image Source # 
Instance details

Defined in B9.DiskImages

data ImageType Source #

An image type defines the actual file format of a file containing file systems. These are like virtual harddrives

Constructors

Raw 
QCow2 
Vmdk 
Instances
Eq ImageType Source # 
Instance details

Defined in B9.DiskImages

Data ImageType Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImageType -> c ImageType #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ImageType #

toConstr :: ImageType -> Constr #

dataTypeOf :: ImageType -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ImageType) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ImageType) #

gmapT :: (forall b. Data b => b -> b) -> ImageType -> ImageType #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImageType -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImageType -> r #

gmapQ :: (forall d. Data d => d -> u) -> ImageType -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageType -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImageType -> m ImageType #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageType -> m ImageType #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageType -> m ImageType #

Read ImageType Source # 
Instance details

Defined in B9.DiskImages

Show ImageType Source # 
Instance details

Defined in B9.DiskImages

Generic ImageType Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep ImageType :: Type -> Type #

Arbitrary ImageType Source # 
Instance details

Defined in B9.DiskImages

Hashable ImageType Source # 
Instance details

Defined in B9.DiskImages

Binary ImageType Source # 
Instance details

Defined in B9.DiskImages

NFData ImageType Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: ImageType -> () #

type Rep ImageType Source # 
Instance details

Defined in B9.DiskImages

type Rep ImageType = D1 (MetaData "ImageType" "B9.DiskImages" "b9-1.0.1-inplace" False) (C1 (MetaCons "Raw" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "QCow2" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Vmdk" PrefixI False) (U1 :: Type -> Type)))

data FileSystem Source #

The file systems that b9 can use and convert.

Instances
Eq FileSystem Source # 
Instance details

Defined in B9.DiskImages

Data FileSystem Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FileSystem -> c FileSystem #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FileSystem #

toConstr :: FileSystem -> Constr #

dataTypeOf :: FileSystem -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FileSystem) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FileSystem) #

gmapT :: (forall b. Data b => b -> b) -> FileSystem -> FileSystem #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FileSystem -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FileSystem -> r #

gmapQ :: (forall d. Data d => d -> u) -> FileSystem -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FileSystem -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FileSystem -> m FileSystem #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FileSystem -> m FileSystem #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FileSystem -> m FileSystem #

Read FileSystem Source # 
Instance details

Defined in B9.DiskImages

Show FileSystem Source # 
Instance details

Defined in B9.DiskImages

Generic FileSystem Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep FileSystem :: Type -> Type #

Arbitrary FileSystem Source # 
Instance details

Defined in B9.DiskImages

Hashable FileSystem Source # 
Instance details

Defined in B9.DiskImages

Binary FileSystem Source # 
Instance details

Defined in B9.DiskImages

NFData FileSystem Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: FileSystem -> () #

type Rep FileSystem Source # 
Instance details

Defined in B9.DiskImages

type Rep FileSystem = D1 (MetaData "FileSystem" "B9.DiskImages" "b9-1.0.1-inplace" False) ((C1 (MetaCons "NoFileSystem" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Ext4" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Ext4_64" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ISO9660" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "VFAT" PrefixI False) (U1 :: Type -> Type))))

data ImageSize Source #

A data type for image file or file system size; instead of passing Ints around this also captures a size unit so that the Int can be kept small

Constructors

ImageSize Int SizeUnit 
Instances
Eq ImageSize Source # 
Instance details

Defined in B9.DiskImages

Data ImageSize Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImageSize -> c ImageSize #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ImageSize #

toConstr :: ImageSize -> Constr #

dataTypeOf :: ImageSize -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ImageSize) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ImageSize) #

gmapT :: (forall b. Data b => b -> b) -> ImageSize -> ImageSize #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImageSize -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImageSize -> r #

gmapQ :: (forall d. Data d => d -> u) -> ImageSize -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageSize -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImageSize -> m ImageSize #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageSize -> m ImageSize #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageSize -> m ImageSize #

Read ImageSize Source # 
Instance details

Defined in B9.DiskImages

Show ImageSize Source # 
Instance details

Defined in B9.DiskImages

Generic ImageSize Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep ImageSize :: Type -> Type #

Arbitrary ImageSize Source # 
Instance details

Defined in B9.DiskImages

Hashable ImageSize Source # 
Instance details

Defined in B9.DiskImages

Binary ImageSize Source # 
Instance details

Defined in B9.DiskImages

NFData ImageSize Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: ImageSize -> () #

type Rep ImageSize Source # 
Instance details

Defined in B9.DiskImages

bytesToKiloBytes :: Int -> ImageSize Source #

Convert a size in bytes to an ImageSize

imageSizeToKiB :: ImageSize -> Int Source #

Convert an ImageSize to kibi bytes.

sizeUnitKiB :: SizeUnit -> Int Source #

Convert a SizeUnit to the number of kibi bytes one element represents.

normalizeSize :: ImageSize -> ImageSize Source #

Choose the greatest unit possible to exactly represent an ImageSize.

addImageSize :: ImageSize -> ImageSize -> ImageSize Source #

Return the sum of two ImageSizes.

data SizeUnit Source #

Enumeration of size multipliers. The exact semantics may vary depending on what external tools look at these. E.g. the size unit is convert to a size parameter of the qemu-img command line tool.

Constructors

KB 
MB 
GB 
Instances
Bounded SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Enum SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Eq SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Data SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SizeUnit -> c SizeUnit #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SizeUnit #

toConstr :: SizeUnit -> Constr #

dataTypeOf :: SizeUnit -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SizeUnit) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SizeUnit) #

gmapT :: (forall b. Data b => b -> b) -> SizeUnit -> SizeUnit #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SizeUnit -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SizeUnit -> r #

gmapQ :: (forall d. Data d => d -> u) -> SizeUnit -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SizeUnit -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SizeUnit -> m SizeUnit #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SizeUnit -> m SizeUnit #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SizeUnit -> m SizeUnit #

Ord SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Read SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Show SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Generic SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep SizeUnit :: Type -> Type #

Methods

from :: SizeUnit -> Rep SizeUnit x #

to :: Rep SizeUnit x -> SizeUnit #

Arbitrary SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Hashable SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Methods

hashWithSalt :: Int -> SizeUnit -> Int #

hash :: SizeUnit -> Int #

Binary SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Methods

put :: SizeUnit -> Put #

get :: Get SizeUnit #

putList :: [SizeUnit] -> Put #

NFData SizeUnit Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: SizeUnit -> () #

type Rep SizeUnit Source # 
Instance details

Defined in B9.DiskImages

type Rep SizeUnit = D1 (MetaData "SizeUnit" "B9.DiskImages" "b9-1.0.1-inplace" False) (C1 (MetaCons "KB" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "MB" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "GB" PrefixI False) (U1 :: Type -> Type)))

data ImageResize Source #

How to resize an image file.

Constructors

ResizeImage ImageSize

Resize the image but not the file system. Note that a file system contained in the image file might be corrupted by this operation. To not only resize the image file but also the fil system contained in it, use Resize.

Resize ImageSize

Resize an image and the contained file system.

ShrinkToMinimumAndIncrease ImageSize

Shrink to minimum size needed and increase by the amount given.

ShrinkToMinimum

Resize an image and the contained file system to the smallest size to fit the contents of the file system.

KeepSize

Do not change the image size.

Instances
Eq ImageResize Source # 
Instance details

Defined in B9.DiskImages

Data ImageResize Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImageResize -> c ImageResize #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ImageResize #

toConstr :: ImageResize -> Constr #

dataTypeOf :: ImageResize -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ImageResize) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ImageResize) #

gmapT :: (forall b. Data b => b -> b) -> ImageResize -> ImageResize #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImageResize -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImageResize -> r #

gmapQ :: (forall d. Data d => d -> u) -> ImageResize -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageResize -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImageResize -> m ImageResize #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageResize -> m ImageResize #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImageResize -> m ImageResize #

Read ImageResize Source # 
Instance details

Defined in B9.DiskImages

Show ImageResize Source # 
Instance details

Defined in B9.DiskImages

Generic ImageResize Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep ImageResize :: Type -> Type #

Arbitrary ImageResize Source # 
Instance details

Defined in B9.DiskImages

Hashable ImageResize Source # 
Instance details

Defined in B9.DiskImages

Binary ImageResize Source # 
Instance details

Defined in B9.DiskImages

NFData ImageResize Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: ImageResize -> () #

type Rep ImageResize Source # 
Instance details

Defined in B9.DiskImages

type Mounted a = (a, MountPoint) Source #

A type alias that indicates that something of type a is mount at a MountPoint

Shared Images

data SharedImage Source #

SharedImage holds all data necessary to describe an instance of a shared image identified by a SharedImageName. Shared images are stored in Repositorys.

Instances
Eq SharedImage Source # 
Instance details

Defined in B9.DiskImages

Data SharedImage Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SharedImage -> c SharedImage #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SharedImage #

toConstr :: SharedImage -> Constr #

dataTypeOf :: SharedImage -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SharedImage) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SharedImage) #

gmapT :: (forall b. Data b => b -> b) -> SharedImage -> SharedImage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SharedImage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SharedImage -> r #

gmapQ :: (forall d. Data d => d -> u) -> SharedImage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SharedImage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SharedImage -> m SharedImage #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImage -> m SharedImage #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImage -> m SharedImage #

Ord SharedImage Source #

Shared images are ordered by name, build date and build id

Instance details

Defined in B9.DiskImages

Read SharedImage Source # 
Instance details

Defined in B9.DiskImages

Show SharedImage Source # 
Instance details

Defined in B9.DiskImages

Generic SharedImage Source # 
Instance details

Defined in B9.DiskImages

Associated Types

type Rep SharedImage :: Type -> Type #

Hashable SharedImage Source # 
Instance details

Defined in B9.DiskImages

Binary SharedImage Source # 
Instance details

Defined in B9.DiskImages

NFData SharedImage Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: SharedImage -> () #

type Rep SharedImage Source # 
Instance details

Defined in B9.DiskImages

newtype SharedImageName Source #

The name of the image is the de-facto identifier for push, pull, From and Share. B9 always selects the newest version the shared image identified by that name when using a shared image as an ImageSource. This is a wrapper around a string that identifies a SharedImage

Constructors

SharedImageName String 
Instances
Eq SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Data SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SharedImageName -> c SharedImageName #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SharedImageName #

toConstr :: SharedImageName -> Constr #

dataTypeOf :: SharedImageName -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SharedImageName) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SharedImageName) #

gmapT :: (forall b. Data b => b -> b) -> SharedImageName -> SharedImageName #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SharedImageName -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SharedImageName -> r #

gmapQ :: (forall d. Data d => d -> u) -> SharedImageName -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SharedImageName -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SharedImageName -> m SharedImageName #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImageName -> m SharedImageName #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImageName -> m SharedImageName #

Ord SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Read SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Show SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Arbitrary SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Hashable SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Binary SharedImageName Source # 
Instance details

Defined in B9.DiskImages

NFData SharedImageName Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: SharedImageName -> () #

type RuleResult SharedImageName Source # 
Instance details

Defined in B9.Shake.SharedImageRules

fromSharedImageName :: SharedImageName -> String Source #

Get the String representation of a SharedImageName.

newtype SharedImageDate Source #

The exact time that build job started. This is a wrapper around a string contains the build date of a SharedImage; this is purely additional convenience and typesafety

Constructors

SharedImageDate String 
Instances
Eq SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

Data SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SharedImageDate -> c SharedImageDate #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SharedImageDate #

toConstr :: SharedImageDate -> Constr #

dataTypeOf :: SharedImageDate -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SharedImageDate) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SharedImageDate) #

gmapT :: (forall b. Data b => b -> b) -> SharedImageDate -> SharedImageDate #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SharedImageDate -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SharedImageDate -> r #

gmapQ :: (forall d. Data d => d -> u) -> SharedImageDate -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SharedImageDate -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SharedImageDate -> m SharedImageDate #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImageDate -> m SharedImageDate #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImageDate -> m SharedImageDate #

Ord SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

Read SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

Show SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

Hashable SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

Binary SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

NFData SharedImageDate Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: SharedImageDate -> () #

newtype SharedImageBuildId Source #

Every B9 build running in a B9Monad contains a random unique id that is generated once per build (no matter how many artifacts are created in that build) This field contains the build id of the build that created the shared image instance. This is A wrapper around a string contains the build id of a SharedImage; this is purely additional convenience and typesafety

Instances
Eq SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

Data SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SharedImageBuildId -> c SharedImageBuildId #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SharedImageBuildId #

toConstr :: SharedImageBuildId -> Constr #

dataTypeOf :: SharedImageBuildId -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SharedImageBuildId) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SharedImageBuildId) #

gmapT :: (forall b. Data b => b -> b) -> SharedImageBuildId -> SharedImageBuildId #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SharedImageBuildId -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SharedImageBuildId -> r #

gmapQ :: (forall d. Data d => d -> u) -> SharedImageBuildId -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SharedImageBuildId -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SharedImageBuildId -> m SharedImageBuildId #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImageBuildId -> m SharedImageBuildId #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SharedImageBuildId -> m SharedImageBuildId #

Ord SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

Read SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

Show SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

Hashable SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

Binary SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

NFData SharedImageBuildId Source # 
Instance details

Defined in B9.DiskImages

Methods

rnf :: SharedImageBuildId -> () #

Constructor and accessors for Image ImageTarget ImageSource

imageFileName :: Image -> FilePath Source #

Return the name of the file corresponding to an Image

getImageDestinationOutputFiles :: ImageTarget -> [FilePath] Source #

Return the files generated for a LocalFile or a LiveInstallerImage; SharedImage and Transient are treated like they have no output files because the output files are manged by B9.

imageDestinationSharedImageName :: ImageDestination -> Maybe SharedImageName Source #

Return the name of a shared image, if the ImageDestination is a Share destination

imageSourceSharedImageName :: ImageSource -> Maybe SharedImageName Source #

Return the name of a shared source image, if the ImageSource is a From source

isPartitioned :: Partition -> Bool Source #

Return true if a Partition parameter is actually referring to a partition, false if it is NoPT

getPartition :: Partition -> Int Source #

Return the Partition index or throw a runtime error if applied to NoPT

imageFileExtension :: ImageType -> String Source #

Return the file name extension of an image file with a specific image format.

changeImageFormat :: ImageType -> Image -> Image Source #

Change the image file format and also rename the image file name to have the appropriate file name extension. See imageFileExtension and replaceExtension

Constructors and accessors for ImageSources

Constructors and accessors for SharedImages

sharedImageName :: SharedImage -> SharedImageName Source #

Return the name of a shared image.

sharedImageDate :: SharedImage -> SharedImageDate Source #

Return the build date of a shared image.

sharedImageBuildId :: SharedImage -> SharedImageBuildId Source #

Return the build id of a shared image.

prettyPrintSharedImages :: [SharedImage] -> String Source #

Print the contents of the shared image in one line

sharedImageImage :: SharedImage -> Image Source #

Return the disk image of an sharedImage

sharedImageFileName :: SharedImage -> FilePath Source #

Calculate the path to the text file holding the serialized SharedImage relative to the directory of shared images in a repository.

sharedImageDefaultImageType :: ImageType Source #

The internal image type to use as best guess when dealing with a From value.

Constructors for ImageTargets

transientCOWImage :: FilePath -> FilePath -> ImageTarget Source #

Use a QCow2 image with an Ext4 file system

shareSharedImage :: SharedImageName -> SharedImageName -> FilePath -> ImageTarget Source #

Share an image based on a shared image

cowToLocalImage :: FilePath -> FilePath -> FilePath -> ImageTarget Source #

Export a QCow2 image file with Ext4 fs as a local file

localToLocalImage :: FilePath -> FilePath -> FilePath -> ImageTarget Source #

Export a QCow2 image file with Ext4 fs as a local file

partition1ToLocalImage :: FilePath -> FilePath -> FilePath -> ImageTarget Source #

Create a local image file from the contents of the first partition of a local QCow2 image.

ImageTarget Transformations

splitToIntermediateSharedImage :: ImageTarget -> SharedImageName -> (ImageTarget, ImageTarget) Source #

Split any image target into two image targets, one for creating an intermediate shared image and one from the intermediate shared image to the output image.

Arbitrary instances for quickcheck