summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorsymphorien <symphorien@users.noreply.github.com>2016-12-25 20:43:46 +0100
committerJörg Thalheim <joerg@higgsboson.tk>2016-12-25 20:43:46 +0100
commitf49a23c28e8382d60136efeb3ef47844fe9da6fb (patch)
tree62b56fb419ebed1218316f66522c5d346a6cb827 /pkgs
parent7b2a37f5c8fab26c23907072fe44ac41e2317fc3 (diff)
downloadnixpkgs-f49a23c28e8382d60136efeb3ef47844fe9da6fb.tar
nixpkgs-f49a23c28e8382d60136efeb3ef47844fe9da6fb.tar.gz
nixpkgs-f49a23c28e8382d60136efeb3ef47844fe9da6fb.tar.bz2
nixpkgs-f49a23c28e8382d60136efeb3ef47844fe9da6fb.tar.lz
nixpkgs-f49a23c28e8382d60136efeb3ef47844fe9da6fb.tar.xz
nixpkgs-f49a23c28e8382d60136efeb3ef47844fe9da6fb.tar.zst
nixpkgs-f49a23c28e8382d60136efeb3ef47844fe9da6fb.zip
os-prober: init at 1.65 (#21409)
* os-prober: init at 1.65

* os-prober: fix source url

* os-prober: use sha256 instead of md5
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/misc/os-prober/default.nix77
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix
new file mode 100644
index 00000000000..8d2f15734c5
--- /dev/null
+++ b/pkgs/tools/misc/os-prober/default.nix
@@ -0,0 +1,77 @@
+{ 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
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.65";
+  name = "os-prober-${version}";
+  src = fetchurl {
+    url = "mirror://debian/pool/main/o/os-prober/os-prober_${version}.tar.xz";
+    sha256 = "c4a7661a52edae722f7e6bacb3f107cf7086cbe768275fadf5398d04360bfc84";
+  };
+
+  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
+
+    # probes
+    case "${stdenv.system}" in
+        i686*|x86_64*) ARCH=x86;;
+        powerpc*) ARCH=powerpc;;
+        arm*) ARCH=arm;;
+        *) 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;
+      if [ -e "$probes/$ARCH" ]; then
+        mkdir -p $out/lib/$probes
+        cp -r $probes/$ARCH/* $out/lib/$probes;
+      fi;
+    done
+    if [ $ARCH = "x86" ]; then
+        cp -r os-probes/mounted/powerpc/20macosx $out/lib/os-probes/mounted;
+    fi;
+  '';
+  postFixup = ''
+    for file in $(find $out  -type f ! -name newns) ; do
+      substituteInPlace $file \
+        --replace /usr/share/os-prober/ $out/share/ \
+        --replace /usr/lib/os-probes/ $out/lib/os-probes/ \
+        --replace /usr/lib/linux-boot-probes/ $out/lib/linux-boot-probes/ \
+        --replace /usr/lib/os-prober/ $out/lib/
+    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 ]
+            )
+          )
+        }" \
+        --run "[ -d /var/lib/os-prober ] || mkdir /var/lib/os-prober"
+    done;
+  '';
+
+  meta = {
+    description = "Utility to detect other OSs on a set of drives";
+    homepage = http://packages.debian.org/source/sid/os-prober;
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e7b135e2911..95b8baf7be2 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3133,6 +3133,8 @@ in
 
   olsrd = callPackage ../tools/networking/olsrd { };
 
+  os-prober = callPackage ../tools/misc/os-prober {};
+
   ossec = callPackage ../tools/security/ossec {};
 
   ostree = callPackage ../tools/misc/ostree { };