Skip to content

Commit

Permalink
osbuild: remove unused NewGrub2StageOptions()
Browse files Browse the repository at this point in the history
This function was replaced with NewGrub2StageOptionsUnified()
in early 2022 and nothing in this code, osbuild-composer or
bootc-image-builder is using it. I would like to delete it
therefore.
  • Loading branch information
mvo5 committed Jan 16, 2024
1 parent 31b285a commit 79182e6
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions pkg/osbuild/grub2_stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/google/uuid"

"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/blueprint"
"github.com/osbuild/images/pkg/disk"
)

Expand Down Expand Up @@ -53,53 +52,6 @@ func NewGRUB2Stage(options *GRUB2StageOptions) *Stage {
}
}

func NewGrub2StageOptions(pt *disk.PartitionTable,
kernelOptions string,
kernel *blueprint.KernelCustomization,
kernelVer string,
uefi bool,
legacy string,
vendor string,
install bool) *GRUB2StageOptions {

rootFs := pt.FindMountable("/")
if rootFs == nil {
panic("root filesystem must be defined for grub2 stage, this is a programming error")
}

stageOptions := GRUB2StageOptions{
RootFilesystemUUID: uuid.MustParse(rootFs.GetFSSpec().UUID),
KernelOptions: kernelOptions,
Legacy: legacy,
}

bootFs := pt.FindMountable("/boot")
if bootFs != nil {
bootFsUUID := uuid.MustParse(bootFs.GetFSSpec().UUID)
stageOptions.BootFilesystemUUID = &bootFsUUID
}

if uefi {
stageOptions.UEFI = &GRUB2UEFI{
Vendor: vendor,
Install: install,
Unified: legacy == "", // force unified grub scheme for pure efi systems
}
}

if kernel != nil {
if kernel.Append != "" {
stageOptions.KernelOptions += " " + kernel.Append
}
stageOptions.SavedEntry = "ffffffffffffffffffffffffffffffff-" + kernelVer
stageOptions.Config = &GRUB2Config{
Default: "saved",
}
}

return &stageOptions
}

func NewGrub2StageOptionsUnified(pt *disk.PartitionTable,
kernelOptions string,
kernelVer string,
Expand Down

0 comments on commit 79182e6

Please sign in to comment.