From 6c49acbd51a13492e8098372d6f9e144dec57a17 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sun, 29 Sep 2019 14:31:24 +0200 Subject: [PATCH] pipeline: add locale stage This was left out from 7625d26ff547b40e7efc1f407c1c38aeb1f8bc3e. Signed-off-by: Tom Gundersen --- internal/pipeline/fix_bls_stage.go | 2 +- internal/pipeline/fstab_stage.go | 18 +++++++++++++----- internal/pipeline/locale_stage.go | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 internal/pipeline/locale_stage.go diff --git a/internal/pipeline/fix_bls_stage.go b/internal/pipeline/fix_bls_stage.go index 7ac3c3b86..fc19c1ea3 100644 --- a/internal/pipeline/fix_bls_stage.go +++ b/internal/pipeline/fix_bls_stage.go @@ -5,7 +5,7 @@ type FixBLSStageOptions struct { func (FixBLSStageOptions) isStageOptions() {} -func NewFIXBLSStage() *Stage { +func NewFixBLSStage() *Stage { return &Stage{ Name: "org.osbuild.fix-bls", } diff --git a/internal/pipeline/fstab_stage.go b/internal/pipeline/fstab_stage.go index 600599bc5..c1e367b0c 100644 --- a/internal/pipeline/fstab_stage.go +++ b/internal/pipeline/fstab_stage.go @@ -18,11 +18,19 @@ func NewFSTabStage(options *FSTabStageOptions) *Stage { type FSTabEntry struct { UUID uuid.UUID `json:"uuid"` VFSType string `json:"vfs_type"` - Path string `json:"path"` - Freq int64 `json:"freq"` - PassNo int64 `json:"passno"` + Path string `json:"path,omitempty"` + Options string `json:"options,omitempty"` + Freq uint64 `json:"freq,omitempty"` + PassNo uint64 `json:"passno,omitempty"` } -func (options *FSTabStageOptions) AddEntry(entry *FSTabEntry) { - options.FileSystems = append(options.FileSystems, entry) +func (options *FSTabStageOptions) AddFilesystem(id uuid.UUID, vfsType string, path string, opts string, freq uint64, passNo uint64) { + options.FileSystems = append(options.FileSystems, &FSTabEntry{ + UUID: id, + VFSType: vfsType, + Path: path, + Options: opts, + Freq: freq, + PassNo: passNo, + }) } diff --git a/internal/pipeline/locale_stage.go b/internal/pipeline/locale_stage.go new file mode 100644 index 000000000..adb245798 --- /dev/null +++ b/internal/pipeline/locale_stage.go @@ -0,0 +1,20 @@ +package pipeline + +type LocaleStageOptions struct { + Language string `json:"language"` +} + +func (LocaleStageOptions) isStageOptions() {} + +func NewLocaleStageOptions(language string) *LocaleStageOptions { + return &LocaleStageOptions{ + Language: language, + } +} + +func NewLocaleStage(options *LocaleStageOptions) *Stage { + return &Stage{ + Name: "org.osbuild.locale", + Options: options, + } +}