Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build kernel module with kernel sources from linuxkit/kernel:4.19.76 #6099

Closed
etherai opened this issue Mar 23, 2020 · 5 comments
Closed

Comments

@etherai
Copy link

etherai commented Mar 23, 2020

Expected behavior

Attempting to build kernel module results in a kernel module that cannot be inserted.

# modprobe wireguard
modprobe: can't load module wireguard (extra/wireguard.ko): invalid module format

Issue description here: linuxkit/linuxkit#3402

In the above issue I found https://hub.docker.com/r/docker/for-desktop-kernel/tags?page=1&name=4.19.76

but it is not clear which container has the sources that match the kernel that is shipping with Docker for Windows. I tried a couple and still got the magic version mismatch error on attempting to load the module.

Thanks for the guidance!

Actual behavior

It should be obvious which kernel headers I should be building against.

Information

  • Windows Version: Windows 10
  • Docker Desktop Version: 2.2.0.4
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM No
@djs55
Copy link

djs55 commented Mar 23, 2020

Thanks for your report. It's not currently obvious which image corresponds to which version -- I'll have to think about where to put that information.

In kernel 2.2.0.4 the kernel is https://hub.docker.com/layers/docker/for-desktop-kernel/4.19.76-d665d2cbc4fe70f8ab08ba2cd82d052e41d2a704-amd64/images/sha256-c42bff3d5f285dcb1dde0937a8b99e2f51f1f764bd9b847c5d188fd02bb74136?context=explore

To look inside and see the headers + source:

$ docker pull docker/for-desktop-kernel:4.19.76-d665d2cbc4fe70f8ab08ba2cd82d052e41d2a704-amd64
$ docker create --name linux docker/for-desktop-kernel:4.19.76-d665d2cbc4fe70f8ab08ba2cd82d052e41d2a704-amd64 /bin/sh
$ docker cp linux:/ .
$ ls
System.map		intel-ucode-license.txt	kernel-dev.tar		kernel.tar		sys
dev			intel-ucode.cpio	kernel-headers.tar	linux.tar.xz		wireguard.tar.xz
etc			kernel			kernel-source-info	proc

That should be enough to completely recompile the kernel. To make a loadable module I'm not 100% sure as there may be an interaction with the RANDSTRUCT stuff -- let me know how you get on and if there is more info needed.

In future we'd like to use a linuxkit 5.4 kernel directly -- this 4.19 has a couple of backports: mostly FUSE bugfixes plus the virtio-blk DISCARD implementation.

@etherai
Copy link
Author

etherai commented Mar 23, 2020

Thank you, @djs55! With that kernel image I was able to successfully build a working kernel module.

@djs55
Copy link

djs55 commented Mar 23, 2020

@etherai thanks for the confirmation, and sorry for the hassle!

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants