osbuild/fstab: add filesystem label support

Exactly one of the UUID or the label must be set. The helpers are kept
the same and only supports the UUID for now, but these should likely be
dropped in favor of open-coding the structs anyway.

We do not enforce that the UUID or label is set, but osbuild will.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-05-21 14:34:13 +02:00
parent 8e0dd790b7
commit fd7320aaa1

View file

@ -22,7 +22,8 @@ func NewFSTabStage(options *FSTabStageOptions) *Stage {
// An FSTabEntry represents one line in /etc/fstab. With the one exception
// that the the spec field must be represented as an UUID.
type FSTabEntry struct {
UUID string `json:"uuid"`
UUID string `json:"uuid,omitempty"`
Label string `json:"label,omitempty"`
VFSType string `json:"vfs_type"`
Path string `json:"path,omitempty"`
Options string `json:"options,omitempty"`