From 79ac59671bbaebf61d6ca2f5f209d3861dde7a48 Mon Sep 17 00:00:00 2001 From: Yanhong Yang Date: Wed, 8 Feb 2023 10:57:06 +0800 Subject: [PATCH] Use modprobe to load modules at initramfs stage. Signed-off-by: Yanhong Yang --- pkg/config/cos.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/config/cos.go b/pkg/config/cos.go index a27fad9a8..4a63c902f 100644 --- a/pkg/config/cos.go +++ b/pkg/config/cos.go @@ -137,7 +137,6 @@ func ConvertToCOS(config *HarvesterConfig) (*yipSchema.YipConfig, error) { } initramfs.Hostname = cfg.OS.Hostname - initramfs.Modules = cfg.OS.Modules initramfs.Sysctl = cfg.OS.Sysctls if len(cfg.OS.NTPServers) > 0 { initramfs.TimeSyncd["NTP"] = strings.Join(cfg.OS.NTPServers, " ") @@ -158,6 +157,11 @@ func ConvertToCOS(config *HarvesterConfig) (*yipSchema.YipConfig, error) { initramfs.Environment = cfg.OS.Environment + // Use modprobe to load modules as a temporary solution + for _, module := range cfg.OS.Modules { + initramfs.Commands = append(initramfs.Commands, "modprobe "+module) + } + _, err = UpdateManagementInterfaceConfig(&initramfs, cfg.ManagementInterface, false) if err != nil { return nil, err