From 131f3c8e637aae133dedec5c53785f79687d1da8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 16 Feb 2011 14:38:52 +0000 Subject: [PATCH] * Because cdrom_id now links against libpthread, LD_LIBRARY_PATH must be set when udevd calls external programs. (The udev manpage claims that udevd passes its own environment variables, but this is not the case.) * Get rid of some udev rule hacks that no longer seem needed. svn path=/nixos/trunk/; revision=25991 --- modules/system/boot/stage-1.nix | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/modules/system/boot/stage-1.nix b/modules/system/boot/stage-1.nix index 7a38883af57..b2769f63ac9 100644 --- a/modules/system/boot/stage-1.nix +++ b/modules/system/boot/stage-1.nix @@ -222,6 +222,8 @@ let name = "udev-rules"; buildCommand = '' ensureDir $out + + echo 'ENV{LD_LIBRARY_PATH}="${extraUtils}/lib"' > $out/00-env.rules cp ${pkgs.udev}/libexec/rules.d/60-cdrom_id.rules $out/ cp ${pkgs.udev}/libexec/rules.d/60-persistent-storage.rules $out/ @@ -243,26 +245,6 @@ let --replace 'ENV{DM_SBIN_PATH}="/sbin"' 'ENV{DM_SBIN_PATH}="${extraUtils}/bin"' \ --replace /sbin/mdadm ${extraUtils}/bin/mdadm done - - # Remove rule preventing creation of a by-label symlink - # for a CD-ROM if disk removal will not be properly reported. - # Such a link can get obsolete in a running system, but - # during boot stage 1 it is unlikely. We need this change - # to be able to boot on a wider choice of CD drives. - sed -e '/^ENV[{]DEVTYPE[}]=="disk", .*GOTO/d' -i $out/60-persistent-storage.rules - - # Work around a bug in QEMU, which doesn't implement the "READ - # DISC INFORMATION" SCSI command: - # https://bugzilla.redhat.com/show_bug.cgi?id=609049 - # As a result, `cdrom_id' doesn't print - # ID_CDROM_MEDIA_TRACK_COUNT_DATA, which in turn prevents the - # /dev/disk/by-label symlinks from being created. We need these - # in the NixOS installation CD, so use ID_CDROM_MEDIA in the - # corresponding udev rules for now. This was the behaviour in - # udev <= 154. See also - # http://www.spinics.net/lists/hotplug/msg03935.html - substituteInPlace $out/60-persistent-storage.rules \ - --replace ID_CDROM_MEDIA_TRACK_COUNT_DATA ID_CDROM_MEDIA ''; # */ };