diff --git a/internal/distro/rhel85/pipelines.go b/internal/distro/rhel85/pipelines.go index 66d687a64..5f4eaf018 100644 --- a/internal/distro/rhel85/pipelines.go +++ b/internal/distro/rhel85/pipelines.go @@ -978,7 +978,7 @@ func simplifiedInstallerBootISOTreePipeline(archivePipelineName, kver string) *o inputName := "root-tree" copyInputs := osbuild.NewCopyStagePipelineTreeInputs(inputName, "efiboot-tree") - copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, "efiboot-tree", &pt, loopback) + copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, "efiboot-tree", filename, &pt) p.AddStage(osbuild.NewCopyStage(copyOptions, copyInputs, copyDevices, copyMounts)) inputName = "coi" @@ -1232,7 +1232,7 @@ func liveImagePipeline(inputPipelineName string, outputFilename string, pt *disk } inputName := "root-tree" - copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, pt, loopback) + copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, outputFilename, pt) copyInputs := osbuild.NewCopyStagePipelineTreeInputs(inputName, inputPipelineName) p.AddStage(osbuild.NewCopyStage(copyOptions, copyInputs, copyDevices, copyMounts)) p.AddStage(bootloaderInstStage(outputFilename, pt, arch, kernelVer, copyDevices, copyMounts, loopback)) diff --git a/internal/distro/rhel86/pipelines.go b/internal/distro/rhel86/pipelines.go index fa46c151f..99a27328c 100644 --- a/internal/distro/rhel86/pipelines.go +++ b/internal/distro/rhel86/pipelines.go @@ -716,7 +716,7 @@ func simplifiedInstallerBootISOTreePipeline(archivePipelineName, kver string) *o inputName := "root-tree" copyInputs := osbuild.NewCopyStagePipelineTreeInputs(inputName, "efiboot-tree") - copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, "efiboot-tree", &pt, loopback) + copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, "efiboot-tree", filename, &pt) p.AddStage(osbuild.NewCopyStage(copyOptions, copyInputs, copyDevices, copyMounts)) inputName = "coi" @@ -956,7 +956,7 @@ func liveImagePipeline(inputPipelineName string, outputFilename string, pt *disk } inputName := "root-tree" - copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, pt, loopback) + copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, outputFilename, pt) copyInputs := osbuild.NewCopyStagePipelineTreeInputs(inputName, inputPipelineName) p.AddStage(osbuild.NewCopyStage(copyOptions, copyInputs, copyDevices, copyMounts)) p.AddStage(bootloaderInstStage(outputFilename, pt, arch, kernelVer, copyDevices, copyMounts, loopback)) diff --git a/internal/distro/rhel90/pipelines.go b/internal/distro/rhel90/pipelines.go index 55eb65d19..c21170179 100644 --- a/internal/distro/rhel90/pipelines.go +++ b/internal/distro/rhel90/pipelines.go @@ -716,7 +716,7 @@ func simplifiedInstallerBootISOTreePipeline(archivePipelineName, kver string, rn inputName := "root-tree" copyInputs := osbuild.NewCopyStagePipelineTreeInputs(inputName, "efiboot-tree") - copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, "efiboot-tree", &pt, loopback) + copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, "efiboot-tree", filename, &pt) p.AddStage(osbuild.NewCopyStage(copyOptions, copyInputs, copyDevices, copyMounts)) inputName = "coi" @@ -956,7 +956,7 @@ func liveImagePipeline(inputPipelineName string, outputFilename string, pt *disk } inputName := "root-tree" - copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, pt, loopback) + copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, outputFilename, pt) copyInputs := osbuild.NewCopyStagePipelineTreeInputs(inputName, inputPipelineName) p.AddStage(osbuild.NewCopyStage(copyOptions, copyInputs, copyDevices, copyMounts)) p.AddStage(bootloaderInstStage(outputFilename, pt, arch, kernelVer, copyDevices, copyMounts, loopback)) diff --git a/internal/distro/rhel90beta/pipelines.go b/internal/distro/rhel90beta/pipelines.go index 424de2d33..82911537d 100644 --- a/internal/distro/rhel90beta/pipelines.go +++ b/internal/distro/rhel90beta/pipelines.go @@ -1047,7 +1047,7 @@ func liveImagePipeline(inputPipelineName string, outputFilename string, pt *disk } inputName := "root-tree" - copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, pt, loopback) + copyOptions, copyDevices, copyMounts := osbuild.GenCopyFSTreeOptions(inputName, inputPipelineName, outputFilename, pt) copyInputs := osbuild.NewCopyStagePipelineTreeInputs(inputName, inputPipelineName) p.AddStage(osbuild.NewCopyStage(copyOptions, copyInputs, copyDevices, copyMounts)) p.AddStage(bootloaderInstStage(outputFilename, pt, arch, kernelVer, copyDevices, copyMounts, loopback)) diff --git a/internal/osbuild2/copy_stage.go b/internal/osbuild2/copy_stage.go index 9acf6a5a6..3e5b3d1aa 100644 --- a/internal/osbuild2/copy_stage.go +++ b/internal/osbuild2/copy_stage.go @@ -77,22 +77,16 @@ func NewCopyStagePipelineTreeInputs(inputName, inputPipeline string) *CopyStageI // GenCopyFSTreeOptions creates the options, inputs, devices, and mounts properties // for an org.osbuild.copy stage for a given source tree using a partition // table description to define the mounts -func GenCopyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable, device *Device) ( +func GenCopyFSTreeOptions(inputName, inputPipeline, filename string, pt *disk.PartitionTable) ( *CopyStageOptions, *Devices, *Mounts, ) { - // assume loopback device for simplicity since it's the only one currently supported - // panic if the conversion fails - devOptions, ok := device.Options.(*LoopbackDeviceOptions) - if !ok { - panic("GenCopyStageOptions: failed to convert device options to loopback options") - } devices := make(map[string]Device, len(pt.Partitions)) mounts := make([]Mount, 0, len(pt.Partitions)) genMounts := func(mnt disk.Mountable, path []disk.Entity) error { - stageDevices, name := getDevices(path, devOptions.Filename) + stageDevices, name := getDevices(path, filename) mountpoint := mnt.GetMountpoint() var mount *Mount