Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / kdump.aug
1 (*
2 Module: Kdump
3   Parses /etc/kdump.conf
4
5 Author: Roman Rakus <rrakus@redhat.com>
6
7 About: References
8   manual page kdump.conf(5)
9
10 About: License
11    This file is licenced under the LGPL v2+, like the rest of Augeas.
12
13 About: Configuration files
14    This lens applies to /etc/kdump.conf. See <filter>.
15 *)
16
17 module Kdump =
18   autoload xfm
19
20 (************************************************************************
21  * Group:                 USEFUL PRIMITIVES
22  *************************************************************************)
23
24 let empty = Util.empty
25 let comment = Util.comment
26 let value_to_eol = store /[^ \t\n#][^\n#]*[^ \t\n#]|[^ \t\n#]/
27 let int_to_eol = store Rx.integer
28 let yn_to_eol = store ("yes" | "no")
29 let delimiter = Util.del_ws_spc
30 let eol = Util.eol
31 let value_to_spc = store Rx.neg1
32 let key_to_space = key /[A-Za-z0-9_.\$-]+/
33 let eq = Sep.equal
34
35 (************************************************************************
36  * Group:                 ENTRY TYPES
37  *************************************************************************)
38
39 let list (kw:string) = counter kw
40                      . Build.key_value_line_comment kw delimiter
41                          (Build.opt_list [ seq kw . value_to_spc ] delimiter)
42                          comment
43
44 let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ]
45 let mdl_options = [ key_to_space . mdl_key_value+ ]
46 let mod_options = [ key "options" . delimiter . mdl_options . (comment|eol) ]
47
48 (************************************************************************
49  * Group:                 ENTRIES
50  *************************************************************************)
51
52 (* Got from mount(8) *)
53 let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent"
54              | "cramfs" | "debugfs" | "devpts" | "efs" | "ext" | "ext2"
55              | "ext3" | "ext4" | "hfs" | "hfsplus" | "hpfs" | "iso9660"
56              | "jfs" | "minix" | "msdos" | "ncpfs" | "nfs" | "nfs4" | "ntfs"
57              | "proc" | "qnx4" | "ramfs" | "reiserfs" | "romfs" | "squashfs"
58              | "smbfs" | "sysv" | "tmpfs" | "ubifs" | "udf" | "ufs" | "umsdos"
59              | "usbfs" | "vfat" | "xenix" | "xfs" | "xiafs"
60
61 let simple_kws = "raw" | "net" | "path" | "core_collector" | "kdump_post"
62                | "kdump_pre" | "default" | "ssh" | "sshkey" | "dracut_args"
63                | "fence_kdump_args"
64
65 let int_kws = "force_rebuild" | "override_resettable" | "debug_mem_level"
66             | "link_delay" | "disk_timeout"
67
68 let yn_kws = "auto_reset_crashkernel"
69
70 let option = Build.key_value_line_comment ( simple_kws | fs_types )
71                                           delimiter value_to_eol comment
72            | Build.key_value_line_comment int_kws delimiter int_to_eol comment
73            | Build.key_value_line_comment yn_kws delimiter yn_to_eol comment
74            | list "extra_bins"
75            | list "extra_modules"
76            | list "blacklist"
77            | list "fence_kdump_nodes"
78            | mod_options
79
80 (* View: lns
81    The options lens
82 *)
83 let lns = ( empty | comment | option )*
84
85 let filter = incl "/etc/kdump.conf"
86
87 let xfm = transform lns filter