This repository was archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 651
This repository was archived by the owner on Oct 11, 2023. It is now read-only.
loading kernel modules with parameters #2295
Copy link
Copy link
Closed
Description
The code that is responsible for loading kernel modules from the rancher.modules list does not support loading parameters:
Lines 43 to 72 in 82aaa41
| func loadModules(cfg *config.CloudConfig) (*config.CloudConfig, error) { | |
| mounted := map[string]bool{} | |
| f, err := os.Open("/proc/modules") | |
| if err != nil { | |
| return cfg, err | |
| } | |
| defer f.Close() | |
| reader := bufio.NewScanner(f) | |
| for reader.Scan() { | |
| mounted[strings.SplitN(reader.Text(), " ", 2)[0]] = true | |
| } | |
| for _, module := range cfg.Rancher.Modules { | |
| if mounted[module] { | |
| continue | |
| } | |
| log.Debugf("Loading module %s", module) | |
| cmd := exec.Command("modprobe", module) | |
| cmd.Stdout = os.Stdout | |
| cmd.Stderr = os.Stderr | |
| if err := cmd.Run(); err != nil { | |
| log.Errorf("Could not load module %s, err %v", module, err) | |
| } | |
| } | |
| return cfg, nil | |
| } |
Can we make it support this?
Use-case:
$ modprobe nbd nbds_max=1024