Skip to content

Commit

Permalink
providers/qemu: read modprobe path from distro package
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilbert committed Jun 29, 2023
1 parent 1159173 commit a1728b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
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

0 comments on commit a1728b0

Please sign in to comment.