mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
* Some basic udev rules: give the right permission to /dev/null etc.,
put input devices in /dev/input, and create a symlink /dev/cdrom for CD-ROM devices. svn path=/nixos/trunk/; revision=7335
This commit is contained in:
parent
f29c93830e
commit
57663aae6b
@ -20,7 +20,7 @@ import ../upstart-jobs/gather.nix {
|
||||
# The udev daemon creates devices nodes and runs programs when
|
||||
# hardware events occur.
|
||||
(import ../upstart-jobs/udev.nix {
|
||||
inherit (pkgs) udev procps;
|
||||
inherit (pkgs) writeText cleanSource udev procps;
|
||||
})
|
||||
|
||||
# Hardware scan; loads modules for PCI devices.
|
||||
|
24
upstart-jobs/udev-rules/50-udev.rules
Normal file
24
upstart-jobs/udev-rules/50-udev.rules
Normal file
@ -0,0 +1,24 @@
|
||||
# Miscellaneous devices.
|
||||
KERNEL=="mem|kmem", GROUP="kmem", MODE="640"
|
||||
KERNEL=="port", GROUP="kmem", MODE="640"
|
||||
KERNEL=="nvram", GROUP="kmem", MODE="600"
|
||||
KERNEL=="null", MODE="666"
|
||||
KERNEL=="zero", MODE="666"
|
||||
KERNEL=="full", MODE="622"
|
||||
KERNEL=="random", MODE="666"
|
||||
KERNEL=="urandom", MODE="644"
|
||||
KERNEL=="rtc", MODE="600"
|
||||
KERNEL=="sonypi", MODE="0666"
|
||||
KERNEL=="agpgart", MODE="0600", GROUP="video"
|
||||
|
||||
|
||||
# Input devices go under /dev/input.
|
||||
KERNEL=="mouse*|mice", NAME="input/%k", MODE="0640"
|
||||
KERNEL=="event*", NAME="input/%k", MODE="0640"
|
||||
KERNEL=="js*", NAME="input/%k", MODE="0644"
|
||||
KERNEL=="ts*", NAME="input/%k", MODE="0600"
|
||||
KERNEL=="uinput", NAME="input/%k", MODE="0600"
|
||||
|
||||
|
||||
# Create a symlink for the CD-ROM device.
|
||||
KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", SYSFS{device/media}=="cdrom", SYMLINK+="cdrom cdrom-%k"
|
@ -1,4 +1,12 @@
|
||||
{udev, procps}:
|
||||
{writeText, cleanSource, udev, procps}:
|
||||
|
||||
let
|
||||
|
||||
conf = writeText "udev.conf" "
|
||||
udev_rules=\"${cleanSource ./udev-rules}\"
|
||||
";
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
name = "udev";
|
||||
@ -7,6 +15,8 @@
|
||||
start on startup
|
||||
stop on shutdown
|
||||
|
||||
env UDEV_CONFIG_FILE=${conf}
|
||||
|
||||
start script
|
||||
echo '' > /proc/sys/kernel/hotplug
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user