$darkmode
Elektra 0.11.0
|
This plugin is an implementation of a parser and generator of the /etc/fstab file.
See installation. The package is called libelektra5-extra
.
(Deprecated, remove this section after it is reimplemented in the new way)
For each device in fstab elektra will store the following keys:
Each represents a column in fstab.
The pseudoname can be any name for setting keys, the will be generated when getting keys, so don't expect the same name.
the directory /
will be called rootfs
all swap devices will be called swapXX
with a number from 00 on for XX
otherwise the mount point without the '/' character will be used.
At the other point there is the issue with the pseudonames, you can't rely on the pseudoname you have set.
The biggest issue is that you can't change or delete existing entries. All entries you set will be appended to the other filesystems.
So if you get the filesystems and change the type of the file system of the rootfs and set it again the resulting fstab will be like:
which will be not like you desired!
setmntent is used, so it is only conforming to BSD 4.3 and linux and you can't use any comments.
Specification:
Example: A fstab that looks like:
would have a key name that is an array (so the value is the number of children, in this case 1):
with the array entry:
So when following line is added
Implementation hint: use keyAddBaseName()
to get escaping of /
, then add array items below it
If a mount point exists more than once (that could be proc, swap or overlay mount points) the array below gets incremented (otherwise #0 is used for every unique entry).
The order of the array must, of course, be preserved. Other lines may be reordered for now, a proper "order" could be done later.
Spaces in the names are replaced by \040 in the fstab.
Mount the plugin: