Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

providers/qemu: read modprobe path from distro package #1656

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Starting with this release, ignition-validate binaries are signed with the
- Correctly document Tang `advertisement` field as optional
- Fix failure disabling nonexistent unit with systemd ≥ 252
- Don't relabel a mount point that already exists
- qemu: Use distro-specific `modprobe` path when loading kernel modules

### Test changes

Expand Down
3 changes: 2 additions & 1 deletion internal/providers/qemu/qemu_blockdev.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"time"

"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
"github.com/coreos/ignition/v2/internal/distro"
"github.com/coreos/ignition/v2/internal/log"
"github.com/coreos/ignition/v2/internal/platform"
"github.com/coreos/ignition/v2/internal/providers/util"
Expand All @@ -52,7 +53,7 @@ func init() {
func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
f.Logger.Warning("Fetching the Ignition config via the Virtio block driver is currently experimental and subject to change.")

_, err := f.Logger.LogCmd(exec.Command("modprobe", "virtio_blk"), "loading Virtio block driver module")
_, err := f.Logger.LogCmd(exec.Command(distro.ModprobeCmd(), "virtio_blk"), "loading Virtio block driver module")
if err != nil {
return types.Config{}, report.Report{}, err
}
Expand Down
3 changes: 2 additions & 1 deletion internal/providers/qemu/qemu_fwcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"time"

"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
"github.com/coreos/ignition/v2/internal/distro"
"github.com/coreos/ignition/v2/internal/platform"
"github.com/coreos/ignition/v2/internal/providers/util"
"github.com/coreos/ignition/v2/internal/resource"
Expand All @@ -51,7 +52,7 @@ func init() {

func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
// load qemu_fw_cfg module
_, err := f.Logger.LogCmd(exec.Command("modprobe", "qemu_fw_cfg"), "loading QEMU firmware config module")
_, err := f.Logger.LogCmd(exec.Command(distro.ModprobeCmd(), "qemu_fw_cfg"), "loading QEMU firmware config module")
if err != nil {
return types.Config{}, report.Report{}, err
}
Expand Down