2020-05-15 21:57:56 +00:00
{ stdenv
, lib
, fetchzip
2020-11-24 20:58:05 +00:00
, util-linux
2020-05-15 21:57:56 +00:00
, jq
, mtools
} :
2020-04-24 23:36:52 +00:00
stdenv . mkDerivation rec {
pname = " m e m t e s t 8 6 - e f i " ;
2021-12-19 01:06:50 +00:00
version = " 9 . 3 . 1 0 0 0 " ;
2020-04-24 23:36:52 +00:00
src = fetchzip {
2021-12-19 01:06:50 +00:00
# We're using the Internet Archive Wayback Machine because the company developing MemTest86 has stopped providing a versioned download link for the latest version:
# https://forums.passmark.com/memtest86/44494-version-8-1-distribution-file-is-not-versioned
url = " h t t p s : / / w e b . a r c h i v e . o r g / w e b / 2 0 2 1 1 1 1 1 0 0 4 7 2 5 / h t t p s : / / w w w . m e m t e s t 8 6 . c o m / d o w n l o a d s / m e m t e s t 8 6 - u s b . z i p " ;
sha256 = " s h a 2 5 6 - G J d Z C U F w 1 u X 4 H c a a A y 5 Q q D G N q H T F t r q l a 1 3 w F 7 x C A a M = " ;
2020-04-24 23:36:52 +00:00
stripRoot = false ;
} ;
2020-05-15 21:57:56 +00:00
nativeBuildInputs = [
2020-11-24 20:58:05 +00:00
util-linux
2020-05-15 21:57:56 +00:00
jq
mtools
] ;
2020-04-24 23:36:52 +00:00
installPhase = ''
2021-02-24 18:30:23 +00:00
runHook preInstall
2020-04-24 23:36:52 +00:00
# memtest86 is distributed as a bootable USB image. It contains the actual
# memtest86 EFI app.
#
2020-05-15 21:57:56 +00:00
# The following uses sfdisk to calculate the offset of the FAT EFI System
# Partition in the disk image, and mcopy to extract the actual EFI app from
# the filesystem so that it can be installed directly on the hard drive.
IMG = $ src/memtest86-usb.img
ESP_OFFSET = $ ( sfdisk - - json $ IMG | jq - r '
# Partition type GUID identifying EFI System Partitions
def ESP_GUID : " C 1 2 A 7 3 2 8 - F 8 1 F - 1 1 D 2 - B A 4 B - 0 0 A 0 C 9 3 E C 9 3 B " ;
. partitiontable |
. sectorsize * ( . partitions [ ] | select ( . type == ESP_GUID ) | . start )
' )
mkdir $ out
mcopy - vsi $ IMG @ @ $ ESP_OFFSET : : ' /EFI/BOOT /* ' $ o u t /
2021-02-24 18:30:23 +00:00
runHook postInstall
2020-04-24 23:36:52 +00:00
'' ;
meta = with lib ; {
2021-12-19 01:06:50 +00:00
homepage = " h t t p s : / / w w w . m e m t e s t 8 6 . c o m / " ;
2020-04-24 23:36:52 +00:00
downloadPage = " h t t p s : / / w w w . m e m t e s t 8 6 . c o m / d o w n l o a d . h t m " ;
2021-12-19 01:06:50 +00:00
changelog = " h t t p s : / / w w w . m e m t e s t 8 6 . c o m / w h a t s - n e w . h t m l " ;
2024-06-20 14:57:18 +00:00
description = " T o o l t o d e t e c t m e m o r y e r r o r s , t o b e r u n f r o m a b o o t l o a d e r " ;
2020-04-24 23:36:52 +00:00
longDescription = ''
A UEFI app that is able to detect errors in RAM . It can be run from a
bootloader . Released under a proprietary freeware license .
'' ;
2021-12-19 01:06:50 +00:00
# MemTest86 Free Edition is free to download with no restrictions on usage. However, the source code is not available.
# https://www.memtest86.com/tech_license-information.html
2020-04-24 23:36:52 +00:00
license = licenses . unfreeRedistributable ;
maintainers = with maintainers ; [ cdepillabout ] ;
platforms = platforms . linux ;
} ;
}