about summary refs log tree commit diff
path: root/pkgs/tools/misc/os-prober
diff options
context:
space:
mode:
authorSymphorien Gibol <symphorien+git@xlumurb.eu>2018-05-26 20:47:52 +0200
committerSymphorien Gibol <symphorien+git@xlumurb.eu>2018-05-26 20:47:52 +0200
commitf8d08ec818554293c22ca1cf1c500411a13c4560 (patch)
tree3b1d6fb4bdeaad164d0757f22457c455068f4af2 /pkgs/tools/misc/os-prober
parentb04f9b7d28956c39042367373085d52898197d42 (diff)
downloadnixlib-f8d08ec818554293c22ca1cf1c500411a13c4560.tar
nixlib-f8d08ec818554293c22ca1cf1c500411a13c4560.tar.gz
nixlib-f8d08ec818554293c22ca1cf1c500411a13c4560.tar.bz2
nixlib-f8d08ec818554293c22ca1cf1c500411a13c4560.tar.lz
nixlib-f8d08ec818554293c22ca1cf1c500411a13c4560.tar.xz
nixlib-f8d08ec818554293c22ca1cf1c500411a13c4560.tar.zst
nixlib-f8d08ec818554293c22ca1cf1c500411a13c4560.zip
os-prober: fix dependencies
busybox seems to have never been needed
systemd was meant to provide udevadm; use libudev instead
devicemapper is now uneeded, replaced by grub-mount and grub-info
dmraid does not appear in the current code
Diffstat (limited to 'pkgs/tools/misc/os-prober')
-rw-r--r--pkgs/tools/misc/os-prober/default.nix37
1 files changed, 12 insertions, 25 deletions
diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix
index b3f4d63c8c6e..f10ecbe2a5ed 100644
--- a/pkgs/tools/misc/os-prober/default.nix
+++ b/pkgs/tools/misc/os-prober/default.nix
@@ -1,13 +1,11 @@
 { stdenv, fetchurl, makeWrapper,
-systemd, # udevadm
-busybox,
-coreutils, # os-prober desn't seem to work with pure busybox
-devicemapper, # lvs
-# optional dependencies
-cryptsetup ? null,
-libuuid ? null, # blkid and blockdev
-dmraid ? null,
-ntfs3g ? null
+# optional dependencies, the command(s) they provide
+coreutils,  # mktemp
+grub2,      # grub-mount and grub-probe
+cryptsetup, # cryptsetup
+libuuid,    # blkid and blockdev
+libudev,    # udevadm udevinfo
+ntfs3g      # ntfs3g
 }:
 
 stdenv.mkDerivation rec {
@@ -21,12 +19,9 @@ stdenv.mkDerivation rec {
   buildInputs = [ makeWrapper ];
   installPhase = ''
     # executables
-    mkdir -p $out/bin
-    mkdir -p $out/lib
-    mkdir -p $out/share
-    cp os-prober linux-boot-prober $out/bin
-    cp newns $out/lib
-    cp common.sh $out/share
+    install -Dt $out/bin os-prober linux-boot-prober
+    install -Dt $out/lib newns
+    install -Dt $out/share common.sh
 
     # probes
     case "${stdenv.system}" in
@@ -36,8 +31,7 @@ stdenv.mkDerivation rec {
         *) ARCH=other;;
     esac;
     for probes in os-probes os-probes/mounted os-probes/init linux-boot-probes linux-boot-probes/mounted; do
-      mkdir -p $out/lib/$probes;
-      cp $probes/common/* $out/lib/$probes;
+      install -Dt $out/lib/$probes $probes/common/*;
       if [ -e "$probes/$ARCH" ]; then
         mkdir -p $out/lib/$probes
         cp -r $probes/$ARCH/* $out/lib/$probes;
@@ -57,14 +51,7 @@ stdenv.mkDerivation rec {
     done;
     for file in $out/bin/*; do
       wrapProgram $file \
-        --set LVM_SYSTEM_DIR ${devicemapper} \
-        --suffix PATH : "$out/bin${builtins.foldl' (x: y: x + ":" + y) "" (
-          map (x: (toString x) + "/bin") (
-            builtins.filter (x: x!=null)
-              [ devicemapper systemd coreutils cryptsetup libuuid dmraid ntfs3g busybox ]
-            )
-          )
-        }" \
+        --suffix PATH : ${stdenv.lib.makeBinPath [ grub2 libudev coreutils cryptsetup libuuid ntfs3g ]} \
         --run "[ -d /var/lib/os-prober ] || mkdir /var/lib/os-prober"
     done;
   '';