diff options
Diffstat (limited to 'fsmgr.hs')
-rw-r--r-- | fsmgr.hs | 48 |
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 #-} | ||
4 | module Main where | ||
5 | import Rebase.Prelude hiding (hash) | ||
6 | |||
7 | import Crypto.Hash | ||
8 | import Crypto.Hash.Types.Digest.Read () | ||
9 | |||
10 | {- | ||
11 | |||
12 | Basic idea is to have a fs.yaml that specifies the build procedure. Analogous to | ||
13 | stack.yaml, it should specify everything (every source) directly or indirectly. | ||
14 | |||
15 | We want to make new images from CoW copies of old ones. We want to build these | ||
16 | things incrementally, but still end up with something that will be reproducible | ||
17 | from scratch. | ||
18 | |||
19 | Anyway, what we'll have is a list of packages, which will be unpacked first. | ||
20 | Then a list of debconf values, which will be applied. Then we will have the rest | ||
21 | of the other, slower changes to the image (including dpkg --configure -a). Some | ||
22 | changes can be assumed to produce the same results out of order. Oh right, and | ||
23 | the zeroeth step is to generate the empty (or just initial) filesystem image. | ||
24 | The initial filesystem image, if nonempty, is specified by filename (otherwise, | ||
25 | by size), while the hash of the configuration determines the output filename. | ||
26 | |||
27 | |||
28 | -} | ||
29 | |||
30 | newtype DebconfConfig = DebconfConfig Text deriving (Show, Read, Eq, Ord) | ||
31 | newtype Package = Package Text deriving (Show, Read, Eq, Ord) | ||
32 | data Patch = Patch deriving (Show, Read) | ||
33 | |||
34 | sha1 :: ByteString -> Digest SHA1 | ||
35 | sha1 = hash | ||
36 | |||
37 | data 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 | |||
47 | main :: IO () | ||
48 | main = return () | ||