3
0
Fork 0
forked from mirrors/nixpkgs

Fix udisks udev rules

svn path=/nixpkgs/trunk/; revision=28658
This commit is contained in:
Yury G. Kudryashov 2011-08-18 12:53:07 +00:00
parent 3df650fa23
commit f7a51ce2ac
2 changed files with 89 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pkgconfig, sg3_utils, udev, glib, dbus, dbus_glib
, polkit, parted, lvm2, libatasmart, intltool, libuuid, mdadm
, libxslt, docbook_xsl, utillinux }:
, libxslt, docbook_xsl, utillinux, automake, autoconf }:
stdenv.mkDerivation rec {
name = "udisks-1.0.3";
@ -10,11 +10,22 @@ stdenv.mkDerivation rec {
sha256 = "0jwavs2ag0cv46517j17943s16a8fw2lqk4k3cljgivh5aswwnyr";
};
# Move 80-udisks.rules manually to make the patch smaller
prePatch = "mv -v data/80-udisks.rules{,.in}";
# Not written a patch that can be accepted upstream yet
postPatch = "sed -e 's@/sbin/mdadm@${mdadm}&@' -i data/80-udisks.rules.in";
patches = [ ./purity.patch ];
buildInputs =
[ pkgconfig sg3_utils udev glib dbus dbus_glib polkit parted
[ sg3_utils udev glib dbus dbus_glib polkit parted
lvm2 libatasmart intltool libuuid libxslt docbook_xsl
];
buildNativeInputs = [ automake autoconf pkgconfig ];
configureFlags = "--localstatedir=/var";
preConfigure =
@ -23,6 +34,8 @@ stdenv.mkDerivation rec {
substituteInPlace src/main.c --replace \
"/sbin:/bin:/usr/sbin:/usr/bin" \
"${utillinux}/bin:${mdadm}/sbin:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin"
automake
'';
meta = {

View file

@ -0,0 +1,74 @@
diff --git a/data/80-udisks.rules.in b/data/80-udisks.rules.in
index 6720394..60b67ed 100644
--- a/data/80-udisks.rules.in
+++ b/data/80-udisks.rules.in
@@ -23,7 +23,7 @@ LABEL="ata_port_cardbus_end"
# this is the case we can trigger a 'change' on the sas_expander device
# when the bsg device appears)
#
-SUBSYSTEM=="sas_expander", ACTION=="add|change", IMPORT{program}="udisks-probe-sas-expander /sys/%p"
+SUBSYSTEM=="sas_expander", ACTION=="add|change", IMPORT{program}="@slashlibdir@/udev/udisks-probe-sas-expander /sys/%p"
##############################################################################################################
@@ -54,7 +54,7 @@ ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="udisks_end"
# import UDISKS_DM_* and UDISKS_LVM2_* properties - the long-term plan is to make the lvm2 and
# device-mapper packages provide this information
#
-KERNEL=="dm-*", IMPORT{program}="udisks-dm-export %M %m"
+KERNEL=="dm-*", IMPORT{program}="@slashlibdir@/udev/udisks-dm-export %M %m"
# Make udevd synthesize a 'change' uevent when last opener of a rw-fd closes the fd - this
# should be part of the device-mapper rules
@@ -63,7 +63,7 @@ KERNEL=="dm-*", OPTIONS+="watch"
##############################################################################################################
# Probe LVM2 Physical Volumes - this will eventually be part of the LVM2 package
-ENV{ID_FS_TYPE}=="LVM2_member", TEST=="/lib/udev/udisks-lvm-pv-export", IMPORT{program}="udisks-lvm-pv-export $env{ID_FS_UUID}"
+ENV{ID_FS_TYPE}=="LVM2_member", TEST=="@slashlibdir@/udev/udisks-lvm-pv-export", IMPORT{program}="@slashlibdir@/udev/udisks-lvm-pv-export $env{ID_FS_UUID}"
##############################################################################################################
@@ -85,7 +85,7 @@ KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="", GOTO="probe_parttable_e
# scan for partition tables both on whole-disk and partitions
#
-IMPORT{program}="udisks-part-id $tempnode"
+IMPORT{program}="@slashlibdir@/udev/udisks-part-id $tempnode"
LABEL="probe_parttable_end"
@@ -109,13 +109,13 @@ LABEL="md_end"
#
# USB ATA enclosures with a SAT layer
-KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="usb", ENV{DEVTYPE}=="disk", IMPORT{program}="udisks-probe-ata-smart $tempnode"
+KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="usb", ENV{DEVTYPE}=="disk", IMPORT{program}="@slashlibdir@/udev/udisks-probe-ata-smart $tempnode"
# ATA disks driven by libata
-KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="ata", ENV{DEVTYPE}=="disk", IMPORT{program}="udisks-probe-ata-smart $tempnode"
+KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="ata", ENV{DEVTYPE}=="disk", IMPORT{program}="@slashlibdir@/udev/udisks-probe-ata-smart $tempnode"
# ATA disks connected via SAS (not driven by libata)
-KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="scsi", ENV{DEVTYPE}=="disk", ENV{ID_VENDOR}=="ATA", IMPORT{program}="udisks-probe-ata-smart $tempnode"
+KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="scsi", ENV{DEVTYPE}=="disk", ENV{ID_VENDOR}=="ATA", IMPORT{program}="@slashlibdir@/udev/udisks-probe-ata-smart $tempnode"
# Example rule for tagging a device with a specific media type. Where and
diff --git a/data/Makefile.am b/data/Makefile.am
index ca6d8ac..ed9faa3 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -25,7 +25,11 @@ $(dbusconf_DATA): $(dbusconf_in_files) Makefile
cp $< $@
udevrulesdir = $(slashlibdir)/udev/rules.d
-udevrules_DATA = 80-udisks.rules
+udevrules_in_files = 80-udisks.rules.in
+udevrules_DATA = $(udevrules_in_files:.rules.in=.rules)
+
+$(udevrules_DATA): $(udevrules_in_files) Makefile
+ @sed -e "s|\@slashlibdir\@|$(slashlibdir)|g" $< > $@
pkgconfigdir = $(datadir)/pkgconfig
pkgconfig_DATA = udisks.pc