Skip to content

Commit

Permalink
Use modprobe to load modules at initramfs stage.
Browse files Browse the repository at this point in the history
Signed-off-by: Yanhong Yang <yanhong.yang@suse.com>
  • Loading branch information
Yanhong Yang authored and futuretea committed Feb 15, 2023
1 parent 0894b15 commit 79ac596
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/config/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, " ")
Expand All @@ -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
Expand Down

0 comments on commit 79ac596

Please sign in to comment.