amluto / virtme

An easy way to virtualize the running system
GNU General Public License v2.0
330 stars 66 forks source link

modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/5.7.0-rc2+/modules.builtin.bin' #59

Open kamomil opened 4 years ago

kamomil commented 4 years ago

I run virtme with:

virtme-run --kdir=$KBUILD_OUTPUT --mods=auto --rwdir=../blabla/ --cwd ../blabla --qemu-opts -m 10G

Then when loading a module with modprobe, I get the error:

modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/5.7.0-rc2+/modules.builtin.bin'
amluto commented 4 years ago

Are you doing a normal in-place make for your kernel or are you directing the output elsewhere? If the latter, how are you doing it?

kamomil commented 4 years ago

Hi, my make script is

export O=/home/dafna/git/kbuild/media-x86
export KBUILD_OUTPUT=/home/dafna/git/kbuild/media-x86
export CROSS_COMPILE=x86_64-linux-gnu-
export ARCH=x86
make -j9

Those errors are just warnings, I am able to load the module

gibait commented 1 year ago

Similar problem here, when i run: virtme-run --name fedora --kdir ./ --mods auto --overlay-rwdir /etc --overlay-rwdir /home --overlay-rwdir /opt --overlay-rwdir /srv --overlay-rwdir /usr --overlay-rwdir /var --user giba --qemu-opts -m 4096 -smp 8 -s -qmp tcp:localhost:3636,server,nowait

I get the following error:

Traceback (most recent call last):
  File "/usr/local/bin/virtme-run", line 33, in <module>
    sys.exit(load_entry_point('virtme==0.1.1', 'console_scripts', 'virtme-run')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/virtme/commands/run.py", line 649, in main
    return do_it()
           ^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/virtme/commands/run.py", line 303, in do_it
    kernel = find_kernel_and_mods(arch, args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/virtme/commands/run.py", line 212, in find_kernel_and_mods
    is_file_more_recent(mod_file, virtme_mod_file):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/virtme/commands/run.py", line 146, in is_file_more_recent
    return os.stat(a).st_mtime > os.stat(b).st_mtime
                                 ^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './.virtme_mods/lib/modules/0.0.0/modules.dep'

Both using --defconfig and a custom config with proper flag on.

EDIT: running virtme-prep-kdir-mods seems to have fixed it for me.