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

surface: linux 6.6.13 -> 6.7.6 #878

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

gitwah
Copy link

@gitwah gitwah commented Feb 28, 2024

Description of changes
Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

@onny
Copy link

onny commented Feb 28, 2024

Fixes #877

@onny
Copy link

onny commented Feb 28, 2024

Is it possible to build the kernel locally from inside the nixos-hardware repository? @stigtsp

this didn't work

nix-build -E "(import <nixpkgs> {}).callPackage ./microsoft/surface/common/kernel/linux-pac
kage.nix {}"

@mexisme
Copy link
Contributor

mexisme commented Feb 28, 2024

Is it possible to build the kernel locally from inside the nixos-hardware repository? @stigtsp

this didn't work

nix-build -E "(import <nixpkgs> {}).callPackage ./microsoft/surface/common/kernel/linux-pac
kage.nix {}"

Because nixos-hardware tends to be trying to provide config at the machine-level, I've found it tricky to avoid running a build+install on real hardware.

Running the test suite def. catches things like syntax errors, but I personally also try to use nixos-rebuild build-vm on a faster machine, against a copy of the MS Surface's Nixos config, to pre-test it better.

If it builds at that stage, it's (so far) always been good enough to try installing on the Surface itself — which you'll ultimately have to do to check the kernel changes are working, of course!

@@ -5,7 +5,7 @@ let

in {
imports = [
./linux-6.6.x
./linux-6.7.x
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're not going to expose the 6.6.x .nix files, you may as well delete them, yeah?

In the past, @Mic92 has asked people to try to minimise the number of different kernel versions that have to be maintained for any particular hardware.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, sound like a good idea.

@mexisme
Copy link
Contributor

mexisme commented Mar 6, 2024

I'll try to build + test this on my Surface Go tonight (GMT+12)

kernelPatches = surfacePatches {
inherit version;
patchFn = ./patches.nix;
};
kernelPackages = linuxPackage {
inherit version kernelPatches;
sha256 = "sha256-iLiefdQerU46seQRyLuNWSV1rPgVzx3zwNxX4uiCwLw=";
sha256 = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

Empty hash should be sha256-5InsDhNw0Im0RtVlre16aYCT0rfEEioY8h7bbvk9N9M=

Edit:
It looks like the linux-surface repo needs to be pulled forward as well to:

  linux-surface = fetchFromGitHub {
    owner = "linux-surface";
    repo = "linux-surface";
    rev = "arch-6.7.6-1";
    sha256 = "1f89xzzn11d25g70zqqj3ybk68g11m33qpmh0rj46nhh9bzlj4ya";
  };

With that the build advances to compilation (in progress as of this edit)

Edit 2: With those changes (see this commit) I am able to successfully compile and boot into 6.7.6. I am editing from a Surface Laptop Studio with this as a nixos flake input :) Passes ad-hoc testing on this device.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance we can bump this to arch-6.7.9-1? That pulls in linux-surface/linux-surface@852fcb1 which has improvements to the fan profiles on the SP9.

To cherry-pick (on top of @tracteurblinde 's commit); cf462d6

Choose a reason for hiding this comment

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

Any chance we can bump this to arch-6.7.9-1? That pulls in linux-surface/linux-surface@852fcb1 which has improvements to the fan profiles on the SP9.

To cherry-pick (on top of @tracteurblinde 's commit); cf462d6

not only that but also finally has working cameras again which would be nice to have

@iwanders
Copy link
Contributor

Because nixos-hardware tends to be trying to provide config at the machine-level, I've found it tricky to avoid running a build+install on real hardware.

@mexisme , @onny Just though I'd share my workflow; what I do is from my flake;

nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel -L

Then I push that result to my surface with nix copy --to "ssh://<username>@<hostname>" ./result. That allows me to build the kernel and other packages on my desktop at least, verifying it runs on the device is still necessary.

@stigtsp
Copy link
Member

stigtsp commented Apr 10, 2024

Since 6.7 is EOL, can this PR be updated to 6.8? I'm happy to test on my Surfaces :)

@Mic92
Copy link
Member

Mic92 commented Apr 10, 2024

Still working on this?

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

Successfully merging this pull request may close these issues.

None yet

8 participants