1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

nixos/initrd: Allow overriding of binaries

This commit is contained in:
William A. Kennington III 2015-03-29 21:26:39 -07:00
parent 0ff1fcf1f1
commit 6b3cf366d7

View file

@ -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}