From a1728b06fc284dd02aacc2d10af4756a343b46d4 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 28 Jun 2023 04:14:18 -0400 Subject: [PATCH] providers/qemu: read modprobe path from distro package --- docs/release-notes.md | 1 + internal/providers/qemu/qemu_blockdev.go | 3 ++- internal/providers/qemu/qemu_fwcfg.go | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 46f022021..b5ddb1f9c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -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 diff --git a/internal/providers/qemu/qemu_blockdev.go b/internal/providers/qemu/qemu_blockdev.go index 1e54424b6..778a151df 100644 --- a/internal/providers/qemu/qemu_blockdev.go +++ b/internal/providers/qemu/qemu_blockdev.go @@ -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" @@ -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 } diff --git a/internal/providers/qemu/qemu_fwcfg.go b/internal/providers/qemu/qemu_fwcfg.go index 517003d0e..9451981b6 100644 --- a/internal/providers/qemu/qemu_fwcfg.go +++ b/internal/providers/qemu/qemu_fwcfg.go @@ -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" @@ -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 }