From 3e09239882d84a26b4d9d9597b54682412992263 Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Sat, 26 May 2018 20:44:38 +0200 Subject: [PATCH 1/4] grub2: compile grub-mount as well It is a dependency of os-prober >= 1.75 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860833#23 --- pkgs/tools/misc/grub/2.0x.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index 96ce38ea9e8..84c06a49f84 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,5 +1,6 @@ { stdenv, fetchurl, fetchFromSavannah, autogen, flex, bison, python, autoconf, automake , gettext, ncurses, libusb, freetype, qemu, devicemapper, unifont, pkgconfig +, fuse # only needed for grub-mount , zfs ? null , efiSupport ? false , zfsSupport ? true @@ -47,7 +48,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ bison flex python pkgconfig ]; - buildInputs = [ ncurses libusb freetype gettext devicemapper ] + buildInputs = [ ncurses libusb freetype gettext devicemapper fuse ] ++ optional doCheck qemu ++ optional zfsSupport zfs; @@ -83,7 +84,8 @@ stdenv.mkDerivation rec { patches = [ ./fix-bash-completion.patch ]; - configureFlags = optional zfsSupport "--enable-libzfs" + configureFlags = [ "--enable-grub-mount" ] # dep of os-prober + ++ optional zfsSupport "--enable-libzfs" ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.system}.target}" "--program-prefix=" ] ++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.system}.target}"]; From b04f9b7d28956c39042367373085d52898197d42 Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Sat, 26 May 2018 20:46:30 +0200 Subject: [PATCH 2/4] os-prober: switch to a non-transient url pool urls get removed after some time --- pkgs/tools/misc/os-prober/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix index b879f621e14..b3f4d63c8c6 100644 --- a/pkgs/tools/misc/os-prober/default.nix +++ b/pkgs/tools/misc/os-prober/default.nix @@ -14,8 +14,8 @@ stdenv.mkDerivation rec { version = "1.76"; name = "os-prober-${version}"; src = fetchurl { - url = "mirror://debian/pool/main/o/os-prober/os-prober_${version}.tar.xz"; - sha256 = "1vb45i76bqivlghrq7m3n07qfmmq4wxrkplqx8gywj011rhq19fk"; + url = "https://salsa.debian.org/philh/os-prober/-/archive/${version}/os-prober-${version}.tar.bz2"; + sha256 = "07rw3092pckh21vx6y4hzqcn3wn4cqmwxaaiq100lncnhmszg11g"; }; buildInputs = [ makeWrapper ]; From f8d08ec818554293c22ca1cf1c500411a13c4560 Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Sat, 26 May 2018 20:47:52 +0200 Subject: [PATCH 3/4] 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 --- pkgs/tools/misc/os-prober/default.nix | 37 +++++++++------------------ 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix index b3f4d63c8c6..f10ecbe2a5e 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; ''; From b8ea160bf374a8208278aaf627d539ff1de1ce76 Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Sat, 26 May 2018 20:49:47 +0200 Subject: [PATCH 4/4] os-prober: add symphorien as maintainer --- pkgs/tools/misc/os-prober/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix index f10ecbe2a5e..c4a304e0d28 100644 --- a/pkgs/tools/misc/os-prober/default.nix +++ b/pkgs/tools/misc/os-prober/default.nix @@ -56,9 +56,10 @@ stdenv.mkDerivation rec { done; ''; - meta = { + meta = with stdenv.lib; { 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; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ symphorien ]; }; }