BootConf - Augeas Documentation

# BootConf

Parses (Open)BSD-stype /etc/boot.conf

Author: Jasper Lievisse Adriaanse jas.nosp@m.per@jasp.nosp@m.er.la

Summary

BootConf | Parses (Open)BSD-stype /etc/boot.conf
Reference | This lens is used to parse the second-stage bootstrap configuration file, /etc/boot.conf as found on OpenBSD.
Usage Example | To be documented
License | This file is licensed under the LGPL v2+, like the rest of Augeas.
Configuration files | This lens applies to /etc/boot.conf.
Augeas Lenses |
comment |
empty |
eol |
fspath |
space |
word |
key_opt_value_line | A subnode with a keyword, an optional part consisting of a separator and a storing lens, and an end of line
single_command | single command such as ‘help’ or ‘time’
ls | ls [directory]
set | set [varname [value]]
stty | stty [device [speed]]
echo | echo [args]
boot | boot [image [-acds]] XXX: the last arguments are not always needed, so make them optional
machine | machine [command]
command |
lns |
Augeas Variables |
filter |

### Reference

This lens is used to parse the second-stage bootstrap configuration file, /etc/boot.conf as found on OpenBSD. The format is largely MI, with MD parts included: http://www.openbsd.org/cgi-bin/man.cgi?query=boot.conf&arch=i386

### Usage Example

To be documented

### License

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

### Configuration files

This lens applies to /etc/boot.conf. See filter.

### Augeas Lenses

### comment

> let comment = Util.comment

### empty

> let empty = Util.empty

### eol

> let eol = Util.eol

### fspath

> let fspath = Rx.fspath

### space

> let space = Sep.space

### word

> let word = Rx.word

### key_opt_value_line

> let key_opt_value_line (kw:regexp) (sto:lens) = [ key kw . (space . sto)? . eol ]

A subnode with a keyword, an optional part consisting of a separator and a storing lens, and an end of line

#### Parameters

kw:regexp | the pattern to match as key
sto:lens | the storing lens

### single_command

> let single_command = let line_re = /help|time|reboot/ in [ Util.indent . key line_re . eol ]

single command such as ‘help’ or ‘time’

### ls

> let ls = Build.key_value_line "ls" space (store fspath)

ls [directory]

### set

> let set = Build.key_value "set" space (key_opt_value_line set_cmd (store Rx.space_in))

set [varname [value]]

### stty

> let stty = let device = [ label "device" . store fspath ] in let speed = [ label "speed" . store Rx.integer ] in key_opt_value_line "stty" (device . (space . speed)?)

stty [device [speed]]

### echo

> let echo = Build.key_value_line "echo" space (store word)

echo [args]

### boot

> let boot = let image = [ label "image" . store fspath ] in let arg = [ label "arg" . store word ] in Build.key_value_line "boot" space (image . space . arg)

boot [image [-acds]] XXX: the last arguments are not always needed, so make them optional

### machine

> let machine = let machine_entry = Build.key_value ("comaddr"|"memory") space (store word) | Build.flag ("diskinfo"|"regs") in Build.key_value_line "machine" space (Build.opt_list machine_entry space)

machine [command]

### command

> let command = boot | echo | ls | machine | set | stty

### lns

> let lns = ( empty | comment | command | single_command )*

### Augeas Variables

### filter

> let comment = Util.comment

> let empty = Util.empty

> let eol = Util.eol

> let fspath = Rx.fspath

> let space = Sep.space

> let word = Rx.word

> let key_opt_value_line (kw:regexp) (sto:lens) = [ key kw . (space . sto)? . eol ]

A subnode with a keyword, an optional part consisting of a separator and a storing lens, and an end of line

> let single_command = let line_re = /help|time|reboot/ in [ Util.indent . key line_re . eol ]

single command such as ‘help’ or ‘time’

> let ls = Build.key_value_line "ls" space (store fspath)

ls [directory]

> let set = Build.key_value "set" space (key_opt_value_line set_cmd (store Rx.space_in))

set [varname [value]]

> let stty = let device = [ label "device" . store fspath ] in let speed = [ label "speed" . store Rx.integer ] in key_opt_value_line "stty" (device . (space . speed)?)

stty [device [speed]]

> let echo = Build.key_value_line "echo" space (store word)

echo [args]

> let boot = let image = [ label "image" . store fspath ] in let arg = [ label "arg" . store word ] in Build.key_value_line "boot" space (image . space . arg)

boot [image [-acds]] XXX: the last arguments are not always needed, so make them optional

> let machine = let machine_entry = Build.key_value ("comaddr"|"memory") space (store word) | Build.flag ("diskinfo"|"regs") in Build.key_value_line "machine" space (Build.opt_list machine_entry space)

machine [command]

> let command = boot | echo | ls | machine | set | stty

> let lns = ( empty | comment | command | single_command )*

Close