summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/DiskImage.hs
diff options
context:
space:
mode:
authorJoey Hess2015-09-02 15:44:47 -0700
committerJoey Hess2015-09-02 15:44:47 -0700
commit851f7ebb8d598d9379a275df9b13303d3ac6d521 (patch)
treec8e2ad7ce9782de21ef8c9ea394863cba5c37c67 /src/Propellor/Property/DiskImage.hs
parent6dfc583d27cb0aeecf48f6dae01b98625902372b (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/DiskImage.hs')
-rw-r--r--src/Propellor/Property/DiskImage.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs
index 384718ca..2c222cb2 100644
--- a/src/Propellor/Property/DiskImage.hs
+++ b/src/Propellor/Property/DiskImage.hs
@@ -23,6 +23,7 @@ module Propellor.Property.DiskImage (
Finalization,
grubBooted,
Grub.BIOS(..),
+ noFinalization,
) where
import Propellor
@@ -31,6 +32,7 @@ import Propellor.Property.Chroot.Util (removeChroot)
import qualified Propellor.Property.Chroot as Chroot
import qualified Propellor.Property.Grub as Grub
import qualified Propellor.Property.File as File
+import qualified Propellor.Property.Apt as Apt
import Propellor.Property.Parted
import Propellor.Property.Mount
import Utility.Path
@@ -73,14 +75,18 @@ imageBuilt' rebuild img mkchroot mkparttable final =
(mkimg <!> unmkimg)
-- TODO snd final
-- TODO copy in
- -- TODO chroot topevel directory perm fixup
- `requires` Chroot.provisioned (mkchroot chrootdir & fst final)
+ `requires` Chroot.provisioned chroot
`requires` (cleanrebuild <!> doNothing)
`describe` desc
where
desc = "built disk image " ++ img
unmkimg = File.notPresent img
chrootdir = img ++ ".chroot"
+ chroot = mkchroot chrootdir
+ -- Run first stage finalization.
+ & fst final
+ -- Avoid wasting disk image space on the apt cache
+ & Apt.cacheCleaned
mkimg = property desc $ do
-- unmount helper filesystems such as proc from the chroot
-- before getting sizes
@@ -223,3 +229,6 @@ type Finalization = (Property NoInfo, Property NoInfo)
-- | Makes grub be the boot loader of the disk image.
grubBooted :: Grub.BIOS -> Finalization
grubBooted bios = (Grub.installed bios, undefined)
+
+noFinalization :: Finalization
+noFinalization = (doNothing, doNothing)