summaryrefslogtreecommitdiff
path: root/fsmgr.hs
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2018-06-17 16:14:53 -0400
committerAndrew Cady <d@jerkface.net>2018-06-17 16:15:40 -0400
commit019a2a64ffd8286f2f272199bedca1d62589764a (patch)
tree8e4f631bee787bb339386c9318840c0047a4d0c5 /fsmgr.hs
initial commit
Diffstat (limited to 'fsmgr.hs')
-rw-r--r--fsmgr.hs48
1 files changed, 48 insertions, 0 deletions
diff --git a/fsmgr.hs b/fsmgr.hs
new file mode 100644
index 0000000..3c5e72f
--- /dev/null
+++ b/fsmgr.hs
@@ -0,0 +1,48 @@
1{-# LANGUAGE InstanceSigs #-}
2{-# LANGUAGE NoImplicitPrelude #-}
3{-# LANGUAGE PartialTypeSignatures #-}
4module Main where
5import Rebase.Prelude hiding (hash)
6
7import Crypto.Hash
8import Crypto.Hash.Types.Digest.Read ()
9
10{-
11
12Basic idea is to have a fs.yaml that specifies the build procedure. Analogous to
13stack.yaml, it should specify everything (every source) directly or indirectly.
14
15We want to make new images from CoW copies of old ones. We want to build these
16things incrementally, but still end up with something that will be reproducible
17from scratch.
18
19Anyway, what we'll have is a list of packages, which will be unpacked first.
20Then a list of debconf values, which will be applied. Then we will have the rest
21of the other, slower changes to the image (including dpkg --configure -a). Some
22changes can be assumed to produce the same results out of order. Oh right, and
23the zeroeth step is to generate the empty (or just initial) filesystem image.
24The initial filesystem image, if nonempty, is specified by filename (otherwise,
25by size), while the hash of the configuration determines the output filename.
26
27
28-}
29
30newtype DebconfConfig = DebconfConfig Text deriving (Show, Read, Eq, Ord)
31newtype Package = Package Text deriving (Show, Read, Eq, Ord)
32data Patch = Patch deriving (Show, Read)
33
34sha1 :: ByteString -> Digest SHA1
35sha1 = hash
36
37data DiskImageConfig = DiskImageConfig {
38 initialImage :: Either Integer (Digest SHA1)
39, unpacked :: Set Package
40, debconfConfig :: DebconfConfig
41, configured :: Set Package
42, patched :: [Patch]
43} deriving (Show, Read)
44
45
46
47main :: IO ()
48main = return ()