summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config-joey.hs2
-rw-r--r--src/Propellor/Property/DiskImage.hs13
2 files changed, 12 insertions, 3 deletions
diff --git a/config-joey.hs b/config-joey.hs
index 35739f05..bfd14d7e 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -80,7 +80,7 @@ darkstar = host "darkstar.kitenet.net"
& JoeySites.postfixClientRelay (Context "darkstar.kitenet.net")
& JoeySites.dkimMilter
- & imageBuilt "/tmp/img" c ps (grubBooted PC)
+ & imageBuilt "/tmp/img" c ps noFinalization -- (grubBooted PC)
where
c d = Chroot.debootstrapped (System (Debian Unstable) "amd64") mempty d
& Apt.installed ["linux-image-amd64"]
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)