b9-0.5.49: 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 #

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 # 
Data ImageTarget # 

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 # 
Show ImageTarget # 
Generic ImageTarget # 

Associated Types

type Rep ImageTarget :: * -> * #

Arbitrary ImageTarget # 
Hashable ImageTarget # 
Binary ImageTarget # 
NFData ImageTarget # 

Methods

rnf :: ImageTarget -> () #

type Rep ImageTarget # 

data MountPoint #

A mount point or NotMounted

Instances

Eq MountPoint # 
Data MountPoint # 

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 # 
Show MountPoint # 
Generic MountPoint # 

Associated Types

type Rep MountPoint :: * -> * #

Arbitrary MountPoint # 
Hashable MountPoint # 
Binary MountPoint # 
NFData MountPoint # 

Methods

rnf :: MountPoint -> () #

type Rep MountPoint # 
type Rep MountPoint = D1 * (MetaData "MountPoint" "B9.DiskImages" "b9-0.5.49-HQ5bsnmgi3Q3koXBzVbs9I" False) ((:+:) * (C1 * (MetaCons "MountPoint" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * FilePath))) (C1 * (MetaCons "NotMounted" PrefixI False) (U1 *)))

data ImageDestination #

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 # 
Data ImageDestination # 

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 # 
Show ImageDestination # 
Generic ImageDestination # 
Arbitrary ImageDestination # 
Hashable ImageDestination # 
Binary ImageDestination # 
NFData ImageDestination # 

Methods

rnf :: ImageDestination -> () #

type Rep ImageDestination # 

data ImageSource #

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 # 
Data ImageSource # 

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 # 
Show ImageSource # 
Generic ImageSource # 

Associated Types

type Rep ImageSource :: * -> * #

Arbitrary ImageSource # 
Hashable ImageSource # 
Binary ImageSource # 
NFData ImageSource # 

Methods

rnf :: ImageSource -> () #

type Rep ImageSource # 

data Partition #

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 # 
Data Partition # 

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 # 
Show Partition # 
Generic Partition # 

Associated Types

type Rep Partition :: * -> * #

Arbitrary Partition # 
Hashable Partition # 
Binary Partition # 
NFData Partition # 

Methods

rnf :: Partition -> () #

type Rep Partition # 
type Rep Partition = D1 * (MetaData "Partition" "B9.DiskImages" "b9-0.5.49-HQ5bsnmgi3Q3koXBzVbs9I" False) ((:+:) * (C1 * (MetaCons "NoPT" PrefixI False) (U1 *)) (C1 * (MetaCons "Partition" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Int))))

data Image #

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

Instances

Eq Image # 

Methods

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

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

Data Image # 

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 # 
Show Image # 

Methods

showsPrec :: Int -> Image -> ShowS #

show :: Image -> String #

showList :: [Image] -> ShowS #

Generic Image # 

Associated Types

type Rep Image :: * -> * #

Methods

from :: Image -> Rep Image x #

to :: Rep Image x -> Image #

Arbitrary Image # 

Methods

arbitrary :: Gen Image #

shrink :: Image -> [Image] #

Hashable Image # 

Methods

hashWithSalt :: Int -> Image -> Int #

hash :: Image -> Int #

Binary Image # 

Methods

put :: Image -> Put #

get :: Get Image #

putList :: [Image] -> Put #

NFData Image # 

Methods

rnf :: Image -> () #

type Rep Image # 

data ImageType #

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 # 
Data ImageType # 

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 # 
Show ImageType # 
Generic ImageType # 

Associated Types

type Rep ImageType :: * -> * #

Arbitrary ImageType # 
Hashable ImageType # 
Binary ImageType # 
NFData ImageType # 

Methods

rnf :: ImageType -> () #

type Rep ImageType # 
type Rep ImageType = D1 * (MetaData "ImageType" "B9.DiskImages" "b9-0.5.49-HQ5bsnmgi3Q3koXBzVbs9I" False) ((:+:) * (C1 * (MetaCons "Raw" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "QCow2" PrefixI False) (U1 *)) (C1 * (MetaCons "Vmdk" PrefixI False) (U1 *))))

data FileSystem #

The file systems that b9 can use and convert.

Instances

Eq FileSystem # 
Data FileSystem # 

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 # 
Show FileSystem # 
Generic FileSystem # 

Associated Types

type Rep FileSystem :: * -> * #

Arbitrary FileSystem # 
Hashable FileSystem # 
Binary FileSystem # 
NFData FileSystem # 

Methods

rnf :: FileSystem -> () #

type Rep FileSystem # 
type Rep FileSystem = D1 * (MetaData "FileSystem" "B9.DiskImages" "b9-0.5.49-HQ5bsnmgi3Q3koXBzVbs9I" False) ((:+:) * ((:+:) * (C1 * (MetaCons "NoFileSystem" PrefixI False) (U1 *)) (C1 * (MetaCons "Ext4" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "Ext4_64" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "ISO9660" PrefixI False) (U1 *)) (C1 * (MetaCons "VFAT" PrefixI False) (U1 *)))))

data ImageSize #

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 # 
Data ImageSize # 

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 # 
Show ImageSize # 
Generic ImageSize # 

Associated Types

type Rep ImageSize :: * -> * #

Arbitrary ImageSize # 
Hashable ImageSize # 
Binary ImageSize # 
NFData ImageSize # 

Methods

rnf :: ImageSize -> () #

type Rep ImageSize # 

data SizeUnit #

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

B 
KB 
MB 
GB 

Instances

Eq SizeUnit # 
Data SizeUnit # 

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 # 
Read SizeUnit # 
Show SizeUnit # 
Generic SizeUnit # 

Associated Types

type Rep SizeUnit :: * -> * #

Methods

from :: SizeUnit -> Rep SizeUnit x #

to :: Rep SizeUnit x -> SizeUnit #

Arbitrary SizeUnit # 
Hashable SizeUnit # 

Methods

hashWithSalt :: Int -> SizeUnit -> Int #

hash :: SizeUnit -> Int #

Binary SizeUnit # 

Methods

put :: SizeUnit -> Put #

get :: Get SizeUnit #

putList :: [SizeUnit] -> Put #

NFData SizeUnit # 

Methods

rnf :: SizeUnit -> () #

type Rep SizeUnit # 
type Rep SizeUnit = D1 * (MetaData "SizeUnit" "B9.DiskImages" "b9-0.5.49-HQ5bsnmgi3Q3koXBzVbs9I" False) ((:+:) * ((:+:) * (C1 * (MetaCons "B" PrefixI False) (U1 *)) (C1 * (MetaCons "KB" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "MB" PrefixI False) (U1 *)) (C1 * (MetaCons "GB" PrefixI False) (U1 *))))

data ImageResize #

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.

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 # 
Data ImageResize # 

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 # 
Show ImageResize # 
Generic ImageResize # 

Associated Types

type Rep ImageResize :: * -> * #

Arbitrary ImageResize # 
Hashable ImageResize # 
Binary ImageResize # 
NFData ImageResize # 

Methods

rnf :: ImageResize -> () #

type Rep ImageResize # 
type Rep ImageResize = D1 * (MetaData "ImageResize" "B9.DiskImages" "b9-0.5.49-HQ5bsnmgi3Q3koXBzVbs9I" False) ((:+:) * ((:+:) * (C1 * (MetaCons "ResizeImage" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ImageSize))) (C1 * (MetaCons "Resize" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ImageSize)))) ((:+:) * (C1 * (MetaCons "ShrinkToMinimum" PrefixI False) (U1 *)) (C1 * (MetaCons "KeepSize" PrefixI False) (U1 *))))

type Mounted a = (a, MountPoint) #

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

Shared Images

data SharedImage #

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 # 
Data SharedImage # 

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 #

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

Read SharedImage # 
Show SharedImage # 
Generic SharedImage # 

Associated Types

type Rep SharedImage :: * -> * #

Hashable SharedImage # 
Binary SharedImage # 
NFData SharedImage # 

Methods

rnf :: SharedImage -> () #

type Rep SharedImage # 

newtype SharedImageName #

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 # 
Data SharedImageName # 

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 # 
Read SharedImageName # 
Show SharedImageName # 
Arbitrary SharedImageName # 
Hashable SharedImageName # 
Binary SharedImageName # 
NFData SharedImageName # 

Methods

rnf :: SharedImageName -> () #

type RuleResult SharedImageName # 

fromSharedImageName :: SharedImageName -> String #

Get the String representation of a SharedImageName.

newtype SharedImageDate #

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 # 
Data SharedImageDate # 

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 # 
Read SharedImageDate # 
Show SharedImageDate # 
Hashable SharedImageDate # 
Binary SharedImageDate # 
NFData SharedImageDate # 

Methods

rnf :: SharedImageDate -> () #

newtype SharedImageBuildId #

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 # 
Data SharedImageBuildId # 

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 # 
Read SharedImageBuildId # 
Show SharedImageBuildId # 
Hashable SharedImageBuildId # 
Binary SharedImageBuildId # 
NFData SharedImageBuildId # 

Methods

rnf :: SharedImageBuildId -> () #

fromSharedImageBuildId :: SharedImageBuildId -> String #

Get the String representation of a SharedImageBuildId.

Constroctor and accessors for Image ImageTarget ImageSource

imageFileName :: Image -> FilePath #

Return the name of the file corresponding to an Image

getImageDestinationOutputFiles :: ImageTarget -> [FilePath] #

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

imageDestinationSharedImageName :: ImageDestination -> Maybe SharedImageName #

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

imageSourceSharedImageName :: ImageSource -> Maybe SharedImageName #

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

isPartitioned :: Partition -> Bool #

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

getPartition :: Partition -> Int #

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

imageFileExtension :: ImageType -> String #

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

changeImageFormat :: ImageType -> Image -> Image #

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 #

Return the name of a shared image.

sharedImageDate :: SharedImage -> SharedImageDate #

Return the build date of a shared image.

sharedImageBuildId :: SharedImage -> SharedImageBuildId #

Return the build id of a shared image.

prettyPrintSharedImages :: [SharedImage] -> String #

Print the contents of the shared image in one line

sharedImageImage :: SharedImage -> Image #

Return the disk image of an sharedImage

sharedImageFileName :: SharedImage -> FilePath #

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

sharedImageDefaultImageType :: ImageType #

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

Constructors for ImageTargets

transientCOWImage :: FilePath -> FilePath -> ImageTarget #

Use a QCow2 image with an Ext4 file system

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

Share an image based on a shared image

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

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

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

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

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

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

ImageTarget Transformations

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

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