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

Header "include/uapi/misc/d3dkmthk.h" doesn't contain "WITH Linux-syscall-note" #7866

Closed
1 of 2 tasks
alexandreteles opened this issue Dec 24, 2021 · 3 comments
Closed
1 of 2 tasks

Comments

@alexandreteles
Copy link

Version

Microsoft Windows [versão 10.0.22000.376]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.74.3

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Try to build WSL2-Linux-Kernel from source

Expected Behavior

The build succeeds

Actual Behavior

The build will fail on the include/uapi/misc/d3dkmthk.h header as it is missing WITH Linux-syscall-note on the SPDX-License-Identifier, but according to linux/scripts/headers_install.sh all SPDX-License-Identifier with GPL variants must have "WITH Linux-syscall-note".

Line 1 on the file reads:

/* SPDX-License-Identifier: GPL-2.0 */

Where it should be:

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */

It'll always fail as linux/scripts/headers_install.sh will refuse to include headers with the wrong license information:

# SPDX-License-Identifier with GPL variants must have "WITH Linux-syscall-note"
if [ -n "$(sed -n -e "/SPDX-License-Identifier:.*GPL-/{/WITH Linux-syscall-note/!p}" $INFILE)" ]; then
	echo "error: $INFILE: missing \"WITH Linux-syscall-note\" for SPDX-License-Identifier" >&2
	exit 1
fi

Diagnostic Logs

Log Resume:

error: include/uapi/misc/d3dkmthk.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier
make[6]: *** [scripts/Makefile.headersinst:63: usr/include/misc/d3dkmthk.h] Error 1
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [Makefile:1311: headers] Error 2
make[4]: *** [scripts/Makefile.package:87: intdeb-pkg] Error 2
make[3]: *** [Makefile:1550: intdeb-pkg] Error 2
make[2]: *** [debian/rules:13: binary-arch] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make[1]: *** [scripts/Makefile.package:83: bindeb-pkg] Error 2
make: *** [Makefile:1550: bindeb-pkg] Error 2
Error: Process completed with exit code 2.

logs_8.zip

@elsaco
Copy link

elsaco commented Dec 24, 2021

@alexandreteles how are you building the new WSL kernel? Looking at your log you're trying to make a DEB package. That's not how custom kernels are installed in WSL. Build instructions have this command make KCONFIG_CONFIG=Microsoft/config-wsl. however you could copy that file to .config and further customize it then build your kernel.

I did a fresh build of microsoft/WSL2-Linux-Kernel@918dbaa and it succeeded with no warnings or errors.

Previous kernel info that came with the Ubuntu appx package:

uname -r
5.10.60.1-microsoft-standard-WSL2

and the custom build:

uname -a
Linux RIPPER 5.10.74.3-microsoft-standard-WSL2+ #2 SMP Fri Dec 24 14:07:05 PST 2021 x86_64 x86_64 x86_64 GNU/Linux

The WSL kernels reside at C:\Windows\system32\lxss\tools\ not inside a WSL distro package.

@alexandreteles
Copy link
Author

Looking at your log you're trying to make a DEB package. That's not how custom kernels are installed in WSL.

The bindeb-pkg build will produce the appropriate bzImage and vmlinux files so they can be copied to the host OS and users can use a .wslconfig file to load our custom kernel, the debian packages are used only to provide the appropriate linux-headers-* and linux-libc-dev-* packages.

I did a fresh build of microsoft/WSL2-Linux-Kernel@918dbaa and it succeeded with no warnings or errors.

It's possible that Microsoft's build circumvents the requirements on linux/scripts/headers_install.sh for the standard builds, but header files should comply with the license requirements for proper compilation. We have it fixed downstream by just fixing include/uapi/misc/d3dkmthk.h before the compilation so it includes the expected license information and build passes:

sed -i 's/SPDX-License-Identifier: GPL-2.0/SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note/g' include/uapi/misc/d3dkmthk.h

It may or may not be on Microsoft's interests to include the WITH Linux-syscall-note in their license for this header, so we are doing our thing downstream and letting them know.

@alexandreteles how are you building the new WSL kernel?

This problem isn't really related to our build process, or shouldn't be at least, but you can check it on the GitHub Actions for our fork: https://github.com/INCT-DD/WSL2-Linux-Kernel/actions.

@alexandreteles
Copy link
Author

I'm closing this issue as include/uapi/misc/d3dkmthk.h now contains the appropriate license header.

Thank you!

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