distro: use FindMountable() to get root filesystem
The `PartitionTable.FindMountable` method is the more generic version of `PartitionTable.RootFilesystem` which returns a `Mountable` interface, instead of a specific `Filesystem` object. This commit thus prepares for the more generic case, like when root is a Btrfs sub-volume. Co-Authored-By: Christian Kellner <christian@kellner.me>
This commit is contained in:
parent
b0899c5c59
commit
bd5b673a99
5 changed files with 18 additions and 10 deletions
|
|
@ -41,7 +41,11 @@ func qcow2Pipelines(t *imageType, customizations *blueprint.Customizations, opti
|
|||
}
|
||||
|
||||
func prependKernelCmdlineStage(pipeline *osbuild.Pipeline, t *imageType, pt *disk.PartitionTable) *osbuild.Pipeline {
|
||||
rootFsUUID := pt.RootFilesystem().UUID
|
||||
rootFs := pt.FindMountable("/")
|
||||
if rootFs == nil {
|
||||
panic("root filesystem must be defined for kernel-cmdline stage, this is a programming error")
|
||||
}
|
||||
rootFsUUID := rootFs.GetFSSpec().UUID
|
||||
kernelStage := osbuild.NewKernelCmdlineStage(osbuild.NewKernelCmdlineStageOptions(rootFsUUID, t.kernelOptions))
|
||||
pipeline.Stages = append([]*osbuild.Stage{kernelStage}, pipeline.Stages...)
|
||||
return pipeline
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue