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

unl0kr: 2.0.0 -> 3.2.0 #319126

Closed
wants to merge 1 commit into from
Closed

Conversation

uninsane
Copy link
Contributor

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux (and pkgCross.aarch64-multiplatform, pkgsCross.armv7l-hf-multiplatform)
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@uninsane uninsane requested a review from tomfitzhenry June 11, 2024 20:15
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Jun 11, 2024
@JohnRTitor
Copy link
Contributor

Result of nixpkgs-review pr 319126 run on x86_64-linux 1

1 package built:
  • unl0kr

@JohnRTitor
Copy link
Contributor

Ran the test (nix-build -A nixosTests.systemd-initrd-luks-unl0kr) locally and it hangs here.


machine # [    1.924147] usbhid: USB HID core driver
machine # [    1.940566] input: QEMU QEMU USB Tablet as /devices/pci0000:00/0000:00:01.2/usb1/1-1/1-1:1.0/0003:0627:0001.0001/input/input2
machine # [    1.942567] hid-generic 0003:0627:0001.0001: input,hidraw0: USB HID v0.01 Mouse [QEMU QEMU USB Tablet] on usb-0000:00:01.2-1/input0
machine # [    2.379492] unl0kr-ask-password-start[116]: libinput error: /nix/store/279k8iw3mb4hdsqxsw22xdym4ayh03ss-libinput-1.25.0/share/libinput: failed to find data files
machine # [    2.380733] unl0kr-ask-password-start[116]: libinput error: Failed to load the device quirks from /nix/store/279k8iw3mb4hdsqxsw22xdym4ayh03ss-libinput-1.25.0/share/libinput and /etc/libinput/local-overrides.quirks. This will negatively affect device behavior. See https://wayland.freedesktop.org/libinput/doc/1.25.0/device-quirks.html for details.

Copy link
Contributor

@tomfitzhenry tomfitzhenry left a comment

Choose a reason for hiding this comment

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

Replying to @uninsane from #276539 (comment) :

see #319126 which is working for me on actual hardware (x86_64 laptop, aarch64 pinephone, armv7 chromebook). i tried to run the nix tests with nix-build -A nixosTests.systemd-initrd-luks-unl0kr, but nix says i need a builder with the kvm feature for that. pretty low on my own priorities to figure that one out and show that it works in a virtual environment when i already have it working on the device in my hand...

Glad to hear this is working on real hardware, and sorry I've not been proactive in doing this update.

One of the ways NixOS maintenance scales to its high packages-per-maintainer ratio is via its automated integration tests. It would be a step backwards in that dimension if we were to merge a PR that broke such a test. At the same time, I understand that having stale packages is itself not ideal.

I realise this puts us in a tricky spot. I'm no longer a user of unl0kr, but I see I'm the only maintainer. That's not good either! :)

Is there anyone willing to be a maintainer for unl0kr (package, module, and test)?

It'd be really great to us work with upstream to figure out why this test is failing. #276539 (comment) was my past attempt, which isolated it to the 2.0.2 -> 2.0.3 upgrade. Maybe some git bisecting could find the commit that causes the test to break?

@hustlerone
Copy link
Contributor

I am willing to maintain the unl0kr package since at least 2 of my devices use it.

@JohnRTitor
Copy link
Contributor

Could you investigate the reason why the test is failing? It's a sensitive package after all, so we are hesitant on merging this.

@hustlerone
Copy link
Contributor

I'm merging 2.0.3 before 3.2.0

I'll look into it

@JohnRTitor
Copy link
Contributor

JohnRTitor commented Sep 4, 2024

2.0.3 also fails the test (#276539) https://github.com/NixOS/nixpkgs/pull/276539/checks?check_run_id=19932461278

Alternatively we could merge this since it's tested by OP?

Testing this is relatively easy.

In flake.nix:

inputs.unlocker-test-nixpkgs.url = "github:NixOS/nixpkgs/refs/pull/319126/merge";

In configuration.nix:

  nixpkgs.overlays = [
    (final: prev: {
      unl0kr = inputs.unlocker-test-nixpkgs.legacyPackages.${pkgs.system}.unl0kr;
    })
  ];

Note that you must have flakes setup and pass inputs via specialArgs to your NixOS configuration.

@hustlerone
Copy link
Contributor

I'll test it on a real install right now

@hustlerone
Copy link
Contributor

It does NOT work. It hangs right before the moment the UI should load.

Copy link
Contributor

@JohnRTitor JohnRTitor left a comment

Choose a reason for hiding this comment

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

Ok. let's block this, until this is fixed.

@Electrostasy
Copy link

I use an overlay for 3.2.0 since 3.0.0 without issues on 1 device (a 2022 Asus ROG Flow Z13). The only differences (from what I can tell) are that I do not fetch submodules and I do not specify strictDeps = false. Maybe this is relevant?

@hustlerone
Copy link
Contributor

I use an overlay for 3.2.0 since 3.0.0 without issues on 1 device (a 2022 Asus ROG Flow Z13). The only differences (from what I can tell) are that I do not fetch submodules and I do not specify strictDeps = false. Maybe this is relevant?

Only this? unl0kr does not execute on my system

@hustlerone
Copy link
Contributor

Maybe I'm doing it wrong, but I added this as a module in my flake:

                                ({inputs, pkgs, ...}: {
                                        nixpkgs.overlays = [
                                                (final: prev: {
                                                  # Contains various fixes since 2.0.0.

                                                  unl0kr = prev.unl0kr.overrideAttrs (finalAttrs: oldAttrs: {
                                                    version = "3.2.0";

                                                    src = oldAttrs.src.override {
                                                      owner = "postmarketOS";
                                                      repo = "buffybox";
                                                      rev = finalAttrs.version;
                                                      hash = "sha256-nZX7mSY9IBIhVNmOD6mXI1IF2TgyKLc00a8ADAvVLB0=";
                                                    };

                                                    sourceRoot = "${finalAttrs.src.name}/unl0kr";
                                                  });
                                                })
                                        ];
                                }) # Overlays

@hustlerone
Copy link
Contributor

hustlerone commented Sep 4, 2024

Maybe I'm doing it wrong, but I added this as a module in my flake:

                                ({inputs, pkgs, ...}: {
                                        nixpkgs.overlays = [
                                                (final: prev: {
                                                  # Contains various fixes since 2.0.0.

                                                  unl0kr = prev.unl0kr.overrideAttrs (finalAttrs: oldAttrs: {
                                                    version = "3.2.0";

                                                    src = oldAttrs.src.override {
                                                      owner = "postmarketOS";
                                                      repo = "buffybox";
                                                      rev = finalAttrs.version;
                                                      hash = "sha256-nZX7mSY9IBIhVNmOD6mXI1IF2TgyKLc00a8ADAvVLB0=";
                                                    };

                                                    sourceRoot = "${finalAttrs.src.name}/unl0kr";
                                                  });
                                                })
                                        ];
                                }) # Overlays

Suspicions confirmed, unl0kr v3.2.0 will NOT work if amdgpu is loaded.

Jovian-NixOS has the same problem on the Steam Deck (albeit it's probably v2.0.0) which is solved by NOT loading amdgpu on stage 1.

@hustlerone
Copy link
Contributor

2.0.3 also fails the test (#276539) https://github.com/NixOS/nixpkgs/pull/276539/checks?check_run_id=19932461278

Alternatively we could merge this since it's tested by OP?

Testing this is relatively easy.

In flake.nix:

inputs.unlocker-test-nixpkgs.url = "github:NixOS/nixpkgs/refs/pull/319126/merge";

In configuration.nix:

  nixpkgs.overlays = [
    (final: prev: {
      unl0kr = inputs.unlocker-test-nixpkgs.legacyPackages.${pkgs.system}.unl0kr;
    })
  ];

Note that you must have flakes setup and pass inputs via specialArgs to your NixOS configuration.

I'll retest this with amdgpu disabled

@hustlerone
Copy link
Contributor

I'm going to see if DRM may be necessary

@hustlerone
Copy link
Contributor

Looks like amdgpu has a conflict with unl0kr regardless.

@uninsane
Copy link
Contributor Author

uninsane commented Sep 4, 2024

Looks like amdgpu has a conflict with unl0kr regardless.

to be clear, 2.0.0 works for you, but 3.2.0 fails regardless of backend=fbdev/backend=drm in /etc/unl0kr.conf?

and does your device show any signs of life in the display before reaching unl0kr (i.e. initrd logging)?

@hustlerone
Copy link
Contributor

hustlerone commented Sep 4, 2024

Looks like amdgpu has a conflict with unl0kr regardless.

to be clear, 2.0.0 works for you, but 3.2.0 fails regardless of backend=fbdev/backend=drm in /etc/unl0kr.conf?

and does your device show any signs of life in the display before reaching unl0kr (i.e. initrd logging)?

My device displays fine (unless it's a steam deck running jovian nixos), it just frezes/unl0kr doesn't work.

2.0.3+ seems to fail regardless of the backend, and seems to be caused by amdgpu in stage 1

@hustlerone hustlerone mentioned this pull request Sep 4, 2024
13 tasks
@hustlerone
Copy link
Contributor

hustlerone commented Sep 4, 2024

I'll probably step up as the maintainer since I want to add the much needed configuration feature (for themes and hacks) and because I actively use unl0kr on at least two of my devices.

FYI, having the config there is not enough, especially since unl0kr can't read it at boot (seems like a huge oversight, but then again NixOS has ways to work around this, which I've used and tested. All that remains is to translate my imperative crud to something declarative and stateful)

@Electrostasy
Copy link

Looks like amdgpu has a conflict with unl0kr regardless.

I will add that I had a similar issue before with nvidia/i915 and early DRM, unl0kr would not start, so maybe this is not just a conflict with unl0kr and amdgpu. I have only tested this on 1 device, and it has hybrid graphics, so I was not sure if it was an isolated case. Interesting!

I'll probably step up as the maintainer since I want to add the much needed configuration feature (for themes and hacks) and because I actively use unl0kr on at least two of my devices.

FYI, having the config there is not enough, especially since unl0kr can't read it at boot (seems like a huge oversight, but then again NixOS has ways to work around this, which I've used and tested. All that remains is to translate my imperative crud to something declarative and stateful)

I have been successfully using a small module to add config file support (used like this), but adding extra commandline flags required more work. Having support for it in the official module would be huge.

@uninsane
Copy link
Contributor Author

uninsane commented Sep 5, 2024

i use unl0kr on my aarch64 Pinephone: hardware which requires me to revert #298332 (i.e. build the kernel with CONFIG_FB_SIMPLE=y) to get any output in the initrd. since you're getting display output, and it's only unl0kr that doesn't render, that's probably not the source of the issue, but it could be worth looking in that direction if there's not anything more obvious.

@hustlerone
Copy link
Contributor

I'm first going to only update the service then attempt a version bump so we at least have an update on unl0kr

@hustlerone
Copy link
Contributor

hustlerone commented Sep 5, 2024

i use unl0kr on my aarch64 Pinephone: hardware which requires me to revert #298332 (i.e. build the kernel with CONFIG_FB_SIMPLE=y) to get any output in the initrd. since you're getting display output, and it's only unl0kr that doesn't render, that's probably not the source of the issue, but it could be worth looking in that direction if there's not anything more obvious.

Just had unl0kr v2.0.0 freeze on my system. Looks like we really can't predict what'll happen just yet. Either way, I'll do a PR with the changes done to the unl0kr service by Electrostasy.

FYI I have been talking to the BuffyBox devs and Johannes suggests that early video loading may interfere with the framebuffer device and/or its availability.

@hustlerone
Copy link
Contributor

Here's my unl0kr service PR: #339787

@hustlerone
Copy link
Contributor

hustlerone commented Sep 6, 2024

Be warned that if it gets merged you might encounter a merge conflict with this PR

@uninsane
Copy link
Contributor Author

i've switched my systems from unl0kr to buffyboard (a framebuffer keyboard, packaged here). leaving this PR open seems to have caused confusion elsewhere, that i intend to do more work on it (i don't), so i'm closing it. anyone who wants to shepherd this: feel free to pull the branch and open a new PR.

@uninsane uninsane closed this Oct 17, 2024
@uninsane uninsane mentioned this pull request Dec 4, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants