Skip to content

Commit

Permalink
backend: remove InitrdModules() in favour of InitModules()
Browse files Browse the repository at this point in the history
With recently the former was reworked from list of modules and their
respective dependencies (all of which including relative path and
extension) to a modules that we use.

The only difference between the two is - virtio and virtio_ring. Both of
those are low level dependencies of the other virtio modules.

So just remove the extra function/array and consistently use
InitModules() across the board.

Signed-off-by: Emil Velikov <[email protected]>
  • Loading branch information
evelikov-work authored and obbardc committed Apr 13, 2022
1 parent 8719c1b commit 0ef6635
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
5 changes: 1 addition & 4 deletions backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ type backend interface {
// The path to the modules
ModulePath() (moddir string, err error)

// A list of modules to include in the initrd
InitrdModules() []string

// A list of udev rules
UdevRules() []string

Expand All @@ -87,7 +84,7 @@ type backend interface {
// The parameters used to mount a specific volume into the machine
MountParameters(mount mountPoint) (fstype string, options []string)

// A list of modules which should be probed in the initscript
// A list of modules to be added to initrd and probed in the initscript
InitModules() []string

// A list of additional volumes which should mounted in the initscript
Expand Down
9 changes: 0 additions & 9 deletions backend_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ func (b qemuBackend) ModulePath() (string, error) {
return moddir, nil
}

func (b qemuBackend) InitrdModules() []string {
return []string{"virtio_console",
"virtio",
"virtio_pci",
"virtio_ring",
"9p",
"9pnet_virtio"}
}

func (b qemuBackend) UdevRules() []string {
udevRules := []string{}

Expand Down
4 changes: 0 additions & 4 deletions backend_uml.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ func (b umlBackend) SlirpHelperPath() (string, error) {
return exec.LookPath("libslirp-helper")
}

func (b umlBackend) InitrdModules() []string {
return []string{}
}

func (b umlBackend) UdevRules() []string {
udevRules := []string{}

Expand Down
2 changes: 1 addition & 1 deletion machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ func (m *Machine) startup(command string, extracontent [][2]string) (int, error)
"/etc/resolv.conf",
0755)

err = m.writerKernelModules(w, kernelModuleDir, backend.InitrdModules())
err = m.writerKernelModules(w, kernelModuleDir, backend.InitModules())
if err != nil {
return -1, err
}
Expand Down

0 comments on commit 0ef6635

Please sign in to comment.