mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-03-19 00:21:40 +00:00
core/udev to 171-2
This commit is contained in:
parent
df43524d61
commit
744565645f
7 changed files with 82 additions and 139 deletions
|
@ -1,14 +0,0 @@
|
||||||
# do not edit this file, it will be overwritten on update
|
|
||||||
|
|
||||||
ACTION=="remove", GOTO="drivers_end"
|
|
||||||
|
|
||||||
DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/lib/udev/load-modules.sh $env{MODALIAS}"
|
|
||||||
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/lib/udev/load-modules.sh tifm_sd"
|
|
||||||
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/lib/udev/load-modules.sh tifm_ms"
|
|
||||||
SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh ms_block"
|
|
||||||
SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh mspro_block"
|
|
||||||
SUBSYSTEM=="i2o", RUN+="/lib/udev/load-modules.sh i2o_block"
|
|
||||||
SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/lib/udev/load-modules.sh sg"
|
|
||||||
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/lib/udev/load-modules.sh ppdev"
|
|
||||||
|
|
||||||
LABEL="drivers_end"
|
|
|
@ -19,37 +19,6 @@
|
||||||
# global stuff
|
# global stuff
|
||||||
#
|
#
|
||||||
|
|
||||||
#####################################
|
|
||||||
###### Hotplug rules - begin
|
|
||||||
# Only additional modules,
|
|
||||||
# which are not detectable,
|
|
||||||
# are loaded here!
|
|
||||||
#####################################
|
|
||||||
# check if the device has already been claimed by a driver
|
|
||||||
ACTION!="add", GOTO="drivers_end"
|
|
||||||
|
|
||||||
#PNP addon modules
|
|
||||||
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP0800", RUN+="/lib/udev/load-modules.sh pcspkr"
|
|
||||||
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="*PNP051[01]*", RUN+="/lib/udev/load-modules.sh irtty-sir"
|
|
||||||
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNPb02f", RUN+="/lib/udev/load-modules.sh analog"
|
|
||||||
|
|
||||||
# PARPORT addon modules
|
|
||||||
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh lp"
|
|
||||||
SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh ppdev"
|
|
||||||
|
|
||||||
# fix ide cdrom detection on old proliant servers
|
|
||||||
SUBSYSTEM=="pci", ENV{MODALIAS}=="pci:v00000E11d00000001sv00000000sd00000000bc06sc02i00", RUN+="/lib/udev/load-modules.sh ide-generic"
|
|
||||||
|
|
||||||
LABEL="drivers_end"
|
|
||||||
#####################################
|
|
||||||
##### Hotplug rules - end
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
# Additional Archlinux
|
|
||||||
# Permissions and Symlinks - begin
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
# permission for sg devices
|
# permission for sg devices
|
||||||
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660"
|
KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: PKGBUILD 125635 2011-05-27 11:47:52Z tomegun $
|
# $Id: PKGBUILD 126202 2011-06-02 14:49:12Z tomegun $
|
||||||
# Maintainer: Aaron Griffin <aaron@archlinux.org>
|
# Maintainer: Aaron Griffin <aaron@archlinux.org>
|
||||||
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
|
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
|
||||||
# Maintainer: Thomas Bächler <thomas@archlinux.org>
|
# Maintainer: Thomas Bächler <thomas@archlinux.org>
|
||||||
|
@ -12,7 +12,7 @@ plugrel=1
|
||||||
pkgbase="udev"
|
pkgbase="udev"
|
||||||
pkgname=('udev' 'udev-compat')
|
pkgname=('udev' 'udev-compat')
|
||||||
pkgver=171
|
pkgver=171
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
arch=(i686 x86_64)
|
arch=(i686 x86_64)
|
||||||
url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
|
url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
|
||||||
license=('GPL')
|
license=('GPL')
|
||||||
|
@ -21,17 +21,17 @@ groups=('base')
|
||||||
options=(!makeflags !libtool)
|
options=(!makeflags !libtool)
|
||||||
makedepends=('glibc' 'coreutils' 'util-linux' 'pciutils' 'libusb-compat' 'glib2' 'kernel26' 'gperf' 'libxslt' 'gobject-introspection')
|
makedepends=('glibc' 'coreutils' 'util-linux' 'pciutils' 'libusb-compat' 'glib2' 'kernel26' 'gperf' 'libxslt' 'gobject-introspection')
|
||||||
source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgbase-$pkgver.tar.bz2
|
source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgbase-$pkgver.tar.bz2
|
||||||
80-drivers.rules
|
81-arch.rules
|
||||||
81-arch.rules
|
static-audio-nodes-group.patch
|
||||||
load-modules.sh
|
static-nodes-permissions.patch
|
||||||
static-audio-nodes-permissions.patch
|
|
||||||
11-media-by-label-auto-mount.rules
|
11-media-by-label-auto-mount.rules
|
||||||
11-sd-cards-auto-mount.rules)
|
11-sd-cards-auto-mount.rules)
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd $srcdir/$pkgbase-$pkgver
|
cd $srcdir/$pkgbase-$pkgver
|
||||||
# fix https://bugs.archlinux.org/task/24362 (will be in udev-172)
|
# fix https://bugs.archlinux.org/task/24362 (will be in udev-172)
|
||||||
patch -Np1 -i ../static-audio-nodes-permissions.patch
|
patch -Np1 -i ../static-audio-nodes-group.patch
|
||||||
|
patch -Np1 -i ../static-nodes-permissions.patch
|
||||||
./configure --sysconfdir=/etc --with-rootlibdir=/lib --libexecdir=/lib/udev\
|
./configure --sysconfdir=/etc --with-rootlibdir=/lib --libexecdir=/lib/udev\
|
||||||
--sbindir=/sbin --with-systemdsystemunitdir=/lib/systemd/system\
|
--sbindir=/sbin --with-systemdsystemunitdir=/lib/systemd/system\
|
||||||
--disable-rule-generator
|
--disable-rule-generator
|
||||||
|
@ -50,12 +50,8 @@ package_udev() {
|
||||||
|
|
||||||
cd $srcdir/$pkgbase-$pkgver
|
cd $srcdir/$pkgbase-$pkgver
|
||||||
make DESTDIR=${pkgdir} install
|
make DESTDIR=${pkgdir} install
|
||||||
# Replace original 80-drivers.rules with custom one.
|
|
||||||
install -D -m644 $srcdir/80-drivers.rules $pkgdir/lib/udev/rules.d/80-drivers.rules
|
|
||||||
# Install our rule for permissions and symlinks
|
# Install our rule for permissions and symlinks
|
||||||
install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
|
install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
|
||||||
# install our module loading subsystem
|
|
||||||
install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh
|
|
||||||
|
|
||||||
# create framebuffer blacklist
|
# create framebuffer blacklist
|
||||||
mkdir -p $pkgdir/etc/modprobe.d/
|
mkdir -p $pkgdir/etc/modprobe.d/
|
||||||
|
@ -112,9 +108,8 @@ package_udev-compat() {
|
||||||
install -D -m644 ${srcdir}/${pkgbase}-${pkgver}/rules/misc/30-kernel-compat.rules ${pkgdir}/lib/udev/rules.d/30-kernel-compat.rules
|
install -D -m644 ${srcdir}/${pkgbase}-${pkgver}/rules/misc/30-kernel-compat.rules ${pkgdir}/lib/udev/rules.d/30-kernel-compat.rules
|
||||||
}
|
}
|
||||||
md5sums=('bdf4617284be2ecac11767437417e209'
|
md5sums=('bdf4617284be2ecac11767437417e209'
|
||||||
'4427855146513a4703ab5c7eb8a0156e'
|
'6ee44e3feb8e0f037947e7d4ca273f12'
|
||||||
'd8725e64fd0ce6e784ae795fae424c0a'
|
|
||||||
'f91fddc67609b45b244a624977c4247b'
|
|
||||||
'4f625aea95a5597afd8cdf189421f193'
|
'4f625aea95a5597afd8cdf189421f193'
|
||||||
|
'f9e50b8dfcd2215f5423ff9bc04ecf68'
|
||||||
'155554f488388e3f994ace619ad1e8d4'
|
'155554f488388e3f994ace619ad1e8d4'
|
||||||
'173b71ab6466677c12c99ef37c56a3db')
|
'173b71ab6466677c12c99ef37c56a3db')
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Implement blacklisting for udev-loaded modules
|
|
||||||
|
|
||||||
[ $# -ne 1 ] && exit 1
|
|
||||||
|
|
||||||
. /etc/rc.conf
|
|
||||||
|
|
||||||
# grab modules from rc.conf
|
|
||||||
BLACKLIST="${MOD_BLACKLIST[@]}"
|
|
||||||
MODPROBE="/sbin/modprobe"
|
|
||||||
LOGGER="/usr/bin/logger"
|
|
||||||
RESOLVEALIAS="${MODPROBE} --resolve-alias"
|
|
||||||
USEBLACKLIST="--use-blacklist"
|
|
||||||
|
|
||||||
if [ -f /proc/cmdline ]; then
|
|
||||||
for cmd in $(cat /proc/cmdline); do
|
|
||||||
case $cmd in
|
|
||||||
disablemodules=*) eval $cmd ;;
|
|
||||||
load_modules=off) exit ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
#parse cmdline entries of the form "disablemodules=x,y,z"
|
|
||||||
if [ -n "$disablemodules" ]; then
|
|
||||||
BLACKLIST="$BLACKLIST $(echo $disablemodules | sed 's|,| |g')"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
#MODULES entries in rc.conf that begin with ! are blacklisted
|
|
||||||
for mod in ${MODULES[@]}; do
|
|
||||||
if [ "${mod}" != "${mod#!}" ]; then
|
|
||||||
BLACKLIST="$BLACKLIST ${mod#!}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" ]; then
|
|
||||||
if [ -n "${BLACKLIST}" ]; then
|
|
||||||
# If an alias name is on the blacklist, load no modules for this device
|
|
||||||
if echo "${BLACKLIST}" | /bin/grep -q -e " $1 " -e "^$1 " -e " $1\$"; then
|
|
||||||
$LOGGER -p info -t "$(basename $0)" "Not loading module alias '$1' because it is blacklisted"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
#sanitize the blacklist
|
|
||||||
BLACKLIST="$(echo "$BLACKLIST" | sed -e 's|-|_|g')"
|
|
||||||
# Try to find all modules for the alias
|
|
||||||
mods=$($RESOLVEALIAS $1)
|
|
||||||
# If no modules could be found, try if the alias name is a module name
|
|
||||||
# In that case, omit the --use-blacklist parameter to imitate normal modprobe behaviour
|
|
||||||
[ -z "${mods}" ] && $MODPROBE -qni $1 && mods="$1" && USEBLACKLIST=""
|
|
||||||
[ -z "${mods}" ] && $LOGGER -p local0.debug -t "$(basename $0)" "'$1' is not a valid module or alias name"
|
|
||||||
for mod in ${mods}; do
|
|
||||||
# Find the module and all its dependencies
|
|
||||||
deps="$($MODPROBE -i --show-depends ${mod})"
|
|
||||||
[ $? -ne 0 ] && continue
|
|
||||||
|
|
||||||
#sanitize the module names
|
|
||||||
deps="$(echo "$deps" | sed \
|
|
||||||
-e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" \
|
|
||||||
-e 's|-|_|g')"
|
|
||||||
|
|
||||||
# If the module or any of its dependencies is blacklisted, don't load it
|
|
||||||
for dep in $deps; do
|
|
||||||
if echo "${BLACKLIST}" | /bin/grep -q -e " ${dep} " -e "^${dep} " -e " ${dep}\$"; then
|
|
||||||
if [ "${dep}" = "${mod}" ]; then
|
|
||||||
$LOGGER -p local0.info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because it is blacklisted"
|
|
||||||
else
|
|
||||||
$LOGGER -p local0.info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because its dependency '${dep}' is blacklisted"
|
|
||||||
fi
|
|
||||||
continue 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# modprobe usually uses the "blacklist" statements from modprobe.conf only to blacklist all aliases
|
|
||||||
# of a module, but not the module itself. We use --use-blacklist here so that modprobe also blacklists
|
|
||||||
# module names if we resolved alias names manually above
|
|
||||||
$MODPROBE $USEBLACKLIST ${mod}
|
|
||||||
done
|
|
||||||
else
|
|
||||||
$MODPROBE $USEBLACKLIST $1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
# vim: set et ts=4:
|
|
57
core/udev/static-nodes-permissions.patch
Normal file
57
core/udev/static-nodes-permissions.patch
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
From c112873b5bc9ebbae39c32f502bc6211f33546cc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||||
|
Date: Mon, 30 May 2011 02:12:02 +0200
|
||||||
|
Subject: [PATCH 1/2] rules: static_node - use 0660 if group is given to get
|
||||||
|
the cigar
|
||||||
|
|
||||||
|
>> On Tue, May 24, 2011 at 15:33, Tom Gundersen <teg@jklm.no> wrote:
|
||||||
|
>
|
||||||
|
> Close, but no cigar. Looks like the static nodes are not assigned
|
||||||
|
> permissions 0660 even if a gid is set (the nodes have perms 0600).
|
||||||
|
>
|
||||||
|
> Cheers,
|
||||||
|
>
|
||||||
|
> Tom
|
||||||
|
---
|
||||||
|
udev/udev-rules.c | 10 ++++++++--
|
||||||
|
1 files changed, 8 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
|
||||||
|
index 48395e7..56a258d 100644
|
||||||
|
--- a/udev/udev-rules.c
|
||||||
|
+++ b/udev/udev-rules.c
|
||||||
|
@@ -2709,8 +2709,9 @@ void udev_rules_apply_static_dev_perms(struct udev_rules *rules)
|
||||||
|
case TK_A_STATIC_NODE: {
|
||||||
|
char filename[UTIL_PATH_SIZE];
|
||||||
|
struct stat stats;
|
||||||
|
+
|
||||||
|
/* we assure, that the permissions tokens are sorted before the static token */
|
||||||
|
- if (mode == 0 && uid == 0 && gid == 0)
|
||||||
|
+ if (uid == 0 && gid == 0)
|
||||||
|
goto next;
|
||||||
|
util_strscpyl(filename, sizeof(filename), udev_get_dev_path(rules->udev), "/",
|
||||||
|
&rules->buf[cur->key.value_off], NULL);
|
||||||
|
@@ -2718,14 +2719,19 @@ void udev_rules_apply_static_dev_perms(struct udev_rules *rules)
|
||||||
|
goto next;
|
||||||
|
if (!S_ISBLK(stats.st_mode) && !S_ISCHR(stats.st_mode))
|
||||||
|
goto next;
|
||||||
|
- if (mode != 0 && mode != (stats.st_mode & 0777)) {
|
||||||
|
+
|
||||||
|
+ if (mode == 0 && gid > 0)
|
||||||
|
+ mode = 0660;
|
||||||
|
+ if (mode != (stats.st_mode & 0777)) {
|
||||||
|
chmod(filename, mode);
|
||||||
|
info(rules->udev, "chmod '%s' %#o\n", filename, mode);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
if ((uid != 0 && uid != stats.st_uid) || (gid != 0 && gid != stats.st_gid)) {
|
||||||
|
chown(filename, uid, gid);
|
||||||
|
info(rules->udev, "chown '%s' %u %u\n", filename, uid, gid);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
utimensat(AT_FDCWD, filename, NULL, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.7.5.2
|
||||||
|
|
|
@ -22,6 +22,22 @@ post_upgrade() {
|
||||||
echo "Errors are now logged (possibly to the console) by default."
|
echo "Errors are now logged (possibly to the console) by default."
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
fi
|
fi
|
||||||
|
if [ "$(vercmp $2 172)" -lt 0 ]; then
|
||||||
|
echo "ATTENTION UDEV:"
|
||||||
|
echo "---------------"
|
||||||
|
echo "Arch's custom blacklisting logic has been removed. MOD_AUTOLOAD and"
|
||||||
|
echo "blacklisting in MODULES no longer works."
|
||||||
|
echo "See 'man modprobe.conf' for a replacement to blacklisting."
|
||||||
|
echo "To disable a module mod1 on the kernel command line, use"
|
||||||
|
echo "mod1.disable=1"
|
||||||
|
echo "or"
|
||||||
|
echo "modprobe.blacklist=mod1"
|
||||||
|
echo " --"
|
||||||
|
echo "The following modules are no longer unconditionally loaded:"
|
||||||
|
echo " pcspkr irtty-sir analog lp ppdev ide-generic"
|
||||||
|
echo "Add them to MODULES in rc.conf if you need them."
|
||||||
|
echo "---------------"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
|
|
Loading…
Reference in a new issue