udev: add a rules file to fix perms, based off the one from Archlinux.
--HG-- extra : convert_revision : 2b574934b32189095af24f6fdafe136ddec310a6
This commit is contained in:
parent
605e166253
commit
28f31ff7d2
125
templates/udev/files/81-xbps.rules
Normal file
125
templates/udev/files/81-xbps.rules
Normal file
|
@ -0,0 +1,125 @@
|
|||
# Additional rules for xbps. Bassed off 81-arch.rules from
|
||||
# Archlinux.
|
||||
|
||||
# permission for sg devices
|
||||
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660"
|
||||
|
||||
# permissions for IDE CD devices
|
||||
SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", GROUP="optical"
|
||||
|
||||
# permissions for SCSI CD devices
|
||||
SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", ATTRS{type}=="5", SYMLINK+="scd%n", GROUP="optical"
|
||||
SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="5", GROUP="optical"
|
||||
|
||||
# permissions for removable devices like cardreaders or sticks
|
||||
KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="0", GROUP="storage"
|
||||
|
||||
# permissions for firewire external drives
|
||||
KERNEL=="sd*", ATTRS{scsi_level}=="5", GROUP="storage"
|
||||
|
||||
# permissions for usb to scsi external adapters
|
||||
KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="7", GROUP="storage"
|
||||
|
||||
# permissions for ide storage like pcmcia card readers
|
||||
ACTION!="add", GOTO="pcmcia_end"
|
||||
SUBSYSTEM!="block", GOTO="pcmcia_end"
|
||||
KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
|
||||
KERNEL=="hd*", IMPORT{parent}=="ID_*"
|
||||
KERNEL=="hd*", ENV{ID_TYPE}=="generic", GROUP="storage"
|
||||
LABEL="pcmcia_end"
|
||||
|
||||
# permissions for SCSI scanners
|
||||
SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="6", GROUP="scanner"
|
||||
|
||||
# consoles
|
||||
KERNEL=="tty[0-9]*", NAME="vc/%n", SYMLINK+="%k"
|
||||
KERNEL=="vcs", NAME="vcc/0"
|
||||
KERNEL=="vcs[0-9]*", NAME="vcc/%n"
|
||||
KERNEL=="vcsa", NAME="vcc/a0"
|
||||
KERNEL=="vcsa[0-9]*" NAME="vcc/a%n"
|
||||
|
||||
# serial
|
||||
KERNEL=="ttyS[0-9]*", NAME="tts/%n", SYMLINK+="ttyS%n"
|
||||
KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", SYMLINK+="%k"
|
||||
|
||||
# md block devices
|
||||
KERNEL=="md[0-9]*", NAME="md%n", SYMLINK+="md/%n"
|
||||
|
||||
# mem
|
||||
KERNEL=="ram0", SYMLINK+="ramdisk"
|
||||
KERNEL=="ram1", SYMLINK+="ram"
|
||||
KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k"
|
||||
|
||||
# video4linux
|
||||
KERNEL=="vbi0", SYMLINK+="vbi"
|
||||
KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="%k"
|
||||
KERNEL=="radio0", SYMLINK+="radio"
|
||||
KERNEL=="radio[0-9]*", NAME="v4l/radio%n", SYMLINK+="radio%n", GROUP="video"
|
||||
KERNEL=="video0", SYMLINK+="video"
|
||||
KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="%k"
|
||||
KERNEL=="vtx0", SYMLINK+="vtx"
|
||||
KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", SYMLINK+="%k"
|
||||
|
||||
# video devices
|
||||
### xorg resets those permissions, adjust your xorg.conf!
|
||||
KERNEL=="3dfx*", GROUP="video"
|
||||
KERNEL=="agpgart", NAME="misc/%k", SYMLINK+="%k"
|
||||
KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video"
|
||||
|
||||
# i2c devices
|
||||
KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k"
|
||||
|
||||
# loop devices
|
||||
KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK+="%k"
|
||||
|
||||
# misc
|
||||
KERNEL=="nvram", NAME="misc/%k", SYMLINK+="%k"
|
||||
KERNEL=="psaux", NAME="misc/%k", SYMLINK+="%k"
|
||||
KERNEL=="uinput", SYMLINK+="%k"
|
||||
KERNEL=="sgi_fetchop", MODE="0666"
|
||||
KERNEL=="sonypi", MODE="0666"
|
||||
KERNEL=="inotify", NAME="misc/%k", SYMLINK+="%k", MODE="0666"
|
||||
|
||||
# sound devices
|
||||
# oss devices
|
||||
KERNEL=="audio*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="dmmidi*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="admmidi*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="dsp*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="adsp*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="amidi*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="mixer*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="sequencer*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="aload*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="amixer*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="music", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="dmfm*", NAME="sound/%k", SYMLINK+="%k"
|
||||
KERNEL=="midi[0-9]*", NAME="sound/%k", SYMLINK+="%k"
|
||||
|
||||
# USB devices
|
||||
KERNEL=="legousbtower*", MODE="0666"
|
||||
|
||||
# netlink devices
|
||||
KERNEL=="route", NAME="netlink/%k"
|
||||
KERNEL=="skip", NAME="netlink/%k"
|
||||
KERNEL=="usersock", NAME="netlink/%k"
|
||||
KERNEL=="fwmonitor", NAME="netlink/%k"
|
||||
KERNEL=="tcpdiag", NAME="netlink/%k"
|
||||
KERNEL=="nflog", NAME="netlink/%k"
|
||||
KERNEL=="xfrm", NAME="netlink/%k"
|
||||
KERNEL=="arpd", NAME="netlink/%k"
|
||||
KERNEL=="route6", NAME="netlink/%k"
|
||||
KERNEL=="ip6_fw", NAME="netlink/%k"
|
||||
KERNEL=="dnrtmsg", NAME="netlink/%k"
|
||||
### ! disabled seems to break device creation !
|
||||
# KERNEL=="tap*", NAME="netlink/%k"
|
||||
|
||||
# IEEE1394 (firewire) devices
|
||||
KERNEL=="raw1394", NAME="%k", GROUP="video"
|
||||
|
||||
# kbd devices
|
||||
KERNEL=="kbd", MODE="0664"
|
||||
|
||||
# CPU
|
||||
KERNEL=="cpu[0-9]*", SYMLINK="%k"
|
||||
KERNEL=="msr[0-9]*", SYMLINK="%k"
|
|
@ -1,6 +1,7 @@
|
|||
# Template file for 'udev'
|
||||
pkgname=udev
|
||||
version=140
|
||||
revision=1
|
||||
distfiles="
|
||||
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-${version}.tar.bz2"
|
||||
build_style=gnu_configure
|
||||
|
@ -17,6 +18,15 @@ Add_dependency full procps
|
|||
|
||||
post_install()
|
||||
{
|
||||
# Install some additional rules.
|
||||
install -m644 ${FILESDIR}/81-xbps.rules ${DESTDIR}/lib/udev/rules.d
|
||||
install -m644 ${wrksrc}/rules/packages/* ${DESTDIR}/lib/udev/rules.d
|
||||
# Remove unneeded rules.
|
||||
for f in ia64 ppc s390; do
|
||||
rm ${DESTDIR}/lib/udev/rules.d/40-${f}.rules
|
||||
done
|
||||
|
||||
# Create some devices that are needed by the initramfs.
|
||||
install -d $DESTDIR/lib/firmware
|
||||
install -d $DESTDIR/lib/udev/devices/pts
|
||||
install -d $DESTDIR/lib/udev/devices/shm
|
||||
|
|
Loading…
Reference in New Issue
Block a user