mirror of
https://github.com/rancher/os.git
synced 2025-07-10 05:13:03 +00:00
Merge pull request #1441 from joshwget/load-modules-after-running-preparefs
Load modules after running PrepareFs
This commit is contained in:
commit
b431254cc4
@ -59,7 +59,10 @@ func loadModules(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
}
|
||||
|
||||
log.Debugf("Loading module %s", module)
|
||||
if err := exec.Command("modprobe", module).Run(); err != nil {
|
||||
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)
|
||||
}
|
||||
}
|
||||
@ -356,10 +359,10 @@ func RunInit() error {
|
||||
|
||||
return config.LoadConfig(), nil
|
||||
},
|
||||
loadModules,
|
||||
func(c *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
return c, dfs.PrepareFs(&mountConfig)
|
||||
},
|
||||
loadModules,
|
||||
func(c *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
network.SetProxyEnvironmentVariables(c)
|
||||
return c, nil
|
||||
|
5
tests/assets/test_27/cloud-config.yml
Normal file
5
tests/assets/test_27/cloud-config.yml
Normal file
@ -0,0 +1,5 @@
|
||||
#cloud-config
|
||||
rancher:
|
||||
modules: [btrfs]
|
||||
ssh_authorized_keys:
|
||||
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC85w9stZyiLQp/DkVO6fqwiShYcj1ClKdtCqgHtf+PLpJkFReSFu8y21y+ev09gsSMRRrjF7yt0pUHV6zncQhVeqsZtgc5WbELY2DOYUGmRn/CCvPbXovoBrQjSorqlBmpuPwsStYLr92Xn+VVsMNSUIegHY22DphGbDKG85vrKB8HxUxGIDxFBds/uE8FhSy+xsoyT/jUZDK6pgq2HnGl6D81ViIlKecpOpWlW3B+fea99ADNyZNVvDzbHE5pcI3VRw8u59WmpWOUgT6qacNVACl8GqpBvQk8sw7O/X9DSZHCKafeD9G5k+GYbAUz92fKWrx/lOXfUXPS3+c8dRIF
|
13
tests/modules_test.go
Normal file
13
tests/modules_test.go
Normal file
@ -0,0 +1,13 @@
|
||||
package integration
|
||||
|
||||
import . "gopkg.in/check.v1"
|
||||
|
||||
func (s *QemuSuite) TestKernelParameterModule(c *C) {
|
||||
s.RunQemu(c, "--append", "rancher.modules=[btrfs]")
|
||||
s.CheckCall(c, "lsmod | grep btrfs")
|
||||
}
|
||||
|
||||
func (s *QemuSuite) TestCloudConfigModule(c *C) {
|
||||
s.RunQemu(c, "--cloud-config", "./tests/assets/test_27/cloud-config.yml")
|
||||
s.CheckCall(c, "lsmod | grep btrfs")
|
||||
}
|
Loading…
Reference in New Issue
Block a user