I often find myself hacking the Linux kernel for fun and profit. This time I was trying out Buildroot Embedded Linux build system and the first stumbling block using WSL was the fact that Windows path containing spaces were appended to the WSL path which the Linux file system has issues with. Running
make for the Buildroot gives the error below:
Your PATH contains spaces, TABs, and/or newline (\n) characters
Follow the steps below for the solution:
- Create a config file for WSL interop in the WSL distro you are using.
sudo nano /etc/wsl.conf
- Copy and paste the config below in the file:
- Save then restart the WSL distro in the Windows shell (not the WSL distro).
wsl -d [distribution name] --shutdown wsl -d [distribution name]
- Check the path to
echo $PATHto ensure all is well, only the Linux path should remain.
- And we are done! Finally we can build our kernel without worries.