conda-forge / conda-forge/linux-sysroot-feedstock

linux-kernel-header Licenses aren't being packaged correctly

Open
#43 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
5
Forks
18
PR merge metrics
No merged PRs in 30d

Description

### Solution to issue cannot be found in the documentation.

- [X] I checked the documentation.

### Issue

I wanted to see what was contained in recent linux-kernel-headers package, so I downloaded it from https://anaconda.org/conda-forge/kernel-headers_linux-64/3.10.0/download/noarch/kernel-headers_linux-64-3.10.0-h4a8ded7_13.tar.bz2 and opened it up to browse through without actually installing it. When I looked in `info/licenses`, I only found `nss_license.txt`, which I found weird because I expected to find GPL-2 and the UAPI linking exception in there.

From https://docs.kernel.org/process/license-rules.html
> The User-space API (UAPI) header files, which describe the interface of user-space programs to the kernel are a special case. According to the note in the kernel COPYING file, the syscall interface is a clear boundary, which does not extend the GPL requirements to any software which uses it to communicate with the kernel. Because the UAPI headers must be includable into any source files which create an executable running on the Linux kernel, the exception must be documented by a special license expression.

Looking for SPDX in the current header package is mildly disappointing (of course because SPDX was barely a thing back when 3.10 came out):
```
[I] ✦ ➜ grep -r SPDX .
./drm/exynos_drm.h:/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
./drm/i810_drm.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./rdma/ib_user_ioctl_verbs.h:/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
./linux/usb/cdc.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/g_printer.h:/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
./linux/usb/midi.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/cdc-wdm.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/audio.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/ch11.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/ch9.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/video.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/gadgetfs.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usb/tmc.h:/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
./linux/usbdevice_fs.h:/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
./sound/usb_stream.h:/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */

sysroot/usr/include via 🅒 clang_osx-64
[I] ✦ ➜ grep -rL SPDX . | wc -l
758
```
15 files with SPDX and 758 without. 2%!

```
sysroot/usr/include via 🅒 clang_osx-64 took 34s
[I] ✦ ➜ grep -rl 'version 2 of the License' . | wc -l
58

sysroot/usr/include via 🅒 clang_osx-64
[I] ✦ ➜ grep -rl 'GNU General Public License' . | wc -l
188

sysroot/usr/include via 🅒 clang_osx-64
[I] ✦ ➜ grep -rli 'License' . | wc -l
277

sysroot/usr/include via 🅒 clang_osx-64
[I] ✦ ➜ grep -rLi 'License' . | wc -l
496
```

Seems like the linux-kernel-header subpackage needs to have it's own about section that probably says the license is `GPL-2 WITH Linux-syscall-note` and package those license files in the conda packages. Alternately, we could repackage the rpm license files because I'm sure they have them although I'm not sure where to look for them.

I can submit a PR for this if you guys think it is worthwhile.

### Installed packages

```shell
doesn't have to do with actually installing the packages
```

### Environment info

```shell
doesn't have to do with my environment
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.