osbuild2: NewLVM2MetadataStage takes map of devices

Instead of just passing in a single device, pass in a `Devices`
type, i.e. a map of devices, since the LVM can be located on a
LUKS2 container which is located inside a partition so multiple
devices are needed to access it.

Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
This commit is contained in:
Christian Kellner 2022-02-11 11:31:37 +00:00 committed by Tom Gundersen
parent d48d6f22e1
commit 2314ca37d7

View file

@ -33,7 +33,7 @@ func (o LVM2MetadataStageOptions) validate() error {
return nil
}
func NewLVM2MetadataStage(options *LVM2MetadataStageOptions, device *Device) *Stage {
func NewLVM2MetadataStage(options *LVM2MetadataStageOptions, devices Devices) *Stage {
if err := options.validate(); err != nil {
panic(err)
}
@ -41,6 +41,6 @@ func NewLVM2MetadataStage(options *LVM2MetadataStageOptions, device *Device) *St
return &Stage{
Type: "org.osbuild.lvm2.metadata",
Options: options,
Devices: Devices{"device": *device},
Devices: devices,
}
}