summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/Chroot.hs11
-rw-r--r--src/Propellor/Types/Info.hs1
2 files changed, 9 insertions, 3 deletions
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs
index 48d96dcf..5be39bd6 100644
--- a/src/Propellor/Property/Chroot.hs
+++ b/src/Propellor/Property/Chroot.hs
@@ -60,7 +60,11 @@ class ChrootBootstrapper b where
-- | Do initial bootstrapping of an operating system in a chroot.
-- If the operating System is not supported, return
-- Left error message.
- buildchroot :: b -> Maybe System -> FilePath -> Either String (Property Linux)
+ buildchroot
+ :: b
+ -> Info -- ^ info of the Properties of the chroot
+ -> FilePath -- ^ where to bootstrap the chroot
+ -> Either String (Property Linux)
-- | Use this to bootstrap a chroot by extracting a tarball.
--
@@ -91,7 +95,7 @@ extractTarball target src = check (isUnpopulated target) $
data Debootstrapped = Debootstrapped Debootstrap.DebootstrapConfig
instance ChrootBootstrapper Debootstrapped where
- buildchroot (Debootstrapped cf) system loc = case system of
+ buildchroot (Debootstrapped cf) info loc = case system of
(Just s@(System (Debian _ _) _)) -> Right $ debootstrap s
(Just s@(System (Buntish _) _)) -> Right $ debootstrap s
(Just (System ArchLinux _)) -> Left "Arch Linux not supported by debootstrap."
@@ -99,6 +103,7 @@ instance ChrootBootstrapper Debootstrapped where
Nothing -> Left "Cannot debootstrap; OS not specified"
where
debootstrap s = Debootstrap.built loc s cf
+ system = fromInfoVal (fromInfo info)
-- | Defines a Chroot at the given location, built with debootstrap.
--
@@ -143,7 +148,7 @@ provisioned' c@(Chroot loc bootstrapper infopropigator _) systemdonly caps =
setup = propellChroot c (inChrootProcess (not systemdonly) c) systemdonly caps
`requires` built
- built = case buildchroot bootstrapper (chrootSystem c) loc of
+ built = case buildchroot bootstrapper (containerInfo c) loc of
Right p -> p
Left e -> cantbuild e
diff --git a/src/Propellor/Types/Info.hs b/src/Propellor/Types/Info.hs
index b941cc8f..27633712 100644
--- a/src/Propellor/Types/Info.hs
+++ b/src/Propellor/Types/Info.hs
@@ -63,6 +63,7 @@ addInfo (Info l) v = Info (l++[InfoEntry v])
toInfo :: IsInfo v => v -> Info
toInfo = addInfo mempty
+-- | Extracts a value from an Info.
fromInfo :: IsInfo v => Info -> v
fromInfo (Info l) = mconcat (mapMaybe extractInfoEntry l)