3 Parses /etc/system on Solaris
5 Author: Dominic Cleal <dcleal@redhat.com>
8 This lens tries to keep as close as possible to `man 4 system` where possible.
11 This file is licensed under the LGPL v2+, like the rest of Augeas.
15 About: Configuration files
16 This lens applies to /etc/system on Solaris. See <filter>.
19 module Solaris_System =
22 (************************************************************************
23 * Group: USEFUL PRIMITIVES
24 ************************************************************************)
27 let comment = Util.comment_generic /[ \t]*\*[ \t]*/ "* "
30 Map empty lines, including empty asterisk comments *)
31 let empty = [ del /[ \t]*\*?[ \t]*\n/ "\n" ]
34 The separator for key/value entries *)
35 let sep_colon = del /:[ \t]*/ ": "
38 The separator of directories in a moddir search path *)
39 let sep_moddir = del /[: ]+/ " "
42 Individual moddir search path entry *)
43 let modpath = [ seq "modpath" . store /[^ :\t\n]+/ ]
45 (* Variable: set_operator
46 Valid set operators: equals, bitwise AND and OR *)
47 let set_operators = /[=&|]/
50 Sets an integer value or char pointer *)
51 let set_value = [ label "value" . store Rx.no_spaces ]
53 (************************************************************************
55 ************************************************************************)
58 Function for simple key/value setting commands such as rootfs *)
59 let cmd_kv (cmd:string) (value:regexp) =
60 Build.key_value_line cmd sep_colon (store value)
63 The moddir command for specifying module search paths *)
65 Build.key_value_line "moddir" sep_colon
66 (Build.opt_list modpath sep_moddir)
69 Loads the variable name from a set command, no module *)
70 let set_var = [ label "variable" . store Rx.word ]
73 Loads the module and variable names from a set command *)
74 let set_varmod = [ label "module" . store Rx.word ]
75 . Util.del_str ":" . set_var
77 (* View: set_sep_spc *)
78 let set_sep_spc = Util.del_opt_ws " "
81 The set command for individual kernel/module parameters *)
82 let cmd_set = [ key "set"
84 . ( set_var | set_varmod )
86 . [ label "operator" . store set_operators ]
91 (************************************************************************
93 ************************************************************************)
99 | cmd_kv "rootdev" Rx.fspath
100 | cmd_kv "rootfs" Rx.word
101 | cmd_kv "exclude" Rx.fspath
102 | cmd_kv "include" Rx.fspath
103 | cmd_kv "forceload" Rx.fspath
106 (* Variable: filter *)
107 let filter = (incl "/etc/system")
109 let xfm = transform lns filter