Parses /etc/crypttab from the cryptsetup package.
Author: Frédéric Lespez frederi@fre e.fr c.lespez
Crypttab | Parses /etc/crypttab from the cryptsetup package. |
Reference | This lens tries to keep as close as possible to `man crypttab` where possible. |
License | This file is licensed under the LGPL v2+, like the rest of Augeas. |
Lens Usage | Sample usage of this lens in augtool |
Configuration files | This lens applies to /etc/crypttab. |
USEFUL PRIMITIVES | |
Separators | |
sep_tab | |
comma | |
Generic primitives | |
eol | |
comment | |
empty | |
word | |
optval | |
target | |
fspath | |
ENTRIES | |
comma_sep_list | A comma separated list of options (opt=value or opt) |
record | A crypttab record |
lns | The crypttab lens |
filter |
Sample usage of this lens in augtool
ins 01 after /files/etc/crypttab/*[last()] set /files/etc/crypttab/01/target crypt_sda2 set /files/etc/crypttab/01/device /dev/sda2 set /files/etc/crypttab/01/password /dev/random set /files/etc/crypttab/01/opt swap
print /files/etc/crypttab/01
rm /files/etc/crypttab/*[device="/dev/sda2"]
This lens applies to /etc/crypttab. See filter.
let sep_tab = Sep.tab
let comma = Sep.comma
let eol = Util.eol
let comment = Util.comment
let empty = Util.empty
let word = Rx.word
let optval = /[A-Za-z0-9_.:-]+/
let target = Rx.device_name
let fspath = Rx.fspath
A comma separated list of options (opt=value or opt)
let comma_sep_list (l:string) = let value = [ label "value" . Util.del_str "=" . store optval ] in let lns = [ label l . store word . value? ] in Build.opt_list lns comma
A crypttab record
let record = [ seq "entry" . [ label "target" . store target ] . sep_tab . [ label "device" . store fspath ] . (sep_tab . [ label "password" . store fspath ] . ( sep_tab . comma_sep_list "opt")? )? . eol ]
The crypttab lens
let lns = ( empty | comment | record ) *