From 621cb999bd1c9af140cfeb263a14de21916d1e09 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 5 May 2019 23:26:32 +0900 Subject: [PATCH] Rename to memtest86-efi. --- pkgs/tools/misc/memtest86-efi/default.nix | 55 +++++++++++++++++++++++ pkgs/tools/misc/memtest86/default.nix | 55 ++++++++--------------- pkgs/top-level/all-packages.nix | 2 + 3 files changed, 75 insertions(+), 37 deletions(-) create mode 100644 pkgs/tools/misc/memtest86-efi/default.nix diff --git a/pkgs/tools/misc/memtest86-efi/default.nix b/pkgs/tools/misc/memtest86-efi/default.nix new file mode 100644 index 000000000000..e6ebff69d95d --- /dev/null +++ b/pkgs/tools/misc/memtest86-efi/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv, fetchurl, unzip, utillinux, libguestfs-with-appliance }: + +stdenv.mkDerivation rec { + pname = "memtest86-efi"; + version = "8.0"; + + src = fetchurl { + # TODO: The latest version of memtest86 is actually 8.1, but apparently the + # company has stopped distributing versioned binaries of memtest86: + # https://www.passmark.com/forum/memtest86/44494-version-8-1-distribution-file-is-not-versioned?p=44505#post44505 + # However, it does look like redistribution is okay, so if we had + # somewhere to host binaries that we make sure to version, then we could + # probably keep up with the latest versions released by the company. + url = "https://www.memtest86.com/downloads/memtest86-${version}-usb.zip"; + sha256 = "147mnd7fnx2wvbzscw7pkg9ljiczhz05nb0cjpmww49a0ms4yknw"; + }; + + nativeBuildInputs = [ libguestfs-with-appliance unzip ]; + + unpackPhase = '' + unzip -q $src -d . + ''; + + installPhase = '' + mkdir -p $out + + # memtest86 is distributed as a bootable USB image. It contains the actual + # memtest86 EFI app. + # + # The following command uses libguestfs to extract the actual EFI app from the + # usb image so that it can be installed directly on the hard drive. This creates + # the ./BOOT/ directory with the memtest86 EFI app. + guestfish --ro --add ./memtest86-usb.img --mount /dev/sda1:/ copy-out /EFI/BOOT . + + cp -r BOOT/* $out/ + ''; + + meta = with lib; { + homepage = http://memtest86.com/; + downloadPage = "https://www.memtest86.com/download.htm"; + description = "A tool to detect memory errors, to be run from a bootloader"; + longDescription = '' + An UEFI app that is able to detect errors in RAM. It can be run from a + bootloader. Released under a proprietary freeware license. + ''; + # The Memtest86 License for the Free Edition states, + # "MemTest86 Free Edition is free to download with no restrictions on usage". + # However the source code for Memtest86 does not appear to be available. + # + # https://www.memtest86.com/license.htm + license = licenses.unfreeRedistributable; + maintainers = with maintainers; [ cdepillabout ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/misc/memtest86/default.nix b/pkgs/tools/misc/memtest86/default.nix index 49087194278a..2e364e33fc68 100644 --- a/pkgs/tools/misc/memtest86/default.nix +++ b/pkgs/tools/misc/memtest86/default.nix @@ -1,51 +1,32 @@ -{ lib, stdenv, fetchurl, unzip, utillinux, libguestfs-with-appliance }: - -stdenv.mkDerivation rec { - name = "memtest86"; - version = "8.0"; +{ stdenv, fetchurl }: +stdenv.mkDerivation { + name = "memtest86-4.3.6"; + src = fetchurl { - # TODO: The latest version of memtest86 is actually 8.1, but apparently the - # company has stopped distributing versioned binaries of memtest86: - # https://www.passmark.com/forum/memtest86/44494-version-8-1-distribution-file-is-not-versioned?p=44505#post44505 - # However, it does look like redistribution is okay, so if we had - # somewhere to host binaries that we make sure to version, then we could - # probably keep up with the latest versions released by the company. - url = "https://www.memtest86.com/downloads/memtest86-${version}-usb.zip"; - sha256 = "147mnd7fnx2wvbzscw7pkg9ljiczhz05nb0cjpmww49a0ms4yknw"; + url = https://www.memtest86.com/downloads/memtest86-4.3.6-src.tar.gz; + sha256 = "0qbksyl2hmkm12n7zbmf2m2n3q811skhykxx6a9a7y6r7k8y5qmv"; }; - nativeBuildInputs = [ libguestfs-with-appliance unzip ]; - - unpackPhase = '' - unzip -q $src -d . + preBuild = '' + # Really dirty hack to get Memtest to build without needing a Glibc + # with 32-bit libraries and headers. + if test "$system" = x86_64-linux; then + mkdir gnu + touch gnu/stubs-32.h + fi ''; + NIX_CFLAGS_COMPILE = "-I."; + installPhase = '' mkdir -p $out - - # memtest86 is distributed as a bootable USB image. It contains the actual - # memtest86 EFI app. - # - # The following command uses libguestfs to extract the actual EFI app from the - # usb image so that it can be installed directly on the hard drive. This creates - # the ./BOOT/ directory with the memtest86 EFI app. - guestfish --ro --add ./memtest86-usb.img --mount /dev/sda1:/ copy-out /EFI/BOOT . - - cp -r BOOT/* $out/ + cp memtest.bin $out/ ''; - meta = with lib; { + meta = { homepage = http://memtest86.com/; - downloadPage = "https://www.memtest86.com/download.htm"; description = "A tool to detect memory errors, to be run from a bootloader"; - # The Memtest86 License for the Free Edition states, - # "MemTest86 Free Edition is free to download with no restrictions on usage". - # However the source code for Memtest86 does not appear to be available. - # - # https://www.memtest86.com/license.htm - license = licenses.unfreeRedistributable; - maintainers = with maintainers; [ cdepillabout ]; - platforms = platforms.linux; + broken = true; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d4ad2e424a9e..676858dc5110 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4378,6 +4378,8 @@ in memtest86 = callPackage ../tools/misc/memtest86 { }; + memtest86-efi = callPackage ../tools/misc/memtest86-efi { }; + memtest86plus = callPackage ../tools/misc/memtest86+ { }; meo = callPackage ../tools/security/meo {