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
spectre-meltdown-checker: init at 0.29 #33858
Conversation
@GrahamcOfBorg build spectre-meltdown-checker |
ab4a49a
to
2142ab5
Compare
installPhase = with stdenv.lib; '' | ||
install -Dt $out/lib spectre-meltdown-checker.sh | ||
makeWrapper $out/lib/spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker \ | ||
--prefix PATH : ${makeBinPath [ binutils ]} |
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.
readelf
is in binutils-uwrapped
|
||
nativeBuildInputs = [ makeWrapper ]; | ||
|
||
buildInputs = [ binutils ]; |
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.
Not required to put binutils
in buildInputs
@@ -0,0 +1,36 @@ | |||
{ stdenv, fetchFromGitHub, makeWrapper, binutils }: |
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.
readelf
is in binutils-unwrapped
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.
Thanks a lot!
2142ab5
to
52307d7
Compare
|
||
prePatch = '' | ||
substituteInPlace spectre-meltdown-checker.sh \ | ||
--replace /bin/echo echo \ |
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.
there is a trailing \
here. Probably leftover from the previous version.
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.
Done
52307d7
to
04ea687
Compare
I usually apply the following patch to the script. That removes the need to specify the kernel manually on Nix. I will open a PR (speed47/spectre-meltdown-checker#79) with the upstream repo for that.. finally.... diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh
index 75f186c..9d6eb5f 100755
--- a/spectre-meltdown-checker.sh
+++ b/spectre-meltdown-checker.sh
@@ -487,6 +487,7 @@ if [ "$opt_live" = 1 ]; then
[ -e /boot/kernel-$( uname -r) ] && opt_kernel=/boot/kernel-$( uname -r)
[ -e /boot/bzImage-$(uname -r) ] && opt_kernel=/boot/bzImage-$(uname -r)
[ -e /boot/kernel-genkernel-$(uname -m)-$(uname -r) ] && opt_kernel=/boot/kernel-genkernel-$(uname -m)-$(uname -r)
+ [ -e /run/booted-system/kernel ] && opt_kernel=/run/booted-system/kernel
fi
# system.map |
04ea687
to
1d1669b
Compare
I added the patch using |
1d1669b
to
cb6a25d
Compare
@GrahamcOfBorg build spectre-meltdown-checker |
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.
Failure for system: x86_64-darwin
Package ‘spectre-meltdown-checker-0.29’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/tools/security/spectre-meltdown-checker/default.nix:33 is not supported on ‘x86_64-darwin’, refusing to evaluate.
a) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
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.
Success for system: aarch64-linux
no Makefile, doing nothing
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/y8w212cscygrlcsjc996fa0nyms69hxx-spectre-meltdown-checker-0.29
strip is /nix/store/c6qj0j45xizkrx58i65j75a5ysmqhgrs-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/y8w212cscygrlcsjc996fa0nyms69hxx-spectre-meltdown-checker-0.29/lib /nix/store/y8w212cscygrlcsjc996fa0nyms69hxx-spectre-meltdown-checker-0.29/bin
patching script interpreter paths in /nix/store/y8w212cscygrlcsjc996fa0nyms69hxx-spectre-meltdown-checker-0.29
/nix/store/y8w212cscygrlcsjc996fa0nyms69hxx-spectre-meltdown-checker-0.29/lib/spectre-meltdown-checker.sh: interpreter directive changed from " /bin/sh" to "/nix/store/b2rfm1s05ria7d00r4p9r7f5lg7llazi-bash-4.4-p12/bin/sh"
checking for references to /build in /nix/store/y8w212cscygrlcsjc996fa0nyms69hxx-spectre-meltdown-checker-0.29...
/nix/store/y8w212cscygrlcsjc996fa0nyms69hxx-spectre-meltdown-checker-0.29
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.
Success for system: x86_64-linux
no Makefile, doing nothing
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/3fqzz55dxhnyfph42hlpk5vsf5rywlc1-spectre-meltdown-checker-0.29
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/3fqzz55dxhnyfph42hlpk5vsf5rywlc1-spectre-meltdown-checker-0.29/lib /nix/store/3fqzz55dxhnyfph42hlpk5vsf5rywlc1-spectre-meltdown-checker-0.29/bin
patching script interpreter paths in /nix/store/3fqzz55dxhnyfph42hlpk5vsf5rywlc1-spectre-meltdown-checker-0.29
/nix/store/3fqzz55dxhnyfph42hlpk5vsf5rywlc1-spectre-meltdown-checker-0.29/lib/spectre-meltdown-checker.sh: interpreter directive changed from " /bin/sh" to "/nix/store/nkq0n2m4shlbdvdq0qijib5zyzgmn0vq-bash-4.4-p12/bin/sh"
checking for references to /tmp/nix-build-spectre-meltdown-checker-0.29.drv-0 in /nix/store/3fqzz55dxhnyfph42hlpk5vsf5rywlc1-spectre-meltdown-checker-0.29...
/nix/store/3fqzz55dxhnyfph42hlpk5vsf5rywlc1-spectre-meltdown-checker-0.29
Motivation for this change
Can someone please help me addingreadelf
to the path?I didn't have any success using
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)