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

Add configurable kernel modules list #13

Closed
d4s opened this issue Nov 8, 2017 · 5 comments
Closed

Add configurable kernel modules list #13

d4s opened this issue Nov 8, 2017 · 5 comments

Comments

@d4s
Copy link
Contributor

d4s commented Nov 8, 2017

Some distros have compiled-in kernel modules like ubuntu: CONFIG_VIRTIO=y

Fakemachine crashes with following log:

2017/11/08 16:30:47 open failed: /lib/modules/4.10.0-38-generic/kernel/drivers/virtio/virtio.ko - open /lib/modules/4.10.0-38-generic/kernel/drivers/virtio/virtio.ko: no such file or directory
--- FAIL: TestSuccessfullCommand (0.00s)
panic: open failed: /lib/modules/4.10.0-38-generic/kernel/drivers/virtio/virtio.ko - open /lib/modules/4.10.0-38-generic/kernel/drivers/virtio/virtio.ko: no such file or directory [recovered]
    panic: open failed: /lib/modules/4.10.0-38-generic/kernel/drivers/virtio/virtio.ko - open /lib/modules/4.10.0-38-generic/kernel/drivers/virtio/virtio.ko: no such file or directory

goroutine 5 [running]:
panic(0x64b6a0, 0xc4200f52e0)
    /usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
testing.tRunner.func1(0xc420094180)
    /usr/lib/go-1.7/src/testing/testing.go:579 +0x25d
panic(0x64b6a0, 0xc4200f52e0)
    /usr/lib/go-1.7/src/runtime/panic.go:458 +0x243
log.Panicf(0x6ac7ed, 0x14, 0xc420053800, 0x2, 0x2)
    /usr/lib/go-1.7/src/log/log.go:327 +0xe3
github.com/go-debos/fakemachine/cpio.(*WriterHelper).CopyFileTo(0xc42000d5b0, 0xc420016d00, 0x3e, 0xc420016d00, 0x3e, 0x0, 0x0)
    /home/fredo/Documents/bos0009/go/src/github.com/go-debos/fakemachine/cpio/writerhelper.go:126 +0x1b1
github.com/go-debos/fakemachine/cpio.(*WriterHelper).CopyFile(0xc42000d5b0, 0xc420016d00, 0x3e, 0xc420016d00, 0x3e)
    /home/fredo/Documents/bos0009/go/src/github.com/go-debos/fakemachine/cpio/writerhelper.go:150 +0x49
github.com/go-debos/fakemachine.(*Machine).writerKernelModules(0xc420096400, 0xc42000d5b0, 0x2a, 0x6b64fc)
    /home/fredo/Documents/bos0009/go/src/github.com/go-debos/fakemachine/machine.go:326 +0x185
github.com/go-debos/fakemachine.(*Machine).startup(0xc420096400, 0x6a7933, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/fredo/Documents/bos0009/go/src/github.com/go-debos/fakemachine/machine.go:461 +0xae2
github.com/go-debos/fakemachine.(*Machine).Run(0xc420096400, 0x6a7933, 0x4, 0x5a032327, 0x10ad05ac, 0xc42002ff78)
    /home/fredo/Documents/bos0009/go/src/github.com/go-debos/fakemachine/machine.go:539 +0x5a
github.com/go-debos/fakemachine.TestSuccessfullCommand(0xc420094180)
    /home/fredo/Documents/bos0009/go/src/github.com/go-debos/fakemachine/machine_test.go:16 +0x48
testing.tRunner(0xc420094180, 0x6cacc0)
    /usr/lib/go-1.7/src/testing/testing.go:610 +0x81
created by testing.(*T).Run
    /usr/lib/go-1.7/src/testing/testing.go:646 +0x2ec
exit status 2
FAIL    github.com/go-debos/fakemachine    0.009s
@d4s d4s closed this as completed Nov 8, 2017
@d4s d4s reopened this Nov 15, 2017
@d4s
Copy link
Contributor Author

d4s commented Nov 15, 2017

The same thing for hardcoded libraries. On ALTLinux I have:

$ ./debos test.yaml 
2017/11/15 16:22:07 open failed: /lib/x86_64-linux-gnu/libc.so.6 - open /lib/x86_64-linux-gnu/libc.so.6: no such file or directory

@sjoerdsimons
Copy link
Member

That's a seperate issue right ;)

@johnp
Copy link

johnp commented Jun 27, 2018

Similar problem on Arch Linux, but it has the modules xz compressed:

$ debos simple.yaml
2018/06/27 22:44:21 open failed: /usr/lib/modules/4.16.16-1-ck-haswell/kernel/drivers/virtio/virtio.ko - open /usr/lib/modules/4.16.16-1-ck-haswell/kernel/drivers/virtio/virtio.ko: no such file or directory
$ la /usr/lib/modules/4.16.16-1-ck-haswell/kernel/drivers/virtio/virtio.ko.xz
.rw-r--r-- 4.5k root root 16 Jun 14:24 /usr/lib/modules/4.16.16-1-ck-haswell/kernel/drivers/virtio/virtio.ko.xz

edit: ran into half a dozen other problems after unzipping; for any other non-debian users: best to just run this in a vm for now. Too many debianisms.
edit2: fakemachine does not run in a vm either.

@andrewshadura
Copy link
Contributor

Probably it should consult the running kernel to check if it has the module compiled in.

@ant9000
Copy link

ant9000 commented Feb 7, 2019

Standard test for modules is

modinfo virtio_console

but you can test for in-kernel support by grepping for the symbols:

cat /proc/kallsyms |grep virtio_console

Tested with non privileged user on Ubuntu 14.04 and 18.04 - it works.

Antonio

andrewshadura added a commit to andrewshadura/fakemachine that referenced this issue Feb 28, 2020
Several distributions (including Ubuntu) ship some of the modules we
rely on compiled into the kernel. Since these modules are listed in
modules.builtin, it’s very easy to detect and skip them.

This change fixes go-debos#13.

Signed-off-by: Andrej Shadura <[email protected]>
andrewshadura added a commit to andrewshadura/fakemachine that referenced this issue Feb 28, 2020
Several distributions (including Ubuntu) ship some of the modules we
rely on compiled into the kernel. Since these modules are listed in
modules.builtin, it’s very easy to detect and skip them.

This change fixes go-debos#13 and supersedes go-debos#36.

Signed-off-by: Andrej Shadura <[email protected]>
andrewshadura added a commit to andrewshadura/fakemachine that referenced this issue Feb 28, 2020
Several distributions (including Ubuntu) ship some of the modules we
rely on compiled into the kernel. Since these modules are listed in
modules.builtin, it’s very easy to detect and skip them.

This change fixes go-debos#13 and supersedes go-debos#36.

Signed-off-by: Andrej Shadura <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants