10 stdenv.mkDerivation rec {
11 pname = "memtest86-efi";
15 # We're using the Internet Archive Wayback Machine because the company developing MemTest86 has stopped providing a versioned download link for the latest version:
16 # https://forums.passmark.com/memtest86/44494-version-8-1-distribution-file-is-not-versioned
17 url = "https://web.archive.org/web/20211111004725/https://www.memtest86.com/downloads/memtest86-usb.zip";
18 sha256 = "sha256-GJdZCUFw1uX4HcaaAy5QqDGNqHTFtrqla13wF7xCAaM=";
31 # memtest86 is distributed as a bootable USB image. It contains the actual
34 # The following uses sfdisk to calculate the offset of the FAT EFI System
35 # Partition in the disk image, and mcopy to extract the actual EFI app from
36 # the filesystem so that it can be installed directly on the hard drive.
37 IMG=$src/memtest86-usb.img
38 ESP_OFFSET=$(sfdisk --json $IMG | jq -r '
39 # Partition type GUID identifying EFI System Partitions
40 def ESP_GUID: "C12A7328-F81F-11D2-BA4B-00A0C93EC93B";
42 .sectorsize * (.partitions[] | select(.type == ESP_GUID) | .start)
45 mcopy -vsi $IMG@@$ESP_OFFSET ::'/EFI/BOOT/*' $out/
51 homepage = "https://www.memtest86.com/";
52 downloadPage = "https://www.memtest86.com/download.htm";
53 changelog = "https://www.memtest86.com/whats-new.html";
54 description = "Tool to detect memory errors, to be run from a bootloader";
56 A UEFI app that is able to detect errors in RAM. It can be run from a
57 bootloader. Released under a proprietary freeware license.
59 # MemTest86 Free Edition is free to download with no restrictions on usage. However, the source code is not available.
60 # https://www.memtest86.com/tech_license-information.html
61 license = licenses.unfreeRedistributable;
62 maintainers = with maintainers; [ cdepillabout ];
63 platforms = platforms.linux;