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

linux-libre: init #45411

Merged
merged 4 commits into from Aug 30, 2018
Merged

linux-libre: init #45411

merged 4 commits into from Aug 30, 2018

Conversation

alyssais
Copy link
Member

@alyssais alyssais commented Aug 20, 2018

Motivation for this change

GNU Linux-libre is a linux kernel distribution that has all non-free binary blobs stripped. The project distributes both deblobbed kernel sources, and scripts for each kernel version that perform the deblobbing. Here, I have used the scripts rather than the pre-deblobbed sources, because this allows an arbitrary kernel to be passed in and deblobbed with no extra effort, which seems more in the spirit of Nix and allows deblobbing to be composed with other kernel customisations.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

With the small fix to openafs included in this PR, linuxPackages-libre and linuxPackages_latest-libre can build all kernel modules that the corresponding non-deblobbed kernels can build. (This does not mean that nox-review will pass, because some kernel modules are currently broken on non-deblobbed Linux 4.18 anyway. See #45410.) The fix to openafs does not break any existing kernels where it was previously able to build. I have booted and used a deblobbed kernel successfully, with the exception of some of my laptop's hardware not working, which is to be expected with a deblobbed kernel.

`version` doesn't include .0 patch versions, or suffixes (eg -gnu).
For .0 patch versions, this isn't a problem, since the glob takes care
of everything after a `.`. It does, however, prevent openafs installing
for suffixed kernels.
linuxPackages-libre = recurseIntoAttrs (linuxPackagesFor linux-libre);
linux-libre = callPackage ../os-specific/linux/kernel/linux-libre.nix {};
linuxPackages_latest-libre = recurseIntoAttrs (linuxPackagesFor linux_latest-libre);
linux_latest-libre = linux-libre.override { linux = linux_latest; };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need both latest and stable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this for consistency with other kernels – hardened and xen_dom0 both have latest and stable. I can definitely see both having an audience.

minor = lib.versions.minor linux.modDirVersion;
patch = lib.versions.patch linux.modDirVersion;

in linux.override {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For things like kernels, I would like to see a maintainer.

Building a system with boot.kernelPackages = pkgs.linuxPackages-libre
failed because the expression is called with extra arguments,
See linux-4.14.nix.
@xeji
Copy link
Contributor

xeji commented Aug 29, 2018

Pushed a trivial fix so we can actually build a system with this kernel. LGTM now.

@xeji
Copy link
Contributor

xeji commented Aug 29, 2018

selection_002

@xeji xeji merged commit f629d36 into NixOS:master Aug 30, 2018
@Mic92
Copy link
Member

Mic92 commented Aug 30, 2018

I suppose non-gpl third-party modules should be blacklisted for this kernel? https://hydra.nixos.org/eval/1476119?filter=linuxPackages-libre&compare=1476064&full=#tabs-new

@xeji
Copy link
Contributor

xeji commented Aug 30, 2018

The linux-libre patches have the same license as the kernel (GPL2), so the licensing situation regarding modules doesn't change by appying them. But I agree that users of linux-libre probably don't want to use non-gpl modules, so not building them on Hydra makes sense.

@alyssais alyssais deleted the linux-libre branch September 4, 2018 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants