Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 112f522d48c5
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 16144baa1eca
Choose a head ref
  • 4 commits
  • 4 files changed
  • 3 contributors

Commits on Jul 28, 2019

  1. Add package for libguesfs containing libguestfs appliances

    Appliances are necessary when building images using virt-builder.
    (e.g. `virt-builder -o debian-9.img debian-9`)
    
    Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>
    (cherry picked from commit ecb90ae)
    Roosembert Palacios authored and cdepillabout committed Jul 28, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Moredread André-Patrick Bubel
    Copy the full SHA
    1e6c910 View commit details
  2. memtest86-efi: init at 8.0 (backport to 19.03)

    This creates a new package, memtest86-efi.  This is a recent version of
    the unfree version of memtest86.
    
    There appear to be no restrictions on the use or redistribution of this.
    
    Backport from #60967.
    
    (cherry picked from commit d273bf5eb4335e60e7d2c8d63f2325aab4b1041d)
    (cherry picked from commit e01e13a5477b7efb503ac5eb26e3cc2bde1375b9)
    (cherry picked from commit 439a7552bd2e074f97ac574f360e23f1c20ba769)
    (cherry picked from commit 4abafaf3ccdc1b067804ceb8f4e9e26805ee4513)
    cdepillabout committed Jul 28, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Moredread André-Patrick Bubel
    Copy the full SHA
    9168977 View commit details
  3. nixos/systemd-boot: add support for memtest86 EFI app (backport to 19…

    ….03)
    
    This commit adds support for installing the memtest86 EFI app and adding
    a boot entry for it with systemd-boot.
    
    Backported from #61036.
    
    (cherry picked from commit b12ea62)
    (cherry picked from commit d88d675)
    cdepillabout committed Jul 28, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Moredread André-Patrick Bubel
    Copy the full SHA
    3c21a29 View commit details
  4. Merge pull request #61806 from cdepillabout/backport-memtest86

    memtest86-efi: backport to 19.03
    samueldr authored Jul 28, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stigtsp Stig
    Copy the full SHA
    16144ba View commit details
Original file line number Diff line number Diff line change
@@ -33,6 +33,15 @@ def system_dir(profile, generation):
options {kernel_params}
"""

# The boot loader entry for memtest86.
#
# TODO: This is hard-coded to use the 64-bit EFI app, but it could probably
# be updated to use the 32-bit EFI app on 32-bit systems. The 32-bit EFI
# app filename is BOOTIA32.efi.
MEMTEST_BOOT_ENTRY = """title MemTest86
efi /efi/memtest86/BOOTX64.efi
"""

def write_loader_conf(profile, generation):
with open("@efiSysMountPoint@/loader/loader.conf.tmp", 'w') as f:
if "@timeout@" != "":
@@ -201,6 +210,24 @@ def main():
if os.readlink(system_dir(*gen)) == args.default_config:
write_loader_conf(*gen)

memtest_entry_file = "@efiSysMountPoint@/loader/entries/memtest86.conf"
if os.path.exists(memtest_entry_file):
os.unlink(memtest_entry_file)
shutil.rmtree("@efiSysMountPoint@/efi/memtest86", ignore_errors=True)
if "@memtest86@" != "":
mkdir_p("@efiSysMountPoint@/efi/memtest86")
for path in glob.iglob("@memtest86@/*"):
if os.path.isdir(path):
shutil.copytree(path, os.path.join("@efiSysMountPoint@/efi/memtest86", os.path.basename(path)))
else:
shutil.copy(path, "@efiSysMountPoint@/efi/memtest86/")

memtest_entry_file = "@efiSysMountPoint@/loader/entries/memtest86.conf"
memtest_entry_file_tmp_path = "%s.tmp" % memtest_entry_file
with open(memtest_entry_file_tmp_path, 'w') as f:
f.write(MEMTEST_BOOT_ENTRY)
os.rename(memtest_entry_file_tmp_path, memtest_entry_file)

# Since fat32 provides little recovery facilities after a crash,
# it can leave the system in an unbootable state, when a crash/outage
# happens shortly after an update. To decrease the likelihood of this
15 changes: 15 additions & 0 deletions nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@ let
inherit (cfg) consoleMode;

inherit (efi) efiSysMountPoint canTouchEfiVariables;

memtest86 = if cfg.memtest86.enable then pkgs.memtest86-efi else "";
};
in {

@@ -101,6 +103,19 @@ in {
</itemizedlist>
'';
};

memtest86 = {
enable = mkOption {
default = false;
type = types.bool;
description = ''
Make MemTest86 available from the systemd-boot menu. MemTest86 is a
program for testing memory. MemTest86 is an unfree program, so
this requires <literal>allowUnfree</literal> to be set to
<literal>true</literal>.
'';
};
};
};

config = mkIf cfg.enable {
55 changes: 55 additions & 0 deletions pkgs/tools/misc/memtest86-efi/default.nix
Original file line number Diff line number Diff line change
@@ -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 = ''
A 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;
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -4239,6 +4239,8 @@ in

memtest86 = callPackage ../tools/misc/memtest86 { };

memtest86-efi = callPackage ../tools/misc/memtest86-efi { };

memtest86plus = callPackage ../tools/misc/memtest86+ { };

meo = callPackage ../tools/security/meo {
@@ -11069,6 +11071,8 @@ in

libguestfs-appliance = callPackage ../development/libraries/libguestfs/appliance.nix {};
libguestfs = callPackage ../development/libraries/libguestfs { };
libguestfs-with-appliance = libguestfs.override { appliance = libguestfs-appliance; };


libhangul = callPackage ../development/libraries/libhangul { };