diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 0bf5a2f3c80c..47d6dd2bf54b 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -43,7 +43,7 @@ let cp -pv ${pkgs.glibc}/lib/ld*.so.? $out/lib copy_bin_and_libs () { - [ -f "$out/bin/$(basename $1)" ] && return 0 + [ -f "$out/bin/$(basename $1)" ] && rm "$out/bin/$(basename $1)" cp -pdv $1 $out/bin LDD="$(ldd $1)" || return 0 LIBS="$(echo "$LDD" | awk '{print $3}' | sed '/^$/d')" @@ -110,11 +110,11 @@ let echo "testing patched programs..." $out/bin/ash -c 'echo hello world' | grep "hello world" export LD_LIBRARY_PATH=$out/lib - $out/bin/mount --help 2>&1 | grep "BusyBox" - $out/bin/blkid >/dev/null + $out/bin/mount --help 2>&1 | grep -q "BusyBox" + $out/bin/blkid --help 2>&1 | grep -q 'libblkid' $out/bin/udevadm --version - $out/bin/dmsetup --version 2>&1 | tee -a log | grep "version:" - LVM_SYSTEM_DIR=$out $out/bin/lvm version 2>&1 | tee -a log | grep "LVM" + $out/bin/dmsetup --version 2>&1 | tee -a log | grep -q "version:" + LVM_SYSTEM_DIR=$out $out/bin/lvm version 2>&1 | tee -a log | grep -q "LVM" $out/bin/mdadm --version ${config.boot.initrd.extraUtilsCommandsTest}