Commit 4ce5b1f1 authored by Martin Pitt's avatar Martin Pitt
Browse files

Drop our Debian specific 50-udev-default.rules and 91-permissions.rules

Use the upstream rules with a patch for the remaining Debian specific default
device permissions. Many thanks to Marco d'Itri for researching which
Debian-specific rules are obsolete!

Amongst other things, this now also reads the hwdb info for USB devices and
gets rid of some syntax errors.

Closes: #717405
Closes: #706221
parent 5284b53b
......@@ -29,6 +29,12 @@ systemd (204-9) UNRELEASED; urgency=medium
a patch for the sg module (see #657948). These now stop calling modprobe
and use the kmod builtin, giving some nice boot speed improvement.
(Closes: #717404)
* Drop our Debian specific 50-udev-default.rules and 91-permissions.rules
and use the upstream rules with a patch for the remaining Debian specific
default device permissions. Many thanks to Marco d'Itri for researching
which Debian-specific rules are obsolete! Amongst other things, this now
also reads the hwdb info for USB devices (Closes: #717405) and gets rid of
some syntax errors (Closes: #706221)
-- Michael Biebl <biebl@debian.org> Sat, 26 Apr 2014 10:41:18 +0200
......
......@@ -34,7 +34,7 @@ cp -p /etc/udev/udev.conf $DESTDIR/etc/udev/
mkdir -p $DESTDIR/lib/udev/rules.d/
for rules in 50-firmware.rules 50-udev-default.rules 60-persistent-storage.rules \
80-drivers.rules 91-permissions.rules \
80-drivers.rules \
64-md-raid.rules 60-persistent-storage-lvm.rules \
55-dm.rules 60-persistent-storage-dm.rules; do
if [ -e /etc/udev/rules.d/$rules ]; then
......
# virtio serial / console ports
KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"
SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
# RTC on some architectures
SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc"
# /dev/sndstat
SUBSYSTEM=="module", KERNEL=="snd", ACTION=="add", \
RUN+="/bin/ln -sf /proc/asound/oss/sndstat $root/sndstat"
ACTION=="remove", GOTO="permissions_end"
# default permissions for block devices
SUBSYSTEM=="block", GROUP="disk"
SUBSYSTEM=="block", ATTRS{removable}=="1", GROUP="floppy"
# the aacraid driver is broken and reports the disks as removable (see #404927)
SUBSYSTEM=="block", DRIVERS=="aacraid", GROUP="disk"
# all block devices on these buses are "removable"
SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
KERNEL=="cbm", GROUP="floppy"
# IDE devices
ENV{ID_CDROM}=="?*", GROUP="cdrom"
KERNEL=="ht[0-9]*", GROUP="tape"
KERNEL=="nht[0-9]*", GROUP="tape"
# SCSI devices
SUBSYSTEM=="scsi_generic|scsi_tape", \
SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
SUBSYSTEM=="scsi_generic", \
SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
# USB devices
KERNEL=="legousbtower*", MODE="0666"
KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp"
# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to
# the ones from the old usblp kernel module
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
ENV{ID_USB_INTERFACES}=="", IMPORT{builtin}="usb_id"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
# usbfs-like devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
MODE="0664"
# serial devices
SUBSYSTEM=="tty", GROUP="dialout"
SUBSYSTEM=="capi", GROUP="dialout"
SUBSYSTEM=="slamr", GROUP="dialout"
SUBSYSTEM=="zaptel", GROUP="dialout"
KERNEL=="mISDNtimer", GROUP="dialout"
KERNEL=="mwave", GROUP="dialout"
KERNEL=="hvc*|hvsi*", GROUP="dialout"
# vc devices (all members of the tty subsystem)
KERNEL=="ptmx", MODE="0666", GROUP="root"
KERNEL=="console", MODE="0600", GROUP="root"
KERNEL=="tty", MODE="0666", GROUP="root"
KERNEL=="tty[0-9]*", GROUP="root"
KERNEL=="pty*", MODE="0666", GROUP="tty"
# video devices
SUBSYSTEM=="video4linux", GROUP="video"
SUBSYSTEM=="drm", GROUP="video"
SUBSYSTEM=="dvb", GROUP="video"
SUBSYSTEM=="em8300", GROUP="video"
SUBSYSTEM=="graphics", GROUP="video"
SUBSYSTEM=="nvidia", GROUP="video"
# misc devices
KERNEL=="random", MODE="0666"
KERNEL=="urandom", MODE="0666"
KERNEL=="mem", MODE="0640", GROUP="kmem"
KERNEL=="kmem", MODE="0640", GROUP="kmem"
KERNEL=="port", MODE="0640", GROUP="kmem"
KERNEL=="nvram", MODE="0640", GROUP="kmem"
KERNEL=="full", MODE="0666"
KERNEL=="null", MODE="0666"
KERNEL=="zero", MODE="0666"
KERNEL=="inotify", MODE="0666"
KERNEL=="sonypi", MODE="0666"
KERNEL=="cpu[0-9]*", MODE="0444"
KERNEL=="agpgart", GROUP="video"
KERNEL=="pmu", GROUP="video"
KERNEL=="kqemu", MODE="0666"
KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
KERNEL=="rfkill", MODE="0644"
KERNEL=="cdemu[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd", MODE="0644"
# printers and parallel devices
SUBSYSTEM=="printer", GROUP="lp"
SUBSYSTEM=="ppdev", GROUP="lp"
KERNEL=="irlpt[0-9]*", GROUP="lp"
KERNEL=="pt[0-9]*", GROUP="tape"
KERNEL=="pht[0-9]*", GROUP="tape"
# sound devices
SUBSYSTEM=="sound", GROUP="audio",
OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer"
# ieee1394 devices
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video"
KERNEL=="raw1394", GROUP="disk"
KERNEL=="dv1394-[0-9]*", GROUP="video"
KERNEL=="video1394-[0-9]*", GROUP="video"
# input devices
KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \
MODE="0664", GROUP="video"
KERNEL=="js[0-9]*", MODE="0664"
KERNEL=="event[0-9]*", ENV{ID_CLASS}=="joystick", \
MODE="0664", GROUP="audio"
KERNEL=="lirc[0-9]*", GROUP="video"
KERNEL=="mmtimer", MODE="0644"
KERNEL=="sgi_*", MODE="0666"
KERNEL=="z90crypt", MODE="0666"
KERNEL=="iseries/ibmsis*", GROUP="disk"
KERNEL=="iseries/nvt*", GROUP="disk"
KERNEL=="iseries/vt*", GROUP="disk"
KERNEL=="iseries/vtty*", GROUP="dialout"
# AOE character devices
SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440", GROUP="disk"
LABEL="permissions_end"
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Sat, 26 Apr 2014 16:11:09 +0200
Subject: Updates to default device permissions
Taken from the previous Debian specific rules, this is the remaining difference
over the upstream 50-udev-default.rules.
---
rules/50-udev-default.rules | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules
index f764789..a033a52 100644
--- a/rules/50-udev-default.rules
+++ b/rules/50-udev-default.rules
@@ -17,8 +17,11 @@ SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666"
SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620"
SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
+KERNEL=="mISDNtimer", GROUP="dialout"
+KERNEL=="mwave", GROUP="dialout"
SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
+KERNEL=="nvram", GROUP="kmem", MODE="0640"
SUBSYSTEM=="input", KERNEL=="mouse*|mice|event*", MODE="0640"
SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", MODE="0640"
@@ -53,7 +56,7 @@ SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
KERNEL=="sch[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
-KERNEL=="pktcdvd", GROUP="cdrom"
+KERNEL=="pktcdvd", GROUP="cdrom", MODE="0644"
SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
@@ -68,4 +71,13 @@ KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
+# not the ideal group, but backwards compatibility with previous Debian versions
+KERNEL=="lirc[0-9]*", GROUP="video"
+
+KERNEL=="legousbtower*", MODE="0666"
+KERNEL=="sonypi", MODE="0666"
+KERNEL=="mmtimer", MODE="0644"
+KERNEL=="sgi_*", MODE="0666"
+KERNEL=="z90crypt", MODE="0666"
+
LABEL="default_permissions_end"
......@@ -48,3 +48,4 @@
0048-Fix-mounting-of-remote-filesystems-like-NFS.patch
0049-Order-remote-fs.target-after-local-fs.target.patch
0050-Load-sg-module-from-80-drivers.rules.patch
0051-Updates-to-default-device-permissions.patch
......@@ -97,10 +97,8 @@ override_dh_install:
debian/udev-udeb/usr/lib/base-installer.d/05udev
mkdir -p debian/udev-udeb/lib/udev/rules.d/
install -D --mode=644 \
debian/extra/rules/50-udev-default.rules \
debian/extra/rules/75-cd-aliases-generator.rules \
debian/extra/rules/75-persistent-net-generator.rules \
debian/extra/rules/91-permissions.rules \
debian/udev-udeb/lib/udev/rules.d/
install -D --mode=644 debian/extra/links.conf \
debian/udev-udeb/etc/udev/links.conf
......
......@@ -3,6 +3,7 @@ bin/udevadm
lib/udev/ata_id
lib/udev/scsi_id
lib/udev/cdrom_id
lib/udev/rules.d/50-udev-default.rules
lib/udev/rules.d/50-firmware.rules
lib/udev/rules.d/60-cdrom_id.rules
lib/udev/rules.d/60-persistent-input.rules
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment