EDLLT / WSL2-Linux-Kernel

The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)
Other
60 stars 9 forks source link

FAILED: load BTF from vmlinux #7

Open JustGuardian opened 10 months ago

JustGuardian commented 10 months ago

I know that this might be a dead project, but I am facing this issue when launching the first command to build the kernel

make -j $(expr $(nproc) - 1) KCONFIG_CONFIG=Microsoft/config-wsl modules

builds lots of files but then it errors like this:

 MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.btf
  BTF     .btf.vmlinux.bin.o
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  BTFIDS  vmlinux
FAILED: load BTF from vmlinux: Unknown error -22make: *** [Makefile:1179: vmlinux] Error 255

I am in a fresh ubuntu installation.

morpheuslord commented 4 months ago

same issue did you find any updates

johnathanSigmale commented 2 months ago

same issue help plz

Dev-byte-source commented 2 months ago

Even I was facing same issue on the 8GB ram machine. I used following .wslconfig and it worked for me. I have set memory more than my device's actual memory and 12 GB of swap for the kernel compilation purpose only.

# Settings apply across all Linux distros running on WSL 2
[wsl2]

# Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
memory=10GB

# Sets the VM to use two virtual processors
processors=2

# Sets amount of swap storage space to 8GB, default is 25% of available RAM
swap=12GB

# Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
swapfile=D:\\swap\\wsl-swap.vhdx

# Disable page reporting so WSL retains all allocated memory claimed from Windows and releases none back when free
pageReporting=false

# Disables nested virtualization
nestedVirtualization=false

# Turns on output console showing contents of dmesg when opening a WSL 2 distro for debugging
debugConsole=true

# Enable experimental features
[experimental]
sparseVhd=true

After adding this file, run "wsl --shutdown" in powershell and start wsl instance again.

Most of the values I have used default from given sample config from here

JustGuardian commented 2 months ago

Thanks for all the answers guys, now I try @Dev-byte-source method.

johnathanSigmale commented 2 months ago

@JustGuardian did it work for you ?

DonnerGreif1771 commented 2 months ago

Hi, I get the same error, but I try to build it on a ubuntu maschine with 32 gb of ram. Any idea why it throws the error?