Disk_config lens for Augeas

Raphaël Pinson raphink at gmail.com
Thu Sep 1 15:35:47 CEST 2011


Hi all,

As some of you may know, the Augeas projet [0] aims to provide a generic
parsing API for all kinds of configuration files. Augeas uses grammar files
called "lenses" to parse configuration files.

This mail is to inform you that a new lens for FAI disk_config files was
added to Augeas. It can currently be found in the git repository of the
Augeas project [1]. This lens will turn disk_config files into a tree that
can be parsed with xpath using Augeas.

For example, the following disk_config file:

#
# NEW FAI PARTITION SYSTEM
#
# Include LVM/RAID, Generic disk naming
#
# http://faiwiki.debian.net/index.php/Setup-storage
#

disk_config disk1 bootable:1
primary  /boot         50    ext3   rw
primary  swap          512   swap   sw
primary  /             260   ext3   defaults,errors=remount-ro
logical  /usr          2G    ext3   rw
logical  /usr/local    1G    ext3   rw
logical  /var          2G    ext3   rw
logical  /var/log      10G   ext3   rw
logical  /var/www      20G   ext3   rw
logical  /tmp          500   ext3   rw
logical  /home         10G-  ext3   rw


is parsed as:

/files/EXAMPLE
/files/EXAMPLE/#comment[1] = "NEW FAI PARTITION SYSTEM"
/files/EXAMPLE/#comment[2] = "Include LVM/RAID, Generic disk naming"
/files/EXAMPLE/#comment[3] = "
http://faiwiki.debian.net/index.php/Setup-storage"
/files/EXAMPLE/disk_config = "disk1"
/files/EXAMPLE/disk_config/bootable = "1"
/files/EXAMPLE/disk_config/primary[1]
/files/EXAMPLE/disk_config/primary[1]/mountpoint = "/boot"
/files/EXAMPLE/disk_config/primary[1]/size = "50"
/files/EXAMPLE/disk_config/primary[1]/filesystem = "ext3"
/files/EXAMPLE/disk_config/primary[1]/mount_options
/files/EXAMPLE/disk_config/primary[1]/mount_options/1 = "rw"
/files/EXAMPLE/disk_config/primary[2]
/files/EXAMPLE/disk_config/primary[2]/mountpoint = "swap"
/files/EXAMPLE/disk_config/primary[2]/size = "512"
/files/EXAMPLE/disk_config/primary[2]/filesystem = "swap"
/files/EXAMPLE/disk_config/primary[2]/mount_options
/files/EXAMPLE/disk_config/primary[2]/mount_options/1 = "sw"
/files/EXAMPLE/disk_config/primary[3]
/files/EXAMPLE/disk_config/primary[3]/mountpoint = "/"
/files/EXAMPLE/disk_config/primary[3]/size = "260"
/files/EXAMPLE/disk_config/primary[3]/filesystem = "ext3"
/files/EXAMPLE/disk_config/primary[3]/mount_options
/files/EXAMPLE/disk_config/primary[3]/mount_options/1 = "defaults"
/files/EXAMPLE/disk_config/primary[3]/mount_options/2 = "errors"
/files/EXAMPLE/disk_config/primary[3]/mount_options/2/value = "remount-ro"
/files/EXAMPLE/disk_config/logical[1]
/files/EXAMPLE/disk_config/logical[1]/mountpoint = "/usr"
/files/EXAMPLE/disk_config/logical[1]/size = "2G"
/files/EXAMPLE/disk_config/logical[1]/filesystem = "ext3"
/files/EXAMPLE/disk_config/logical[1]/mount_options
/files/EXAMPLE/disk_config/logical[1]/mount_options/1 = "rw"
/files/EXAMPLE/disk_config/logical[2]
/files/EXAMPLE/disk_config/logical[2]/mountpoint = "/usr/local"
/files/EXAMPLE/disk_config/logical[2]/size = "1G"
/files/EXAMPLE/disk_config/logical[2]/filesystem = "ext3"
/files/EXAMPLE/disk_config/logical[2]/mount_options
/files/EXAMPLE/disk_config/logical[2]/mount_options/1 = "rw"
/files/EXAMPLE/disk_config/logical[3]
/files/EXAMPLE/disk_config/logical[3]/mountpoint = "/var"
/files/EXAMPLE/disk_config/logical[3]/size = "2G"
/files/EXAMPLE/disk_config/logical[3]/filesystem = "ext3"
/files/EXAMPLE/disk_config/logical[3]/mount_options
/files/EXAMPLE/disk_config/logical[3]/mount_options/1 = "rw"
/files/EXAMPLE/disk_config/logical[4]
/files/EXAMPLE/disk_config/logical[4]/mountpoint = "/var/log"
/files/EXAMPLE/disk_config/logical[4]/size = "10G"
/files/EXAMPLE/disk_config/logical[4]/filesystem = "ext3"
/files/EXAMPLE/disk_config/logical[4]/mount_options
/files/EXAMPLE/disk_config/logical[4]/mount_options/1 = "rw"
/files/EXAMPLE/disk_config/logical[5]
/files/EXAMPLE/disk_config/logical[5]/mountpoint = "/var/www"
/files/EXAMPLE/disk_config/logical[5]/size = "20G"
/files/EXAMPLE/disk_config/logical[5]/filesystem = "ext3"
/files/EXAMPLE/disk_config/logical[5]/mount_options
/files/EXAMPLE/disk_config/logical[5]/mount_options/1 = "rw"
/files/EXAMPLE/disk_config/logical[6]
/files/EXAMPLE/disk_config/logical[6]/mountpoint = "/tmp"
/files/EXAMPLE/disk_config/logical[6]/size = "500"
/files/EXAMPLE/disk_config/logical[6]/filesystem = "ext3"
/files/EXAMPLE/disk_config/logical[6]/mount_options
/files/EXAMPLE/disk_config/logical[6]/mount_options/1 = "rw"
/files/EXAMPLE/disk_config/logical[7]
/files/EXAMPLE/disk_config/logical[7]/mountpoint = "/home"
/files/EXAMPLE/disk_config/logical[7]/size = "10G-"
/files/EXAMPLE/disk_config/logical[7]/filesystem = "ext3"
/files/EXAMPLE/disk_config/logical[7]/mount_options
/files/EXAMPLE/disk_config/logical[7]/mount_options/1 = "rw"


Bug reports, suggestions, patches are all welcome.


Cheers,


Raphaël Pinson


[0] http://www.augeas.net
[1]
http://git.fedorahosted.org/git/?p=augeas.git;a=blob;f=lenses/fai_diskconfig.aug;h=447548d0670576b26e8008fc472047d47c923a18;hb=dc7d47a6a4be4473c3a732b1402e8d149936a6c6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-koeln.de/pipermail/linux-fai-devel/attachments/20110901/91e446a1/attachment.html>


More information about the linux-fai-devel mailing list