Modprobe

Parses /etc/modprobe.conf and /etc/modprobe.d/*

Original Author: David Lutterkort lut.nosp@m.ter@redha.nosp@m.t.com

Author: Raphael Pinson rap.nosp@m.hink@gmai.nosp@m.l.com

Summary
ModprobeParses /etc/modprobe.conf and /etc/modprobe.d/*
ReferenceThis lens tries to keep as close as possible to `man 5 modprobe.conf` where possible.
LicenseThis file is licenced under the LGPL v2+, like the rest of Augeas.
Lens UsageTo be documented
Configuration filesThis lens applies to /etc/modprobe.conf and /etc/modprobe.d/*.
USEFUL PRIMITIVES
comment
empty
sep_space
sto_no_spaces
sto_no_colons
sto_to_eol
alias
ENTRY TYPES
options
install_remove
blacklist
config
softdep
entry
LENS AND FILTER
lns
filter

Reference

This lens tries to keep as close as possible to `man 5 modprobe.conf` where possible.

License

This file is licenced under the LGPL v2+, like the rest of Augeas.

Lens Usage

To be documented

Configuration files

This lens applies to /etc/modprobe.conf and /etc/modprobe.d/*.  See filter.

USEFUL PRIMITIVES

comment

let comment = Util.comment

empty

let empty = Util.empty

sep_space

let sep_space = del /([ \t]|(\\\\\n))+/ " "

sto_no_spaces

let sto_no_spaces = store /[^# \t\n\\\\]+/

sto_no_colons

let sto_no_colons = store /[^:# \t\n\\\\]+/

sto_to_eol

let sto_to_eol = store /(([^# \t\n\\\\][^#\n\\\\]*[ \t]*\\\\[ \t]*\n[ \t]*)*([^# \t\n\\\\][^#\n\\\\]*[^# \t\n\\\\]|[^# \t\n\\\\])|[^# \t\n\\\\])/

alias

let alias = let modulename = [ label "modulename" . sto_no_spaces ] in Build.key_value_line_comment "alias" sep_space (sto_no_spaces . sep_space . modulename) comment

ENTRY TYPES

options

let options = let opt_value = /[^#" \t\n\\\\]+|"[^#"\n\\\\]*"/ in let option = [ key Rx.word . (del /[ \t]*=[ \t]*/ "=" . store opt_value)? ] in [ key "options" . sep_space . sto_no_spaces . (sep_space . option)* . Util.comment_or_eol ]

install_remove

blacklist

let blacklist = Build.key_value_line_comment "blacklist" sep_space sto_no_spaces comment

config

let config = Build.key_value_line_comment "config" sep_space (store /binary_indexes|yes|no/) comment

softdep

let softdep = let premod = [ label "pre" . sep_space . sto_no_colons ] in let pre = sep_space . Util.del_str "pre:" . premod+ in let postmod = [ label "post" . sep_space . sto_no_colons ] in let post = sep_space . Util.del_str "post:" . postmod+ in [ key "softdep" . sep_space . sto_no_colons . pre? . post? . Util.comment_or_eol ]

entry

let entry = alias | options | kv_line_command /install|remove/ | blacklist | config | softdep

LENS AND FILTER

lns

let lns = (comment|empty|entry)*

filter

let comment = Util.comment
let empty = Util.empty
let sep_space = del /([ \t]|(\\\\\n))+/ " "
let sto_no_spaces = store /[^# \t\n\\\\]+/
let sto_no_colons = store /[^:# \t\n\\\\]+/
let sto_to_eol = store /(([^# \t\n\\\\][^#\n\\\\]*[ \t]*\\\\[ \t]*\n[ \t]*)*([^# \t\n\\\\][^#\n\\\\]*[^# \t\n\\\\]|[^# \t\n\\\\])|[^# \t\n\\\\])/
let alias = let modulename = [ label "modulename" . sto_no_spaces ] in Build.key_value_line_comment "alias" sep_space (sto_no_spaces . sep_space . modulename) comment
let options = let opt_value = /[^#" \t\n\\\\]+|"[^#"\n\\\\]*"/ in let option = [ key Rx.word . (del /[ \t]*=[ \t]*/ "=" . store opt_value)? ] in [ key "options" . sep_space . sto_no_spaces . (sep_space . option)* . Util.comment_or_eol ]
let blacklist = Build.key_value_line_comment "blacklist" sep_space sto_no_spaces comment
let config = Build.key_value_line_comment "config" sep_space (store /binary_indexes|yes|no/) comment
let softdep = let premod = [ label "pre" . sep_space . sto_no_colons ] in let pre = sep_space . Util.del_str "pre:" . premod+ in let postmod = [ label "post" . sep_space . sto_no_colons ] in let post = sep_space . Util.del_str "post:" . postmod+ in [ key "softdep" . sep_space . sto_no_colons . pre? . post? . Util.comment_or_eol ]
let entry = alias | options | kv_line_command /install|remove/ | blacklist | config | softdep
let lns = (comment|empty|entry)*
Close