udev: complete rework

- systemd puts all into one output now (except for man),
  because I wasn't able to fix all systemd/udev refernces
  for NixOS to work well
- libudev is now by default *copied* into another path,
  which is what most packages will use as build input :-)
- pkgs.udev = [ libudev.out libudev.dev ]; because there are too many
  references that just put `udev` into build inputs (to rewrite them all),
  also this made "${udev}/foo" fail at *evaluation* time
  so it's easier to catch and change to something more specific
This commit is contained in:
Vladimír Čunát 2015-10-03 20:52:03 +02:00
parent ec7a4ddd92
commit b44d846990
23 changed files with 115 additions and 62 deletions

View File

@ -58,13 +58,13 @@ let
--replace \"/bin/mount \"${pkgs.utillinux}/bin/mount
done
echo -n "Checking that all programs called by relative paths in udev rules exist in ${pkgs.udev.out}/lib/udev... "
echo -n "Checking that all programs called by relative paths in udev rules exist in ${udev}/lib/udev... "
import_progs=$(grep 'IMPORT{program}="[^/$]' $out/* |
sed -e 's/.*IMPORT{program}="\([^ "]*\)[ "].*/\1/' | uniq)
run_progs=$(grep -v '^[[:space:]]*#' $out/* | grep 'RUN+="[^/$]' |
sed -e 's/.*RUN+="\([^ "]*\)[ "].*/\1/' | uniq)
for i in $import_progs $run_progs; do
if [[ ! -x ${pkgs.udev.out}/lib/udev/$i && ! $i =~ socket:.* ]]; then
if [[ ! -x ${udev}/lib/udev/$i && ! $i =~ socket:.* ]]; then
echo "FAIL"
echo "$i is called in udev rules but not installed by udev"
exit 1

View File

@ -60,9 +60,9 @@ let
copy_bin_and_libs ${pkgs.mdadm}/sbin/mdadm
# Copy udev.
copy_bin_and_libs ${udev.out}/lib/systemd/systemd-udevd
copy_bin_and_libs ${udev.out}/bin/udevadm
for BIN in ${udev.libudev}/lib/udev/*_id; do
copy_bin_and_libs ${udev}/lib/systemd/systemd-udevd
copy_bin_and_libs ${udev}/bin/udevadm
for BIN in ${udev}/lib/udev/*_id; do
copy_bin_and_libs $BIN
done
@ -146,9 +146,9 @@ let
echo 'ENV{LD_LIBRARY_PATH}="${extraUtils}/lib"' > $out/00-env.rules
cp -v ${udev.out}/lib/udev/rules.d/60-cdrom_id.rules $out/
cp -v ${udev.out}/lib/udev/rules.d/60-persistent-storage.rules $out/
cp -v ${udev.out}/lib/udev/rules.d/80-drivers.rules $out/
cp -v ${udev}/lib/udev/rules.d/60-cdrom_id.rules $out/
cp -v ${udev}/lib/udev/rules.d/60-persistent-storage.rules $out/
cp -v ${udev}/lib/udev/rules.d/80-drivers.rules $out/
cp -v ${pkgs.lvm2}/lib/udev/rules.d/*.rules $out/
${config.boot.initrd.extraUdevRulesCommands}

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, buildEnv, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xorg, udev
, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xorg, libudev
}:
let
@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
--set-rpath ${libPath}:${stdenv.cc.cc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
$out/LightTable/ltbin
ln -sf ${udev.libudev}/lib/libudev.so.1 $out/LightTable/libudev.so.0
ln -sf ${libudev.out}/lib/libudev.so.1 $out/LightTable/libudev.so.0
makeWrapper $out/LightTable/ltbin $out/bin/lighttable \
--prefix "LD_LIBRARY_PATH" : $out/LightTable

View File

@ -8,7 +8,7 @@
, libusb1, libexif, pciutils
, python, pythonPackages, perl, pkgconfig
, nspr, udev, kerberos
, nspr, libudev, kerberos
, utillinux, alsaLib
, bison, gperf
, glib, gtk, dbus_glib
@ -107,7 +107,7 @@ let
buildInputs = defaultDependencies ++ [
which
python perl pkgconfig
nspr udev
nspr libudev
(if useOpenSSL then openssl else nss)
utillinux alsaLib
bison gperf kerberos
@ -135,7 +135,7 @@ let
s|= [^;]*|= base::FilePath().AppendASCII("${libexif}/lib/libexif.so")|
}' chrome/utility/media_galleries/image_metadata_extractor.cc
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${udev.libudev}/lib/\1!' \
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${libudev.out}/lib/\1!' \
device/udev_linux/udev?_loader.cc
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, udev ? null, libobjc, IOKit }:
{ stdenv, fetchurl, pkgconfig, libudev ? null, libobjc, IOKit }:
stdenv.mkDerivation rec {
name = "libusb-1.0.19";
@ -12,13 +12,13 @@ stdenv.mkDerivation rec {
buildInputs = [ pkgconfig ];
propagatedBuildInputs =
stdenv.lib.optional stdenv.isLinux udev ++
stdenv.lib.optional stdenv.isLinux libudev ++
stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ];
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
sed 's,-ludev,-L${udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
sed 's,-ludev,-L${libudev.out}/lib -ludev,' -i $out/lib/libusb-1.0.la
'';
meta = {

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, libxml2, gnutls, devicemapper, perl, python
, iproute, iptables, readline, lvm2, utillinux, udev, libpciaccess, gettext
, iproute, iptables, readline, lvm2, utillinux, systemd, libpciaccess, gettext
, libtasn1, ebtables, libgcrypt, yajl, makeWrapper, pmutils, libcap_ng
, dnsmasq, libnl, libpcap, libxslt, xhtml1
, pythonPackages, perlPackages
@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
buildInputs = [
pkgconfig libxml2 gnutls devicemapper perl python readline lvm2
utillinux udev libpciaccess gettext libtasn1 libgcrypt yajl makeWrapper
utillinux systemd.udev.lib libpciaccess gettext libtasn1 libgcrypt yajl makeWrapper
libcap_ng libnl libxslt xhtml1 perlPackages.XMLXPath
];
preConfigure = ''
PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${udev.out}/sbin:${dnsmasq}/bin:$PATH
PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${systemd.udev.bin}/sbin:${dnsmasq}/bin:$PATH
patchShebangs . # fixes /usr/bin/python references
'';

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig, intltool, autoreconfHook, substituteAll
, file, expat, libdrm, xorg, wayland, udev, llvmPackages, libffi, libomxil-bellagio
, file, expat, libdrm, xorg, wayland, libudev, llvmPackages, libffi, libomxil-bellagio
, libvdpau, libelf, libva
, grsecEnabled
, enableTextureFloats ? false # Texture floats are patented, see docs/patents.txt
@ -48,7 +48,7 @@ stdenv.mkDerivation {
] ++ optional stdenv.isLinux
(substituteAll {
src = ./dlopen-absolute-paths.diff;
inherit (udev) libudev;
libudev = libudev.out;
});
postPatch = ''
@ -107,7 +107,7 @@ stdenv.mkDerivation {
glproto dri2proto dri3proto presentproto
libX11 libXext libxcb libXt libXfixes libxshmfence
libffi wayland libvdpau libelf libXvMC /* libomxil-bellagio libva */
] ++ optional stdenv.isLinux udev;
] ++ optional stdenv.isLinux libudev;
enableParallelBuilding = true;
doCheck = false;

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, buildEnv, makeWrapper
, xorg, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev, libcap
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, libudev, libcap
, libnotify}:
let
bits = if stdenv.system == "x86_64-linux" then "x64"
@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot
ln -s ${udev.libudev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
ln -s ${libudev.out}/lib/libudev.so $out/share/node-webkit/libudev.so.0
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, buildEnv, makeWrapper
, xorg, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev, libcap
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, libudev, libcap
, libnotify}:
let
bits = if stdenv.system == "x86_64-linux" then "x64"
@ -37,7 +37,7 @@ in stdenv.mkDerivation rec {
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/nwjs/nw
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/nwjs/nwjc
ln -s ${udev}/lib/libudev.so $out/share/nwjs/libudev.so.0
ln -s ${libudev.out}/lib/libudev.so $out/share/nwjs/libudev.so.0
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/nwjs" $out/share/nwjs/nw
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/nwjs" $out/share/nwjs/nwjc

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, buildEnv, makeWrapper
, xorg, alsaLib, dbus, glib, gtk, atk, pango, freetype, fontconfig
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, udev}:
, gdk_pixbuf, cairo, zlib, nss, nssTools, nspr, gconf, expat, libudev }:
let
bits = if stdenv.system == "x86_64-linux" then "x64"
else "ia32";
@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nw
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/node-webkit/nwsnapshot
ln -s ${udev.libudev}/lib/libudev.so $out/share/node-webkit/libudev.so.0
ln -s ${libudev.out}/lib/libudev.so $out/share/node-webkit/libudev.so.0
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nw
patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/node-webkit" $out/share/node-webkit/nwsnapshot

View File

@ -1,5 +1,5 @@
x@{builderDefsPackage
, foomatic_filters, bc, unzip, ghostscript, udev, vim
, foomatic_filters, bc, unzip, ghostscript, systemd, vim
, ...}:
builderDefsPackage
(a :
@ -36,7 +36,7 @@ rec {
''PIXMAPS=$out/share/pixmaps''
''UDEVBIN=$out/bin''
''UDEVDIR=$out/etc/udev/rules.d''
''UDEVD=${udev.out}/sbin/udevd''
''UDEVD=${systemd.udev.bin}/sbin/udevd''
''LIBUDEVDIR=$out/lib/udev/rules.d''
''USBDIR=$out/etc/hotplug/usb''
''FOODB=$out/share/foomatic/db/source''

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, flex, udev, perl }:
{ stdenv, fetchurl, flex, systemd, perl }:
assert stdenv.isLinux;
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
preConfigure =
''
export PATH=${udev.out}/sbin:$PATH
export PATH=${systemd.udev.bin}/sbin:$PATH
substituteInPlace user/Makefile.in --replace /sbin/ $out/sbin/
substituteInPlace user/legacy/Makefile.in \
--replace /sbin/ $out/sbin/ \

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils, enable_dmeventd ? false }:
{ stdenv, fetchurl, pkgconfig, systemd, libudev, utillinux, coreutils, enable_dmeventd ? false }:
let
version = "2.02.132";
@ -22,7 +22,7 @@ stdenv.mkDerivation {
] ++ stdenv.lib.optional enable_dmeventd " --enable-dmeventd";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ udev ];
buildInputs = [ libudev ];
preConfigure =
''
@ -30,7 +30,7 @@ stdenv.mkDerivation {
--replace /usr/bin/tr ${coreutils}/bin/tr
substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \
--replace /usr/sbin/lvm $out/sbin/lvm \
--replace /usr/bin/udevadm ${udev.out}/bin/udevadm
--replace /usr/bin/udevadm ${systemd.udev.bin}/bin/udevadm
sed -i /DEFAULT_SYS_DIR/d Makefile.in
sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, lvm2, libaio, gzip, readline, udev }:
{ stdenv, fetchurl, lvm2, libaio, gzip, readline, systemd }:
stdenv.mkDerivation rec {
name = "multipath-tools-0.4.9";
@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx
substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup
substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${udev.libudev}/lib/udev/scsi_id
substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${udev.libudev}/lib/udev/scsi_id
substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${systemd.udev.lib}/lib/udev/scsi_id
substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${systemd.udev.lib}/lib/udev/scsi_id
'';
meta = {

View File

@ -22,10 +22,15 @@ stdenv.mkDerivation rec {
sha256 = "07sc1x43j60d5jnps0d7bfka10fihnpgkdrfrh9iskgmc9qangjb";
};
patches = [ ./hwdb-location.diff ];
/* gave up for now!
outputs = [ "out" "libudev" "doc" ]; # TODO: "dev"
# note: there are many references to ${systemd}/...
outputDev = "out";
propagatedOutputs = "libudev";
*/
outputs = [ "out" "man" ];
buildInputs =
[ linuxHeaders pkgconfig intltool gperf libcap kmod xz pam acl
@ -88,24 +93,26 @@ stdenv.mkDerivation rec {
--replace /sbin/fsck ${utillinux.bin}/sbin/fsck \
--replace /bin/echo ${coreutils}/bin/echo \
--replace /bin/cat ${coreutils}/bin/cat \
--replace /sbin/sulogin ${utillinux}/sbin/sulogin \
--replace /sbin/sulogin ${utillinux.bin}/sbin/sulogin \
--replace /usr/lib/systemd/systemd-fsck $out/lib/systemd/systemd-fsck
done
substituteInPlace src/journal/catalog.c \
--replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
export NIX_CFLAGS_LINK+=" -Wl,-rpath,$libudev/lib"
configureFlagsArray+=("--with-ntp-servers=0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org")
#export NIX_CFLAGS_LINK+=" -Wl,-rpath,$libudev/lib"
'';
/*
makeFlags = [
"udevlibexecdir=$(libudev)/lib/udev"
# udev rules refer to $out, and anything but libs should probably go to $out
"udevrulesdir=$(out)/lib/udev/rules.d"
"udevhwdbdir=$(out)/lib/udev/hwdb.d"
];
*/
PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python
@ -124,8 +131,6 @@ stdenv.mkDerivation rec {
"-USYSTEMD_BINARY_PATH" "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\""
];
enableParallelBuilding = true;
installFlags =
[ "localstatedir=$(TMPDIR)/var"
"sysconfdir=$(out)/etc"
@ -167,7 +172,8 @@ stdenv.mkDerivation rec {
# "kernel-install" shouldn't be used on NixOS.
find $out -name "*kernel-install*" -exec rm {} \;
''; # */
/*
# Move lib(g)udev to a separate output. TODO: maybe split them up
# to avoid libudev pulling glib
mkdir -p "$libudev/lib"
@ -179,8 +185,10 @@ stdenv.mkDerivation rec {
for i in "$out"/lib/pkgconfig/{libudev,gudev-1.0}.pc; do
substituteInPlace $i --replace "libdir=$out" "libdir=$libudev"
done
''; # */
*/
enableParallelBuilding = true;
/*
# some libs fail to link to liblzma and/or libffi
postFixup = let extraLibs = stdenv.lib.makeLibraryPath [ xz.out libffi.out zlib.out ];
in ''
@ -188,6 +196,7 @@ stdenv.mkDerivation rec {
patchelf --set-rpath `patchelf --print-rpath "$f"`':${extraLibs}' "$f"
done
'';
*/
# The interface version prevents NixOS from switching to an
# incompatible systemd at runtime. (Switching across reboots is
@ -205,4 +214,3 @@ stdenv.mkDerivation rec {
};
}

View File

@ -0,0 +1,19 @@
diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c
index 06c9831..e74825c 100644
--- a/src/libsystemd/sd-hwdb/sd-hwdb.c
+++ b/src/libsystemd/sd-hwdb/sd-hwdb.c
@@ -268,13 +268,8 @@ static int trie_search_f(sd_hwdb *hwdb, const char *search) {
}
static const char hwdb_bin_paths[] =
- "/etc/systemd/hwdb/hwdb.bin\0"
"/etc/udev/hwdb.bin\0"
- "/usr/lib/systemd/hwdb/hwdb.bin\0"
-#ifdef HAVE_SPLIT_USR
- "/lib/systemd/hwdb/hwdb.bin\0"
-#endif
- UDEVLIBEXECDIR "/hwdb.bin\0";
+ ;
_public_ int sd_hwdb_new(sd_hwdb **ret) {
_cleanup_hwdb_unref_ sd_hwdb *hwdb = NULL;

View File

@ -0,0 +1,19 @@
{ stdenv, systemd }:
stdenv.mkDerivation {
name = "libudev-${systemd.version}";
unpackPhase = ":";
outputs = [ "dev" "out" ];
installPhase = ''
mkdir -p "$out/lib" "$dev/lib/pkgconfig" "$dev/include"
cp -P "${systemd}"/lib/libudev.* "$out/lib/"
cp -P "${systemd}"/lib/pkgconfig/libudev.pc "$dev/lib/pkgconfig/"
cp -P "${systemd}"/include/libudev.h "$dev/include/"
substituteInPlace "$dev"/lib/pkgconfig/*.pc \
--replace "${systemd}" "$out"
sed "/^includedir=/cincludedir=$dev/include" -i "$dev"/lib/pkgconfig/*.pc
'';
}

View File

@ -1,11 +1,11 @@
{ stdenv, fetchurl, buildPythonPackage, pykickstart, pyparted, pyblock
, libselinux, cryptsetup, multipath_tools, lsof, utillinux
, useNixUdev ? true, udev ? null
, useNixUdev ? true, libudev ? null
# This is only used when useNixUdev is false
, udevSoMajor ? 1
}:
assert useNixUdev -> udev != null;
assert useNixUdev -> libudev != null;
buildPythonPackage rec {
name = "blivet-${version}";
@ -29,7 +29,7 @@ buildPythonPackage rec {
sed -i '/pvscan/s/, *"--cache"//' blivet/devicelibs/lvm.py
'' + (if useNixUdev then ''
sed -i -e '/find_library/,/find_library/ {
c libudev = "${udev.libudev}/lib/libudev.so.1"
c libudev = "${libudev.out}/lib/libudev.so.1"
}' blivet/pyudev.py
'' else ''
sed -i \
@ -40,7 +40,7 @@ buildPythonPackage rec {
propagatedBuildInputs = [
pykickstart pyparted pyblock libselinux cryptsetup
] ++ stdenv.lib.optional useNixUdev udev;
] ++ stdenv.lib.optional useNixUdev libudev;
# tests are currently _heavily_ broken upstream
doCheck = false;

View File

@ -10,7 +10,7 @@ let
inherit stdenv fetchurl buildPythonPackage;
inherit pykickstart pyparted pyblock cryptsetup multipath_tools;
inherit useNixUdev udevSoMajor;
inherit (pkgs) lsof utillinux udev;
inherit (pkgs) lsof utillinux libudev;
libselinux = pkgs.libselinux.override { enablePython = true; };
};
@ -27,12 +27,12 @@ let
lvm2 = import ./lvm2.nix {
inherit stdenv fetchurl;
inherit (pkgs) pkgconfig utillinux udev coreutils;
inherit (pkgs) pkgconfig utillinux libudev systemd coreutils;
};
multipath_tools = import ./multipath-tools.nix {
inherit stdenv fetchurl lvm2;
inherit (pkgs) readline udev libaio gzip;
inherit (pkgs) readline systemd libaio gzip;
};
parted = import ./parted.nix {

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils }:
{ stdenv, fetchurl, pkgconfig, libudev, systemd, utillinux, coreutils }:
let
v = "2.02.106";
@ -15,7 +15,7 @@ stdenv.mkDerivation {
configureFlags =
"--disable-readline --enable-udev_rules --enable-udev_sync --enable-pkgconfig --enable-applib";
buildInputs = [ pkgconfig udev ];
buildInputs = [ pkgconfig libudev ];
preConfigure =
''
@ -23,7 +23,7 @@ stdenv.mkDerivation {
--replace /usr/bin/tr ${coreutils}/bin/tr
substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \
--replace /usr/sbin/lvm $out/sbin/lvm \
--replace /usr/bin/udevadm ${udev.out}/bin/udevadm
--replace /usr/bin/udevadm ${systemd.udev.bin}/bin/udevadm
sed -i /DEFAULT_SYS_DIR/d Makefile.in
sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, lvm2, libaio, gzip, readline, udev }:
{ stdenv, fetchurl, lvm2, libaio, gzip, readline, systemd }:
stdenv.mkDerivation rec {
name = "multipath-tools-0.4.9";
@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx
substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup
substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${udev.libudev}/lib/udev/scsi_id
substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${udev.libudev}/lib/udev/scsi_id
substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${systemd.udev.lib}/lib/udev/scsi_id
substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${systemd.udev.lib}/lib/udev/scsi_id
'';
meta = {

View File

@ -10188,7 +10188,11 @@ let
systemd = callPackage ../os-specific/linux/systemd {
linuxHeaders = linuxHeaders_3_18;
};
}
// {
udev.bin = systemd; # ${systemd.udev.bin}/bin/udevadm
udev.lib = libudev.out; # ${systemd.udev.lib}/lib/libudev.*
};
systemtap = callPackage ../development/tools/profiling/systemtap {
inherit (gnome) libglademm;
@ -10271,8 +10275,11 @@ let
cross = assert crossSystem != null; crossSystem;
});
# This hacky alias covers most use cases without mass-replace (build inputs)
# and causes an *evaluation* error if "${udev}" is attempted.
udev = [ libudev.dev libudev.out ];
libudev = callPackage ../os-specific/linux/systemd/libudev.nix { };
udev = pkgs.systemd; # headers are not in the libudev output
eudev = callPackage ../os-specific/linux/eudev {};
udisks1 = callPackage ../os-specific/linux/udisks/1-default.nix { };

View File

@ -11951,7 +11951,7 @@ let
postPatch = ''
sed -i -e '/udev_library_name/,/^ *libudev/ {
s|CDLL([^,]*|CDLL("${pkgs.udev.libudev}/lib/libudev.so.1"|p; d
s|CDLL([^,]*|CDLL("${pkgs.libudev.out}/lib/libudev.so.1"|p; d
}' pyudev/_libudev.py
'';