Trivial merge with trunk
svn path=/nixpkgs/branches/stdenv-updates/; revision=28802
This commit is contained in:
commit
b65578c776
@ -1,27 +1,30 @@
|
||||
{ stdenv, fetchurl, pkgconfig, udev }:
|
||||
|
||||
let
|
||||
v = "2.02.86";
|
||||
v = "2.02.87";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "lvm2-${v}";
|
||||
|
||||
|
||||
src = fetchurl {
|
||||
url = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${v}.tgz";
|
||||
sha256 = "0bam8ampdqn4xx2agrvh5vn4xdi0gb9lmfsm31fm302y52jsyz2m";
|
||||
sha256 = "04d605dac9r0yz9khx9pq6a8jdsf9arda2rz1a2d1qr3jhlw4kvg";
|
||||
};
|
||||
|
||||
|
||||
configureFlags =
|
||||
"--disable-readline --enable-udev_rules --enable-udev_sync --enable-pkgconfig --enable-applib";
|
||||
|
||||
buildInputs = [ pkgconfig udev ];
|
||||
|
||||
|
||||
patches = [ ./purity.patch ];
|
||||
|
||||
# To prevent make install from failing.
|
||||
preInstall = "installFlags=\"OWNER= GROUP= confdir=$out/etc\"";
|
||||
|
||||
meta = {
|
||||
homepage = http://sourceware.org/lvm2/;
|
||||
descriptions = "Tools to support Logical Volume Management (LVM) on Linux";
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
|
55
pkgs/os-specific/linux/lvm2/purity.patch
Normal file
55
pkgs/os-specific/linux/lvm2/purity.patch
Normal file
@ -0,0 +1,55 @@
|
||||
TODO: fix path to blkid as well.
|
||||
|
||||
Currently we set it to /sbin/blkid because in nixos we fix a lot of references
|
||||
to /sbin/blkid anyway.
|
||||
|
||||
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
|
||||
index 605e088..8865d54 100644
|
||||
--- a/udev/10-dm.rules.in
|
||||
+++ b/udev/10-dm.rules.in
|
||||
@@ -19,9 +19,8 @@ KERNEL=="device-mapper", NAME="(DM_DIR)/control"
|
||||
SUBSYSTEM!="block", GOTO="dm_end"
|
||||
KERNEL!="dm-[0-9]*", GOTO="dm_end"
|
||||
|
||||
-# Set proper sbin path, /sbin has higher priority than /usr/sbin.
|
||||
-ENV{DM_SBIN_PATH}="/sbin"
|
||||
-TEST!="$env{DM_SBIN_PATH}/dmsetup", ENV{DM_SBIN_PATH}="/usr/sbin"
|
||||
+# Set proper sbin path. Exit if dmsetup is not present.
|
||||
+ENV{DM_SBIN_PATH}="(sbindir)"
|
||||
TEST!="$env{DM_SBIN_PATH}/dmsetup", GOTO="dm_end"
|
||||
|
||||
# Device created, major and minor number assigned - "add" event generated.
|
||||
diff --git a/udev/13-dm-disk.rules b/udev/13-dm-disk.rules
|
||||
index 271ca22..cdc583f 100644
|
||||
--- a/udev/13-dm-disk.rules
|
||||
+++ b/udev/13-dm-disk.rules
|
||||
@@ -19,7 +19,7 @@ ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
|
||||
|
||||
ENV{DM_SUSPENDED}=="1", GOTO="dm_end"
|
||||
|
||||
-IMPORT{program}="$env{DM_SBIN_PATH}/blkid -o udev -p $tempnode"
|
||||
+IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
|
||||
ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100"
|
||||
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
|
||||
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
|
||||
diff --git a/udev/Makefile.in b/udev/Makefile.in
|
||||
index 11635bb..49cf732 100644
|
||||
--- a/udev/Makefile.in
|
||||
+++ b/udev/Makefile.in
|
||||
@@ -12,6 +12,7 @@
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
srcdir = @srcdir@
|
||||
+sbindir = @sbindir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
@@ -26,7 +27,7 @@ include $(top_builddir)/make.tmpl
|
||||
vpath %.rules $(srcdir)
|
||||
|
||||
%.rules: %.rules.in
|
||||
- $(SED) -e "s/(DM_DIR)/$(DM_DIR)/" $< >$@
|
||||
+ $(SED) -e "s/(DM_DIR)/$(DM_DIR)/" -e "s|(sbindir)|$(sbindir)|" $< >$@
|
||||
|
||||
%_install: %.rules
|
||||
$(INSTALL_DATA) -D $< $(udevdir)/$(<F)
|
@ -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}/libexec/scsi_id
|
||||
substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${udev}/libexec/scsi_id
|
||||
substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id
|
||||
substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${udev}/lib/udev/scsi_id
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
@ -4,11 +4,11 @@
|
||||
assert stdenv ? glibc;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "udev-172";
|
||||
name = "udev-173";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://kernel/linux/utils/kernel/hotplug/${name}.tar.bz2";
|
||||
sha256 = "0smxggvhhilcqcsi98fmk0nngzy1x8v6ibas609zysgza74rr5dq";
|
||||
sha256 = "1bxadi4bi11v8ipzj22wknv8hsb0wgdb99bx3w9w33rgl4aq78bh";
|
||||
};
|
||||
|
||||
buildInputs = [ gperf pkgconfig glib acl libusb usbutils ];
|
||||
@ -16,33 +16,36 @@ stdenv.mkDerivation rec {
|
||||
configureFlags =
|
||||
''
|
||||
--with-pci-ids-path=${pciutils}/share/pci.ids
|
||||
--disable-introspection
|
||||
--enable-udev_acl --enable-edd
|
||||
--disable-introspection --libexecdir=$(out)/lib/udev
|
||||
--with-firmware-path=/root/test-firmware:/var/run/current-system/firmware
|
||||
'';
|
||||
|
||||
# Workaround for the Linux kernel headers being too old.
|
||||
NIX_CFLAGS_COMPILE = "-DBTN_TRIGGER_HAPPY=0x2c0";
|
||||
|
||||
|
||||
postInstall =
|
||||
''
|
||||
# The path to rule_generator.functions in write_cd_rules and
|
||||
# write_net_rules is broken. Also, don't store the mutable
|
||||
# persistant rules in /etc/udev/rules.d but in
|
||||
# /var/lib/udev/rules.d.
|
||||
for i in $out/libexec/write_cd_rules $out/libexec/write_net_rules; do
|
||||
for i in $out/lib/udev/write_cd_rules $out/lib/udev/write_net_rules; do
|
||||
substituteInPlace $i \
|
||||
--replace /lib/udev $out/libexec \
|
||||
--replace /lib/udev $out/lib/udev \
|
||||
--replace /etc/udev/rules.d /var/lib/udev/rules.d
|
||||
done
|
||||
|
||||
# Don't set PATH to /bin:/sbin; won't work in NixOS.
|
||||
sed -e '/PATH=/d' -i $out/libexec/rule_generator.functions
|
||||
sed -e '/PATH=/d' -i $out/lib/udev/rule_generator.functions
|
||||
|
||||
ln -s $out/lib/ConsoleKit $out/etc/ConsoleKit
|
||||
ln -sv $out/lib/ConsoleKit $out/etc/ConsoleKit
|
||||
|
||||
rm -rf $out/share/gtk-doc
|
||||
rm -frv $out/share/gtk-doc
|
||||
'';
|
||||
|
||||
|
||||
patches = [ ./custom-rules.patch ];
|
||||
|
||||
meta = {
|
||||
homepage = http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html;
|
||||
description = "Udev manages the /dev filesystem";
|
91
pkgs/os-specific/linux/udev/custom-rules.patch
Normal file
91
pkgs/os-specific/linux/udev/custom-rules.patch
Normal file
@ -0,0 +1,91 @@
|
||||
commit c49ec33ba0f1a7f11b188913bb4895360ced67f8
|
||||
Author: Yury G. Kudryashov <urkud.urkud@gmail.com>
|
||||
Date: Tue Aug 16 16:28:56 2011 +0400
|
||||
|
||||
Upstream considers presence of rules_dir=... in udev.conf as a very special case.
|
||||
In particular, they disable /dev/.udev/*. Re-enable it.
|
||||
|
||||
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
|
||||
index 6bf2726..c1ae1f3 100644
|
||||
--- a/udev/udev-rules.c
|
||||
+++ b/udev/udev-rules.c
|
||||
@@ -1812,6 +1812,7 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
|
||||
struct udev_list file_list;
|
||||
struct udev_list_entry *file_loop;
|
||||
struct token end_token;
|
||||
+ char runpathrules[UTIL_PATH_SIZE];
|
||||
|
||||
rules = calloc(1, sizeof(struct udev_rules));
|
||||
if (rules == NULL)
|
||||
@@ -1854,22 +1855,21 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
|
||||
rules->trie_nodes_cur = 1;
|
||||
|
||||
if (udev_get_rules_path(udev) == NULL) {
|
||||
- char filename[UTIL_PATH_SIZE];
|
||||
|
||||
/* /lib/udev -- default/package rules */
|
||||
add_matching_files(udev, &file_list, LIBEXECDIR "/rules.d", ".rules");
|
||||
|
||||
/* /etc/udev -- system-specific/user/admin rules */
|
||||
add_matching_files(udev, &file_list, SYSCONFDIR "/udev/rules.d", ".rules");
|
||||
-
|
||||
- /* /run/udev -- throw-away/temporary rules */
|
||||
- util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
|
||||
- add_matching_files(udev, &file_list, filename, ".rules");
|
||||
} else {
|
||||
/* custom rules files location for testing */
|
||||
add_matching_files(udev, &file_list, udev_get_rules_path(udev), ".rules");
|
||||
}
|
||||
|
||||
+ /* /run/udev -- throw-away/temporary rules */
|
||||
+ util_strscpyl(runpathrules, sizeof(runpathrules), udev_get_run_path(udev), "/rules.d", NULL);
|
||||
+ add_matching_files(udev, &file_list, runpathrules, ".rules");
|
||||
+
|
||||
/* add all filenames to the string buffer */
|
||||
udev_list_entry_foreach(file_loop, udev_list_get_entry(&file_list)) {
|
||||
const char *filename = udev_list_entry_get_value(file_loop);
|
||||
diff --git a/udev/udevd.c b/udev/udevd.c
|
||||
index f1a31e7..45d10b6 100644
|
||||
--- a/udev/udevd.c
|
||||
+++ b/udev/udevd.c
|
||||
@@ -1198,6 +1198,8 @@ int main(int argc, char *argv[])
|
||||
struct epoll_event ep_ctrl, ep_inotify, ep_signal, ep_netlink, ep_worker;
|
||||
struct udev_ctrl_connection *ctrl_conn = NULL;
|
||||
int rc = 1;
|
||||
+ char filename[UTIL_PATH_SIZE];
|
||||
+ struct stat statbuf;
|
||||
|
||||
udev = udev_new();
|
||||
if (udev == NULL)
|
||||
@@ -1480,23 +1482,21 @@ int main(int argc, char *argv[])
|
||||
inotify_add_watch(fd_inotify, udev_get_rules_path(udev),
|
||||
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
|
||||
} else {
|
||||
- char filename[UTIL_PATH_SIZE];
|
||||
- struct stat statbuf;
|
||||
|
||||
inotify_add_watch(fd_inotify, LIBEXECDIR "/rules.d",
|
||||
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
|
||||
inotify_add_watch(fd_inotify, SYSCONFDIR "/udev/rules.d",
|
||||
IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
|
||||
+ }
|
||||
|
||||
- /* watch dynamic rules directory */
|
||||
- util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
|
||||
- if (stat(filename, &statbuf) != 0) {
|
||||
- util_create_path(udev, filename);
|
||||
- mkdir(filename, 0755);
|
||||
- }
|
||||
- inotify_add_watch(fd_inotify, filename,
|
||||
- IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
|
||||
+ /* watch dynamic rules directory */
|
||||
+ util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
|
||||
+ if (stat(filename, &statbuf) != 0) {
|
||||
+ util_create_path(udev, filename);
|
||||
+ mkdir(filename, 0755);
|
||||
}
|
||||
+ inotify_add_watch(fd_inotify, filename,
|
||||
+ IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
|
||||
udev_watch_restore(udev);
|
||||
|
||||
/* block and listen to all signals on signalfd */
|
@ -5866,8 +5866,8 @@ let
|
||||
};
|
||||
|
||||
udev145 = callPackage ../os-specific/linux/udev/145.nix { };
|
||||
udev172 = callPackage ../os-specific/linux/udev/172.nix { };
|
||||
udev = udev172;
|
||||
udev173 = callPackage ../os-specific/linux/udev/173.nix { };
|
||||
udev = pkgs.udev173;
|
||||
|
||||
udisks = callPackage ../os-specific/linux/udisks { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user