osbuild: introduce kernel-cmdline stage
This stage can be used to set kernel boot parameters.
This commit is contained in:
parent
fcd5ff76ac
commit
d20682fcae
2 changed files with 35 additions and 0 deletions
19
internal/osbuild/kernel_cmdline_stage.go
Normal file
19
internal/osbuild/kernel_cmdline_stage.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package osbuild
|
||||
|
||||
// KernelCmdlineStageOptions describe how to create kernel-cmdline stage
|
||||
//
|
||||
// Configures the kernel boot parameters, also known as the kernel command line.
|
||||
type KernelCmdlineStageOptions struct {
|
||||
RootFsUUID string `json:"root_fs_uuid,omitempty"`
|
||||
KernelOpts string `json:"kernel_opts,omitempty"`
|
||||
}
|
||||
|
||||
func (KernelCmdlineStageOptions) isStageOptions() {}
|
||||
|
||||
// NewKernelCmdlineStage creates a new kernel-cmdline Stage object.
|
||||
func NewKernelCmdlineStage(options *KernelCmdlineStageOptions) *Stage {
|
||||
return &Stage{
|
||||
Name: "org.osbuild.kernel-cmdline",
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
16
internal/osbuild/kernel_cmdline_stage_test.go
Normal file
16
internal/osbuild/kernel_cmdline_stage_test.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package osbuild
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewKernelCmdlineStage(t *testing.T) {
|
||||
expectedStage := &Stage{
|
||||
Name: "org.osbuild.kernel-cmdline",
|
||||
Options: &KernelCmdlineStageOptions{},
|
||||
}
|
||||
actualStage := NewKernelCmdlineStage(&KernelCmdlineStageOptions{})
|
||||
assert.Equal(t, expectedStage, actualStage)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue