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

wsl2 fail to build kernel #10126

Closed
1 of 2 tasks
yoshino-polyu opened this issue May 20, 2023 · 2 comments
Closed
1 of 2 tasks

wsl2 fail to build kernel #10126

yoshino-polyu opened this issue May 20, 2023 · 2 comments

Comments

@yoshino-polyu
Copy link

Windows Version

Microsoft Windows [Version 10.0.23451.1000]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu 18.04 LTS

Other Software

No response

Repro Steps

go to https://github.com/microsoft/WSL2-Linux-Kernel

run sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev in wsl2, no problems exist
run make KCONFIG_CONFIG=Microsoft/config-wsl in wsl2, output:
make: *** No targets specified and no makefile found. Stop.

Expected Behavior

go to https://github.com/microsoft/WSL2-Linux-Kernel

run sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev in wsl2, no problems exist
run make KCONFIG_CONFIG=Microsoft/config-wsl in wsl2, output:
make: *** No targets specified and no makefile found. Stop.

Actual Behavior

go to https://github.com/microsoft/WSL2-Linux-Kernel

run sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev in wsl2, no problems exist
run make KCONFIG_CONFIG=Microsoft/config-wsl in wsl2, output:
make: *** No targets specified and no makefile found. Stop.

Diagnostic Logs

No response

@elsaco
Copy link

elsaco commented May 20, 2023

@yoshino-polyu where are you invoking make from? Looks like it can't locate the Makefile. The latest WSL2 kernel extracts to WSL2-Linux-Kernel-linux-msft-wsl-6.1.21.2 and if you didn't rename the directory start the build process there:

elsaco@ubuntu:~/WSL2-Linux-Kernel-linux-msft-wsl-6.1.21.2$ make KCONFIG_CONFIG=Microsoft/config-wsl
  SYNC    include/config/auto.conf.cmd
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
---cut---

I usually specify a target to make:

elsaco@ubuntu:~/WSL2-Linux-Kernel-linux-msft-wsl-6.1.21.2$ make KCONFIG_CONFIG=Microsoft/config-wsl bzimage

and this will build a compressed kernel.

@yoshino-polyu
Copy link
Author

Thanks. Actually, I didn't know where my WSL2 kernel extracts to, and Google gives C:\WINDOWS\System32\lxss\tools\kernel , which is definitely not what you said (~/WSL2-Linux-Kernel-linux-msft-wsl-6.1.21.2). I also use the command find / -name "WSL2-Linux-Kernel-linux*" -print 2>/dev/null to search that file, but output shows nothing.

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

2 participants