summaryrefslogtreecommitdiff
path: root/notes/modules.txt
blob: c6e4d92b41166cb632e651346d2eea74e215512d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

for each module we want a module definition file, module.cfg

    [module]
    name = pkg1
    version = 0.1.0
    allow_unsafe = true
    plugin_for = mainpkg1:plugin_v1
    internal_for = friendpkg1
    minimum_int_bits = 32
    minimum_size_bits = 32
    
    [metadata]
    website = https://xxx
    author = yyy
    
    [updates]
    dl_url = https://xxx
    dl_url_format = .tar.zst (or MIME type?)
    dl_url_signkey = base64:MID343SDF2f4sdff23Sf42ds3423...sdFDf=
    dl_check_url = https://xxx
    dl_check_pattern = /latest version: (.*)/\1/
    dl_check_signkey = key1
    repo_url = https://xxxx/xxx.git
    repo_type = git
    repo_release_pattern = /v(.*)/
    repo_release_replace = /-/./
    repo_release_signkey = key1
    
    [keys]
    key1 = base64:MID343SDF2f4sdff23Sf42ds3423...sdFDf=
    
    [dependencies]
    pkg1 = least:0.5.3
    pkg2
    meta_pkg1
    
    [build_dependencies]
    pkg3 = least:1.2.0
    
    [run_dependencies]
    pkg4
    pkg5 = optional
    
    [broken_dependencies]
    pkg2 = range:0.1.2.1:0.1.2.5,0.1.3.0

there should be this standard file/directory structure.
only the module.cfg file, and at least one of (asm, data, dev-doc, doc, src, test), are required.

    asm/   (if allow_unsafe is true)
    asm/x86_64-linux-gnu/*.cfg   (assembler options, e.g. syntax. default.cfg for defaults)
    asm/x86_64-linux-gnu/*.asm  (for example)
    data/
    dev-doc/
    doc/
    plugin-interface/
    src/
    test/data/
    test/unit/**.sul
    test/system/**.sul
    test/exec/**.cfg
    README
    module.cfg
    interface.sul  (for libraries)

building should store files in a local cache directory (perhaps tmpfs, or rarely synced-to-disk partition)

modules are installed into these directories:

    /sys/exe/arch/
    /sys/lib/arch/
    /sys/lib/arch/other_pkgname/pluginapiname/
    /sys/data/res/pkgname/
    /sys/data/doc/pkgname/
    /sys/data/src/dev-doc/pkgname/
    /sys/data/src/dev-interface/
    /sys/data/src/dev-plugin/pkgname/

builtin-software is installed in a special parition, which is updated as a disk image (with reproducible bindiff/"fsdiff" commands)
with A/B partitions
on top of this, the other directories are overlaid

additionally, there are these runtime directories
    /sys/cache/
    /sys/cfg/pkgname/
    /user/username/


by default, an app can see these directories
    /sys/lib/arch/pkgname/pluginapiname/   (as /app/plugins/)
    /sys/data/res/pkgname/                 (as /app/res/)
    /sys/data/doc/pkgname/                 (as /app/doc/)