2020-04-30 02:29:10 +02:00
|
|
|
{ fetchzip, lib, stdenv, mtools }:
|
2019-05-05 16:26:32 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "memtest86-efi";
|
2020-04-10 05:28:48 +02:00
|
|
|
version = "8.3";
|
2019-05-05 16:26:32 +02:00
|
|
|
|
2019-10-05 08:57:58 +02:00
|
|
|
src = fetchzip {
|
2020-04-10 06:15:44 +02:00
|
|
|
# TODO: We're using the previous version of memtest86 because the
|
2019-10-05 08:57:58 +02:00
|
|
|
# company developing memtest86 has stopped providing a versioned download
|
|
|
|
# link for the latest version:
|
|
|
|
#
|
2019-05-05 16:26:32 +02:00
|
|
|
# https://www.passmark.com/forum/memtest86/44494-version-8-1-distribution-file-is-not-versioned?p=44505#post44505
|
2019-10-05 08:57:58 +02:00
|
|
|
#
|
|
|
|
# However, versioned links for the previous version are available, so that
|
|
|
|
# is what is being used.
|
|
|
|
#
|
|
|
|
# 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.
|
2019-05-05 16:26:32 +02:00
|
|
|
url = "https://www.memtest86.com/downloads/memtest86-${version}-usb.zip";
|
2020-04-10 05:28:48 +02:00
|
|
|
sha256 = "0aldz7rvnfnzb4h447q10k9c9p5ghwzdyn7f6g5lrxiv5vxf3x96";
|
2019-10-05 08:57:58 +02:00
|
|
|
stripRoot = false;
|
2019-05-05 16:26:32 +02:00
|
|
|
};
|
|
|
|
|
2020-04-30 02:29:10 +02:00
|
|
|
nativeBuildInputs = [ mtools ];
|
2019-05-05 16:26:32 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-04-30 02:29:10 +02:00
|
|
|
mkdir -p $out $TEMP/memtest86-files
|
2019-05-05 16:26:32 +02:00
|
|
|
|
|
|
|
# memtest86 is distributed as a bootable USB image. It contains the actual
|
|
|
|
# memtest86 EFI app.
|
|
|
|
#
|
2020-04-30 02:29:10 +02:00
|
|
|
# The following uses dd and mcopy to extract the actual EFI app from the
|
2019-10-05 08:57:58 +02:00
|
|
|
# usb image so that it can be installed directly on the hard drive.
|
2020-04-30 02:29:10 +02:00
|
|
|
dd if=$src/memtest86-usb.img of=$TEMP/ESP.img skip=2048
|
|
|
|
mcopy -i $TEMP/ESP.img ::/EFI/BOOT/ $TEMP/memtest86-files/
|
|
|
|
mv $TEMP/memtest86-files/BOOT/* $out/
|
2019-05-05 16:26:32 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2019-10-05 08:57:58 +02:00
|
|
|
homepage = "http://memtest86.com/";
|
2019-05-05 16:26:32 +02:00
|
|
|
downloadPage = "https://www.memtest86.com/download.htm";
|
|
|
|
description = "A tool to detect memory errors, to be run from a bootloader";
|
|
|
|
longDescription = ''
|
2019-05-05 16:29:29 +02:00
|
|
|
A UEFI app that is able to detect errors in RAM. It can be run from a
|
2019-05-05 16:26:32 +02:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|