File: disk.mli

package info (click to toggle)
marionnet 0.90.6+bzr508-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,532 kB
  • sloc: ml: 18,130; sh: 5,384; xml: 1,152; makefile: 1,003; ansic: 275
file content (167 lines) | stat: -rw-r--r-- 5,772 bytes parent folder | download
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
(* This file is part of marionnet
   Copyright (C) 2010  Jean-Vincent Loddo
   Copyright (C) 2010  Université Paris 13

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. *)

(** Manage files and informations installed on disk(s). *)

val machine_prefix : string
val router_prefix : string
val kernel_prefix : string

(* `epithet' is almost a phantom type: *)
type 'a epithet = string
type variant = string
type filename = string
type dirname = string
type realpath = string

val root_filesystem_searching_list : dirname list
val user_filesystem_searching_list : dirname list

val kernel_searching_list : dirname list

class terminal_manager :
 unit ->
 object
   method get_choice_list : string list
   method get_default     : string
   method is_valid_choice : string -> bool
   method is_xnest        : string -> bool
   method is_nox          : string -> bool
   method is_hostxserver  : string -> bool
 end


class ['a] epithet_manager :
  ?default_epithet:('a epithet) ->
  ?filter:('a epithet -> bool) ->
  kind: [> `distrib | `kernel | `variant ] ->
  directory_searching_list:string list ->
  prefix:string ->
  unit ->
  object
    (* Constructor's arguments: *)

    method directory_searching_list : dirname list
    method prefix : string

    (* Public interface: *)

    method get_epithet_list    : 'a epithet list
    method get_default_epithet : 'a epithet option
    method epithet_exists      : 'a epithet -> bool
    method realpath_of_epithet : 'a epithet -> realpath

    method resolve_epithet_symlink : 'a epithet -> 'a epithet

    (* Morally private methods: *)

    method epithets_of_filename : ?no_symlinks:unit ->
      filename -> ('a epithet) list

    method epithets_sharing_the_same_realpath_of : ?no_symlinks:unit ->
      ('a epithet) -> ('a epithet) list

    method filename_of_epithet : ('a epithet) -> filename
    method realpath_exists : string -> bool

    method filter : ('a epithet -> bool) -> unit

  end

class virtual_machine_installations :
  ?user_filesystem_searching_list:string list ->
  ?root_filesystem_searching_list:string list ->
  ?kernel_searching_list:string list ->
  ?kernel_prefix:string ->
  ?kernel_default_epithet:string ->
  ?filesystem_default_epithet:string ->
  prefix:string ->
  unit ->
  object
    (* Constructor's arguments: *)

    method filesystem_searching_list : dirname list
    method kernel_searching_list     : dirname list
    method kernel_prefix : string
    method prefix : string

    (* Public interface: *)

    method filesystems : [`distrib] epithet_manager
    method kernels     : [`kernel]  epithet_manager

    method variants_of           : [`distrib] epithet -> [`variant] epithet_manager
    method relay_script_of       : [`distrib] epithet -> filename option
    method supported_kernels_of  : [`distrib] epithet -> ([`kernel] epithet * (string option)) list
    method get_kernel_console_arguments : [`distrib] epithet -> [`kernel] epithet -> string option


    method terminal_manager_of            : [`distrib] epithet -> terminal_manager
    method multiple_consoles_supported_by : [`distrib] epithet -> bool
    method marionnet_relay_supported_by   : [`distrib] epithet -> bool

    method memory_min_size_of       : [`distrib] epithet -> int option
    method memory_suggested_size_of : [`distrib] epithet -> int option

    (* filesystem epithet -> dirname *)
    method root_export_dirname : [`distrib] epithet -> dirname
    method user_export_dirname : [`distrib] epithet -> dirname

    (* This method builds warnings if necessary: *)
    method check_filesystems_MTIME_consistency : unit -> unit

  end

(** Final user's machines strictu sensu *)
val find_machine_installations :
  ?user_filesystem_searching_list:string list ->
  ?root_filesystem_searching_list:string list ->
  ?kernel_searching_list:string list ->
  ?kernel_prefix:string ->
  ?kernel_default_epithet:string ->
  ?filesystem_default_epithet:string ->
  ?lifetime:float -> (* 60. seconds *)
  unit -> virtual_machine_installations Lazy_perishable.t

(** Instance of find_machine_installations (any optional argument provided): *)  
val get_machine_installations : virtual_machine_installations Lazy_perishable.t

val find_router_installations :
  ?user_filesystem_searching_list:string list ->
  ?root_filesystem_searching_list:string list ->
  ?kernel_searching_list:string list ->
  ?kernel_prefix:string ->
  ?kernel_default_epithet:string ->
  ?filesystem_default_epithet:string ->
  ?lifetime:float -> (* 60. seconds *)
  unit -> virtual_machine_installations Lazy_perishable.t

(** Instance of find_router_installations (any optional argument provided): *)  
val get_router_installations : virtual_machine_installations Lazy_perishable.t
  
val vm_installations_and_epithet_of_prefixed_filesystem :
  string -> virtual_machine_installations * [`distrib] epithet

val user_export_dirname_of_prefixed_filesystem : string -> dirname
val root_export_dirname_of_prefixed_filesystem : string -> dirname

module Make_and_check_installations :
  functor (Unit : sig end) ->
    sig
      val machines : virtual_machine_installations
      val routers  : virtual_machine_installations
    end