From 6ce4b7c072d31bf745bc1c59d21544b6d52dbc4c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 Mar 2017 14:00:34 -0400 Subject: reorg docs --- src/Propellor/Property/DiskImage.hs | 40 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index 3afffa1c..64ab8bd5 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -50,20 +50,22 @@ type DiskImage = FilePath -- -- Then, the disk image is set up, and the chroot is copied into the -- appropriate partition(s) of it. +-- +-- Note that the disk image file is reused if it already exists, +-- to avoid expensive IO to generate a new one. And, it's updated in-place, +-- so its contents are undefined during the build process. +-- +-- Note that the `Chroot.noServices` property is automatically added to the +-- chroot while the disk image is being built, which should prevent any +-- daemons that are included from being started on the system that is +-- building the disk image. -- -- Example use: -- -- > import Propellor.Property.DiskImage --- --- > let chroot d = Chroot.debootstrapped mempty d $ props --- > & osDebian Unstable X86_64 --- > & Apt.installed ["linux-image-amd64"] --- > & User.hasPassword (User "root") --- > & User.accountFor (User "demo") --- > & User.hasPassword (User "demo") --- > & User.hasDesktopGroups (User "demo") --- > & ... --- > in imageBuilt "/srv/images/foo.img" chroot +-- > +-- > ... +-- > & imageBuilt "/srv/images/foo.img" mychroot -- > MSDOS (grubBooted PC) -- > [ partition EXT2 `mountedAt` "/boot" -- > `setFlag` BootFlag @@ -72,15 +74,17 @@ type DiskImage = FilePath -- > `mountOpt` errorReadonly -- > , swapPartition (MegaBytes 256) -- > ] +-- > where +-- > mychroot d = Chroot.debootstrapped mempty d $ props +-- > & osDebian Unstable X86_64 +-- > & Apt.installed ["linux-image-amd64"] +-- > & User.hasPassword (User "root") +-- > & User.accountFor (User "demo") +-- > & User.hasPassword (User "demo") +-- > & User.hasDesktopGroups (User "demo") +-- > & ... -- --- Note that the disk image file is reused if it already exists, --- to avoid expensive IO to generate a new one. And, it's updated in-place, --- so its contents are undefined during the build process. --- --- Note that the `Chroot.noServices` property is automatically added to the --- chroot while the disk image is being built, which should prevent any --- daemons that are included from being started on the system that is --- building the disk image. +-- imageBuilt :: DiskImage -> (FilePath -> Chroot) -> TableType -> Finalization -> [PartSpec] -> RevertableProperty (HasInfo + DebianLike) Linux imageBuilt = imageBuilt' False -- cgit v1.2.3