Skip to content

Commit a1728b0

Browse files
committed
providers/qemu: read modprobe path from distro package
1 parent 1159173 commit a1728b0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

docs/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Starting with this release, ignition-validate binaries are signed with the
2727
- Correctly document Tang `advertisement` field as optional
2828
- Fix failure disabling nonexistent unit with systemd ≥ 252
2929
- Don't relabel a mount point that already exists
30+
- qemu: Use distro-specific `modprobe` path when loading kernel modules
3031

3132
### Test changes
3233

internal/providers/qemu/qemu_blockdev.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"time"
2929

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

55-
_, err := f.Logger.LogCmd(exec.Command("modprobe", "virtio_blk"), "loading Virtio block driver module")
56+
_, err := f.Logger.LogCmd(exec.Command(distro.ModprobeCmd(), "virtio_blk"), "loading Virtio block driver module")
5657
if err != nil {
5758
return types.Config{}, report.Report{}, err
5859
}

internal/providers/qemu/qemu_fwcfg.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"time"
3131

3232
"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
33+
"github.com/coreos/ignition/v2/internal/distro"
3334
"github.com/coreos/ignition/v2/internal/platform"
3435
"github.com/coreos/ignition/v2/internal/providers/util"
3536
"github.com/coreos/ignition/v2/internal/resource"
@@ -51,7 +52,7 @@ func init() {
5152

5253
func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
5354
// load qemu_fw_cfg module
54-
_, err := f.Logger.LogCmd(exec.Command("modprobe", "qemu_fw_cfg"), "loading QEMU firmware config module")
55+
_, err := f.Logger.LogCmd(exec.Command(distro.ModprobeCmd(), "qemu_fw_cfg"), "loading QEMU firmware config module")
5556
if err != nil {
5657
return types.Config{}, report.Report{}, err
5758
}

0 commit comments

Comments
 (0)