From ed42227b115ed1adf2e88b57bad8a7744d9cb240 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Sep 2015 11:52:39 -0700 Subject: propellor spin --- src/Propellor/Property/DiskImage.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index 99c9b14b..5cef449b 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -77,7 +77,8 @@ built' rebuild img mkchroot mkparttable final = -- unmount helper filesystems such as proc from the chroot -- before getting sizes liftIO $ unmountBelow chrootdir - szm <- liftIO $ M.map toPartSize <$> dirSizes chrootdir + szm <- liftIO $ M.mapKeys tosysdir . M.map toPartSize + <$> dirSizes chrootdir -- tie the knot! let (mnts, t) = mkparttable (map (getMountSz szm) mnts) liftIO $ print (mnts, t, map (getMountSz szm) mnts, szm) @@ -91,6 +92,10 @@ built' rebuild img mkchroot mkparttable final = return MadeChange | otherwise = doNothing + tosysdir d = case makeRelative chrootdir d of + "." -> "/" + sysdir -> "/" ++ sysdir + -- | Ensures that a disk image file of the specified size exists. -- -- If the file doesn't exist, or is too small, creates a new one, full of 0's. -- cgit v1.2.3