-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
grub2: fix grub-kbdcomp #100078
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
grub2: fix grub-kbdcomp #100078
Conversation
@GrahamcOfBorg eval |
Please rebase this to fix the eval error. |
1b33844
to
6491297
Compare
6491297
to
8dea800
Compare
8dea800
to
6f417af
Compare
pkgs/tools/misc/grub/2.0x.nix
Outdated
@@ -53,6 +55,13 @@ stdenv.mkDerivation rec { | |||
./fix-bash-completion.patch | |||
]; | |||
|
|||
patchPhase = if kbdcompSupport then '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overriding patchPhase
breaks patches
field. Use prePatch
or postPatch
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use postPatch
and tested. Thanks for reviewing this :)
fe0390d
to
8ca9c7f
Compare
pkgs/tools/misc/grub/2.0x.nix
Outdated
postPatch = if kbdcompSupport then '' | ||
sed -i util/grub-kbdcomp.in -e 's@\bckbcomp\b@${ckbcomp}/bin/ckbcomp@' | ||
'' else '' | ||
echo '#! ${stdenv.shell}' > util/grub-kbdcomp.in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you might need runtimeShell
or something, to work properly with cross-compilation. cc @lopsided98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, runtimeShell
is needed here because this script will need to run on the host platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, I don't know how to test it with cross-compilation though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fyi @mdevlamynck it's as easy as e.g. pkgsCross.aarch64-multiplatform.grub2
. And if you don't have a non-x86 machine for testing you can "cross-compile" to 32-bit and test locally with pkgsCross.gnu32
:)
8ca9c7f
to
ac181d8
Compare
pkgs/tools/misc/grub/2.0x.nix
Outdated
, zfs ? null | ||
, efiSupport ? false | ||
, zfsSupport ? false | ||
, xenSupport ? false | ||
, kbdcompSupport ? false, ckbcomp ? null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, kbdcompSupport ? false, ckbcomp ? null | |
, kbdcompSupport ? false, ckbcomp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
pkgs/tools/misc/grub/2.0x.nix
Outdated
@@ -37,6 +39,7 @@ in ( | |||
|
|||
assert efiSupport -> canEfi; | |||
assert zfsSupport -> zfs != null; | |||
assert kbdcompSupport -> ckbcomp != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert kbdcompSupport -> ckbcomp != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
ac181d8
to
1fda9df
Compare
The grub-kbdcomp command was calling ckbcomp directly without patching to provide its path in the nix store.
1fda9df
to
b3792f9
Compare
@jtojnar @SuperSandro2000 merge? |
This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 1 package blacklisted:
6 packages built:
The following issues got detected with the above build packages.
grub2_efi:
A likely typo in Near pkgs/tools/misc/grub/2.0x.nix:108:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/attribute-typo.md Near pkgs/tools/misc/grub/2.0x.nix:122:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/maintainers-missing.md Near pkgs/tools/misc/grub/2.0x.nix:66:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/build-tools-in-build-inputs.md
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/missing-patch-comment.md A likely typo in Near pkgs/tools/misc/grub/2.0x.nix:108:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/attribute-typo.md Near pkgs/tools/misc/grub/2.0x.nix:122:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/maintainers-missing.md Near pkgs/tools/misc/grub/2.0x.nix:66:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/build-tools-in-build-inputs.md
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/missing-patch-comment.md Package does not have a maintainer. Consider adding yourself? Near pkgs/tools/misc/grub/pvgrub_image/default.nix:32:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/maintainers-missing.md Near pkgs/tools/misc/grub/pvgrub_image/default.nix:32:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/license-missing.md A likely typo in Near pkgs/tools/misc/grub/2.0x.nix:108:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/attribute-typo.md Near pkgs/tools/misc/grub/2.0x.nix:122:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/maintainers-missing.md Near pkgs/tools/misc/grub/2.0x.nix:66:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/build-tools-in-build-inputs.md
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/missing-patch-comment.md Please consider this feature to be alpha. A substituteInPlace with an unmatched pattern got detected:
Please check the offending substituteInPlace for typos or changes in source. makeWrapper is a build tool so it likely goes to Near pkgs/tools/misc/os-prober/default.nix:24:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/build-tools-in-build-inputs.md Near pkgs/tools/misc/os-prober/default.nix:25:3:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/missing-phase-hooks.md Package does not have a maintainer. Consider adding yourself? Near nixos/lib/testing-python.nix:64:7:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/maintainers-missing.md Near nixos/lib/testing-python.nix:64:7:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/license-missing.md
Near pkgs/tools/misc/woeusb/default.nix:56:5:
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/unclear-gpl.md
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/missing-patch-comment.md |
Does not break cross compile with #112857. |
The
grub-kbdcomp
command was callingckbcomp
directly without patching to provide its path in the nix store. As a result the command was crashing becauseckbcomp
was not found.Motivation for this change
This change adds the option
kbdcompSupport
and fixesgrub-kbdcomp
:kbdcompSupport = true
the command works correctlykbdcompSupport = false
(default value) the command is replaced with an explanation message (is this a good thing?)This will also help with #41247 since a possible solution for this issue uses
grub-kbdcomp
.The motivation for adding an option is to avoid bringing
ckbcomp
and its dependencies (some part of x11 asxkeyboardconfig
) when we only want to use grub.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)