Compare commits
203 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce9320b04b | ||
|
|
a07cb8f5f4 | ||
|
|
38609fdb7f | ||
|
|
b59133e5f9 | ||
|
|
1fcd4845c9 | ||
|
|
d138c6fc55 | ||
|
|
9646fdce3a | ||
|
|
90bdfa8bcd | ||
|
|
17aa1fb443 | ||
|
|
e0bc75be11 | ||
|
|
36b9856624 | ||
|
|
dc3e663505 | ||
|
|
f110253ee5 | ||
|
|
e0eeb8a6eb | ||
|
|
faded2be30 | ||
|
|
27412d3df2 | ||
|
|
f9c13ce3bf | ||
|
|
4dfe0853b6 | ||
|
|
9653945ff2 | ||
|
|
2d66943d2f | ||
|
|
2618aa966e | ||
|
|
5fd2aaff27 | ||
|
|
08ec76712b | ||
|
|
c28cf5922c | ||
|
|
6ae88f0d84 | ||
|
|
c48bf88aea | ||
|
|
0c6edc1da2 | ||
|
|
27c9ba33fe | ||
|
|
2443122e5f | ||
|
|
3643fbe9e5 | ||
|
|
f9e3401ad5 | ||
|
|
3ad6199da3 | ||
|
|
60836322f1 | ||
|
|
e70c43125b | ||
|
|
83891f6381 | ||
|
|
3bc0c66b99 | ||
|
|
b52809d0de | ||
|
|
cef722535f | ||
|
|
8df68695ff | ||
|
|
58624e426e | ||
|
|
cbf7ac132c | ||
|
|
8cf0c7defa | ||
|
|
0b0304cfe1 | ||
|
|
21ab835136 | ||
|
|
90347b2001 | ||
|
|
7d03ac0923 | ||
|
|
9ecfc0140b | ||
|
|
a8dfb502d8 | ||
|
|
545bd16ca5 | ||
|
|
99318e91b4 | ||
|
|
400c0eaaaa | ||
|
|
57a491c1af | ||
|
|
61095fb1d9 | ||
|
|
243a0734e5 | ||
|
|
c67280da85 | ||
|
|
863c17e8e2 | ||
|
|
ad72e1d944 | ||
|
|
15fa57fca0 | ||
|
|
3f6713d0df | ||
|
|
9a010ac3e5 | ||
|
|
1efa3f58ce | ||
|
|
dfa8b8fed2 | ||
|
|
3ce9b85314 | ||
|
|
8fcb6e53ed | ||
|
|
94c7d90643 | ||
|
|
d8bca2a5df | ||
|
|
b11538a6c7 | ||
|
|
d2cb40f302 | ||
|
|
cd22a06c9a | ||
|
|
9c03079ed4 | ||
|
|
48e3b21647 | ||
|
|
2576ac70df | ||
| 120363a388 | |||
|
|
1fbe74e970 | ||
|
|
8e5a749a3e | ||
|
|
ef9ccbd582 | ||
|
|
bc17ac23b4 | ||
|
|
29c9ccefc5 | ||
|
|
fda0e26b46 | ||
|
|
cb30ef5c02 | ||
|
|
84bd1b90a3 | ||
|
|
7b608d10c8 | ||
|
|
8ead087df8 | ||
|
|
31132ed7f5 | ||
|
|
9e1428cd3e | ||
|
|
0d812c700e | ||
|
|
89b0f29d8b | ||
|
|
db587cb8c2 | ||
|
|
a444fba280 | ||
|
|
1bb5602ec7 | ||
|
|
ad37a7c965 | ||
|
|
977de72a58 | ||
|
|
52b32c5a0d | ||
|
|
e0288040af | ||
|
|
bcb2d05c81 | ||
|
|
7ff3775e4d | ||
|
|
f4ef922fde | ||
|
|
c82df992b8 | ||
|
|
93b6fcbee7 | ||
|
|
4152795a09 | ||
|
|
401942f50d | ||
|
|
38fd08cab9 | ||
|
|
da9416e2a2 | ||
| ad3d6b6260 | |||
|
|
468c4865b8 | ||
|
|
e87fdf7d46 | ||
|
|
f90281fa86 | ||
|
|
11f08c47bd | ||
|
|
c6a10bffc7 | ||
|
|
b13ebc6c30 | ||
|
|
6a426a6072 | ||
|
|
5b53a68b94 | ||
|
|
ab3b433362 | ||
|
|
367c089c3e | ||
|
|
b4fc064139 | ||
|
|
6e123c68b9 | ||
|
|
d2639a068d | ||
|
|
d6ea95d064 | ||
|
|
c0058968a2 | ||
| 518b087e2a | |||
|
|
825b6c9802 | ||
|
|
c47b803b68 | ||
|
|
fdc9d097a5 | ||
|
|
e07ce5575e | ||
|
|
ffe7cacec8 | ||
|
|
2a1f66d75f | ||
|
|
9f98e34d40 | ||
|
|
ab646bebe4 | ||
|
|
0b109e9f9e | ||
|
|
75cb6aeb76 | ||
|
|
b0b79fa1f4 | ||
|
|
fe7fc4b385 | ||
|
|
021d639f1a | ||
|
|
4db620ffcd | ||
|
|
e4cfa15239 | ||
|
|
80a542a733 | ||
|
|
975b6aaa58 | ||
|
|
b5dbf93f17 | ||
|
|
6e30c7cb59 | ||
|
|
00844ad871 | ||
|
|
05f6581408 | ||
|
|
5b6b2232ee | ||
|
|
5a26722c4c | ||
|
|
6bccb7062a | ||
|
|
d301daacbd | ||
|
|
6bbb3cd9b1 | ||
|
|
3eb03420e3 | ||
|
|
4ba917fed6 | ||
|
|
bfbe3859db | ||
|
|
7177394ffd | ||
|
|
9625547be1 | ||
|
|
15769f5bb4 | ||
|
|
b4f99d61c8 | ||
|
|
87b3260317 | ||
|
|
161545341e | ||
|
|
c5a0ade124 | ||
|
|
062c6309a9 | ||
|
|
b9c56fc59b | ||
|
|
61a823a384 | ||
|
|
d2a67004f3 | ||
|
|
16b250a44c | ||
|
|
8a8111a52f | ||
|
|
31d0512f74 | ||
|
|
2a36d8e695 | ||
|
|
c84cd4cf3d | ||
|
|
79dad1f706 | ||
|
|
1c37832687 | ||
|
|
8f604df8fa | ||
|
|
117812f91a | ||
|
|
909e9abf9b | ||
|
|
fcbc73b894 | ||
|
|
044f8613a1 | ||
|
|
fccce2dfec | ||
|
|
e7cf708e92 | ||
|
|
61e50e95cd | ||
|
|
092d541b37 | ||
|
|
3d3a3af458 | ||
|
|
2c757bb7e3 | ||
|
|
014d60c40e | ||
|
|
96e7b59eba | ||
|
|
64b78c2124 | ||
|
|
b4a3ffd582 | ||
|
|
ee9c1f7f35 | ||
|
|
5d7b98eb8a | ||
|
|
3cc65b7cd1 | ||
|
|
0789c11c2a | ||
|
|
c4ef96efd1 | ||
|
|
658661bad2 | ||
|
|
6710a9140a | ||
|
|
97c8b1ad1f | ||
|
|
dd250c2ac7 | ||
|
|
6b943c46bb | ||
|
|
59eb68e649 | ||
|
|
dff4f6c762 | ||
|
|
6df79e09b9 | ||
|
|
756aedf68e | ||
|
|
bf94b5f5d6 | ||
|
|
000e6f0367 | ||
|
|
c0da6ce073 | ||
|
|
e84f72ec14 | ||
|
|
d866c81409 | ||
|
|
9a1b893d92 | ||
|
|
e45ef51da4 |
29 changed files with 1 additions and 2868 deletions
|
|
@ -1 +0,0 @@
|
|||
udev-106.tar.bz2
|
||||
7
Makefile
7
Makefile
|
|
@ -1,7 +0,0 @@
|
|||
# Makefile for source rpm: udev
|
||||
# $Id: Makefile,v 1.1 2004/09/09 13:42:32 cvsdist Exp $
|
||||
NAME := udev
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
UPSTREAM_CHECKS = sign
|
||||
|
||||
include ../common/Makefile.common
|
||||
1
dead.package
Normal file
1
dead.package
Normal file
|
|
@ -0,0 +1 @@
|
|||
obsolete udev, it is replaced by systemd
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
/*
|
||||
* A simple firmware helper program.
|
||||
*
|
||||
* Copyright 2005 Red Hat, Inc.
|
||||
*
|
||||
* This software may be freely redistributed under the terms of the GNU
|
||||
* public license.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define FIRMWARE_PATH "/lib/firmware"
|
||||
|
||||
|
||||
void log_err(char *firmware, int err) {
|
||||
char *driver;
|
||||
|
||||
driver = getenv("PHYSDEVDRIVER");
|
||||
if (!driver)
|
||||
driver = "(unknown)";
|
||||
openlog("firmware_helper",LOG_PID,LOG_USER);
|
||||
syslog(LOG_ERR,"Loading of %s for %s driver failed: %s",firmware, driver, strerror(err));
|
||||
closelog();
|
||||
}
|
||||
|
||||
/* Set the 'loading' attribute for a firmware device.
|
||||
* 1 == currently loading
|
||||
* 0 == done loading
|
||||
* -1 == error
|
||||
*/
|
||||
int set_loading(char *device, int value) {
|
||||
char *path;
|
||||
int rc;
|
||||
FILE *f;
|
||||
|
||||
path = alloca(strlen(device)+15);
|
||||
sprintf(path,"/sys/%s/loading", device);
|
||||
f = fopen(path, "w");
|
||||
if (!f)
|
||||
return 1;
|
||||
rc = fprintf(f, "%d", value);
|
||||
fclose(f);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char *devpath, *firmware, *action;
|
||||
struct stat sbuf;
|
||||
int fw_fd, count;
|
||||
int rc;
|
||||
char *fw_path, *data_path;
|
||||
char *fw_buffer;
|
||||
|
||||
devpath = getenv("DEVPATH");
|
||||
if (!devpath) return 0;
|
||||
|
||||
firmware = getenv("FIRMWARE");
|
||||
if (!firmware) return 0;
|
||||
|
||||
action = getenv("ACTION");
|
||||
if (strcmp(action,"add"))
|
||||
return 0;
|
||||
|
||||
set_loading(devpath, 1);
|
||||
|
||||
fw_path = malloc(strlen(FIRMWARE_PATH) + strlen(firmware) + 2);
|
||||
if (!fw_path) {
|
||||
rc = errno;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
sprintf(fw_path,"%s/%s", FIRMWARE_PATH, firmware);
|
||||
fw_fd = open(fw_path, O_RDONLY);
|
||||
if (fw_fd == -1) {
|
||||
rc = errno;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
fstat(fw_fd, &sbuf);
|
||||
fw_buffer = malloc(sbuf.st_size);
|
||||
if (!fw_buffer) {
|
||||
rc = errno;
|
||||
goto out_err;
|
||||
}
|
||||
if (read(fw_fd, fw_buffer, sbuf.st_size) != sbuf.st_size) {
|
||||
rc = errno;
|
||||
goto out_err;
|
||||
}
|
||||
close(fw_fd);
|
||||
|
||||
data_path = malloc(strlen(devpath) + 12);
|
||||
if (!data_path) {
|
||||
rc = errno;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
sprintf(data_path,"/sys/%s/data", devpath);
|
||||
|
||||
fw_fd = open(data_path, O_RDWR);
|
||||
if (fw_fd == -1) {
|
||||
rc = errno;
|
||||
fw_path = data_path;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
while (count < sbuf.st_size) {
|
||||
int c;
|
||||
|
||||
c = write(fw_fd,fw_buffer+count,sbuf.st_size-count);
|
||||
if (c <= 0) {
|
||||
rc = errno;
|
||||
goto out_err;
|
||||
}
|
||||
count += c;
|
||||
}
|
||||
close(fw_fd);
|
||||
set_loading(devpath, 0);
|
||||
return 0;
|
||||
out_err:
|
||||
if (fw_fd >= 0)
|
||||
close(fw_fd);
|
||||
set_loading(devpath, -1);
|
||||
log_err(fw_path, rc);
|
||||
return rc;
|
||||
}
|
||||
1
mirrors
1
mirrors
|
|
@ -1 +0,0 @@
|
|||
ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/
|
||||
11
modprobe
11
modprobe
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh
|
||||
if [ -n "$MODPROBE_COLLECT" ]; then
|
||||
echo $@ >> /dev/MODPROBE
|
||||
else
|
||||
if [ -n "$MODPROBE_DEBUG" ]; then
|
||||
/sbin/modprobe -v -s $@ &>/dev/console
|
||||
else
|
||||
/sbin/modprobe $@
|
||||
fi
|
||||
fi
|
||||
|
||||
1
sources
1
sources
|
|
@ -1 +0,0 @@
|
|||
320ccd2d0f4540d10e021bafa14f8985 udev-106.tar.bz2
|
||||
232
start_udev
232
start_udev
|
|
@ -1,232 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# start_udev
|
||||
#
|
||||
# script to initialize /dev by using udev.
|
||||
#
|
||||
# Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
|
||||
#
|
||||
# Released under the GPL v2 only.
|
||||
#
|
||||
# This needs to be run at the earliest possible point in the boot
|
||||
# process.
|
||||
#
|
||||
# Based on the udev init.d script
|
||||
#
|
||||
# Thanks go out to the Gentoo developers for proving
|
||||
# that this is possible to do.
|
||||
#
|
||||
# Yes, it's very verbose, feel free to turn off all of the echo calls,
|
||||
# they were there to make me feel better that everything was working
|
||||
# properly during development...
|
||||
#
|
||||
# don't use udev if sysfs is not mounted.
|
||||
|
||||
sysfs_dir=/sys
|
||||
|
||||
export TZ=/etc/localtime
|
||||
|
||||
[ -d $sysfs_dir/class ] || exit 1
|
||||
[ -r /proc/mounts ] || exit 1
|
||||
[ -x /sbin/udevd ] || exit 1
|
||||
[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
|
||||
udev_root=${udev_root-/dev}
|
||||
|
||||
if [ -f /dev/.in_sysinit ]; then
|
||||
exec >/dev/console 2>/dev/console </dev/console
|
||||
fi
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
prog=udev
|
||||
bin=/sbin/udev
|
||||
udevd=/sbin/udevd
|
||||
MAKEDEV="/sbin/MAKEDEV"
|
||||
|
||||
xargs_simple () {
|
||||
if [ "$1" = "-n" ]; then
|
||||
shift
|
||||
MAXNR="$1"
|
||||
shift
|
||||
else
|
||||
MAXNR=100
|
||||
fi
|
||||
NR=$MAXNR
|
||||
ARGS=""
|
||||
[ -z "$1" ] && set echo
|
||||
|
||||
while read line; do
|
||||
if [ $NR -gt 0 ]; then
|
||||
ARGS="$ARGS $line"
|
||||
NR=$[$NR - 1]
|
||||
else
|
||||
"$@" $ARGS
|
||||
NR=$MAXNR
|
||||
ARGS="$line"
|
||||
fi
|
||||
done
|
||||
if [ -n "$ARGS" ]; then
|
||||
"$@" $ARGS
|
||||
fi
|
||||
}
|
||||
|
||||
make_extra_nodes () {
|
||||
ln -snf /proc/self/fd $udev_root/fd
|
||||
ln -snf /proc/self/fd/0 $udev_root/stdin
|
||||
ln -snf /proc/self/fd/1 $udev_root/stdout
|
||||
ln -snf /proc/self/fd/2 $udev_root/stderr
|
||||
ln -snf /proc/kcore $udev_root/core
|
||||
|
||||
[ -d $udev_root/pts ] || mkdir -m 0755 $udev_root/pts
|
||||
[ -d $udev_root/shm ] || mkdir -m 0755 $udev_root/shm
|
||||
[ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV;
|
||||
|
||||
if [ -x $MAKEDEV ]; then
|
||||
for i in /etc/udev/makedev.d/*.nodes; do
|
||||
if [ -f "$i" ]; then
|
||||
cat "$i" | sed -e 's,#.*,,g' | \
|
||||
xargs_simple -n 100 $MAKEDEV -x
|
||||
fi
|
||||
done
|
||||
fi
|
||||
for devdir in /etc/udev/devices /lib/udev/devices; do
|
||||
[ -d "$devdir" ] || continue
|
||||
pushd $devdir &> "$udev_root/null"
|
||||
set *
|
||||
if [ "$1" != "*" ]; then
|
||||
cp -ar "$@" $udev_root/
|
||||
pushd "$udev_root" &> "$udev_root/null"
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon "$@"
|
||||
popd &> "$udev_root/null"
|
||||
fi
|
||||
popd &> "$udev_root/null"
|
||||
done
|
||||
}
|
||||
|
||||
kill_udevd() {
|
||||
if [ -x /sbin/pidof ]; then
|
||||
pid=`/sbin/pidof -x udevd`
|
||||
[ -n "$pid" ] && kill $pid
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
wait_for_queue() {
|
||||
local timeout=${1:-0}
|
||||
local ret=0
|
||||
if [ $timeout -gt 0 ]; then
|
||||
/sbin/udevsettle --timeout=$timeout
|
||||
else
|
||||
/sbin/udevsettle
|
||||
fi
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo -n "Wait timeout. Will continue in the background."
|
||||
fi
|
||||
return $ret;
|
||||
}
|
||||
|
||||
export ACTION=add
|
||||
prog=udev
|
||||
ret=0
|
||||
STRING=$"Starting $prog: "
|
||||
# propagate $udev_root from /sys
|
||||
echo -n "$STRING"
|
||||
|
||||
# mount the tmpfs on ${udev_root%/}, if not already done
|
||||
LANG=C awk "\$2 == \"${udev_root%/}\" && \$3 == \"tmpfs\" { exit 1 }" /proc/mounts && {
|
||||
if LANG=C fgrep -q "none ${udev_root%/}/pts " /proc/mounts; then
|
||||
PTSDIR=$(mktemp -d)
|
||||
mount --move $udev_root/pts "$PTSDIR"
|
||||
fi
|
||||
if LANG=C fgrep -q "none ${udev_root%/}/shm " /proc/mounts; then
|
||||
SHMDIR=$(mktemp -d)
|
||||
mount --move $udev_root/shm "$SHMDIR"
|
||||
fi
|
||||
mount -n -o mode=0755 -t tmpfs none "$udev_root"
|
||||
mkdir -m 0755 $udev_root/pts
|
||||
mkdir -m 0755 $udev_root/shm
|
||||
if [ -n "$PTSDIR" ]; then
|
||||
mount --move "$PTSDIR" $udev_root/pts
|
||||
rmdir "$PTSDIR"
|
||||
fi
|
||||
if [ -n "$SHMDIR" ]; then
|
||||
mount --move "$SHMDIR" $udev_root/shm
|
||||
rmdir "$SHMDIR"
|
||||
fi
|
||||
|
||||
ret=$[$ret + $?]
|
||||
}
|
||||
|
||||
# returns OK if $1 contains $2
|
||||
strstr() {
|
||||
[ "${1#*$2*}" = "$1" ] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
getval() {
|
||||
what=$1
|
||||
shift
|
||||
for arg; do
|
||||
if strstr "$arg" "$what="; then
|
||||
val=${arg#${what}=*}
|
||||
echo $val
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
make_extra_nodes
|
||||
cmdline=$(cat /proc/cmdline)
|
||||
kill_udevd > "$udev_root/null" 2>&1
|
||||
if [ -f "/sys/class/tty/console/uevent" ]; then
|
||||
# trigger the sorted events
|
||||
echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
|
||||
if strstr "$cmdline" modprobedebug; then
|
||||
/sbin/udevcontrol env MODPROBE_DEBUG=1
|
||||
MODPROBE_OPTIONS="-s -v"
|
||||
fi
|
||||
/sbin/udevd -d
|
||||
ret=$[$ret + $?]
|
||||
if strstr "$cmdline" udevdebug; then
|
||||
/sbin/udevcontrol log_priority=debug
|
||||
fi
|
||||
if strstr "$cmdline" fastudev; then
|
||||
/sbin/udevcontrol env FASTUDEV=1
|
||||
fi
|
||||
if strstr "$cmdline" mcollect; then
|
||||
/sbin/udevcontrol env MODPROBE_COLLECT=1
|
||||
MCOLLECT=1
|
||||
fi
|
||||
if strstr "$cmdline" udevchilds; then
|
||||
/sbin/udevcontrol max_childs_running=$(getval udevchilds $cmdline)
|
||||
fi
|
||||
|
||||
rm -f /dev/MODPROBE
|
||||
/sbin/udevcontrol env STARTUP=1
|
||||
/sbin/udevtrigger
|
||||
ret=$[$ret + $?]
|
||||
wait_for_queue $(getval udevtimeout $cmdline)
|
||||
ret=$[$ret + $?]
|
||||
test -e "$MCOLLECT" && /sbin/udevcontrol env MODPROBE_COLLECT=
|
||||
unset MCOLLECT
|
||||
if [ -e /dev/MODPROBE ]; then
|
||||
(xargs_simple /sbin/modprobe -a) < /dev/MODPROBE 2>/dev/null
|
||||
rm -f /dev/MODPROBE
|
||||
wait_for_queue $(getval udevtimeout $cmdline)
|
||||
ret=$[$ret + $?]
|
||||
fi
|
||||
/sbin/udevcontrol env STARTUP=
|
||||
/sbin/udevcontrol env MODPROBE_DEBUG=
|
||||
else
|
||||
echo -n " kernel too old for this udev version "
|
||||
/sbin/udevd -d
|
||||
ret=10
|
||||
|
||||
fi
|
||||
|
||||
ret=$[$ret + $?]
|
||||
[ $ret -eq 0 ] && success $"$STRING" || failure $"$STRING"
|
||||
echo
|
||||
exit 0
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
--- udev-084/extras/floppy/create_floppy_devices.c.redhat 2006-01-30 08:51:38.000000000 +0100
|
||||
+++ udev-084/extras/floppy/create_floppy_devices.c 2006-02-07 10:58:51.000000000 +0100
|
||||
@@ -111,15 +111,21 @@
|
||||
return 0;
|
||||
|
||||
i = 0;
|
||||
+
|
||||
+ char buffer[2048]; buffer[0] = '\000'; buffer[2047]='\000';
|
||||
+ char cmd[2048]; cmd[0] = '\000'; cmd[2047]='\000';
|
||||
+
|
||||
while (table_sup[type][i]) {
|
||||
sprintf(node, "%s%s",dev, table[table_sup[type][i]]);
|
||||
- minor = (table_sup[type][i] << 2) + fdnum;
|
||||
- if (print_nodes)
|
||||
- printf("%s b %d %d %d\n", node, mode, major, minor);
|
||||
- if (create_nodes)
|
||||
- mknod(node, S_IFBLK | mode, makedev(major,minor));
|
||||
+ strcat(buffer, node);
|
||||
+ strcat(buffer, " ");
|
||||
i++;
|
||||
}
|
||||
+ if(strlen(buffer)) {
|
||||
+ if (snprintf(cmd, 2047, "/sbin/MAKEDEV -x %s;/sbin/restorecon %s; /sbin/pam_console_apply %s;", buffer, buffer, buffer) > 0) {
|
||||
+ system(cmd);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
If we're looking for a user's primary GID, look up the primary GID instead of
|
||||
guessing the name of the user's primary group.
|
||||
|
||||
--- udev-084/udev_libc_wrapper.h 2006-01-30 02:51:38.000000000 -0500
|
||||
+++ udev-084/udev_libc_wrapper.h 2006-02-13 17:22:56.000000000 -0500
|
||||
@@ -139,6 +139,7 @@
|
||||
#endif
|
||||
|
||||
extern uid_t lookup_user(const char *user);
|
||||
+extern gid_t lookup_user_primary_group(const char *user);
|
||||
extern gid_t lookup_group(const char *group);
|
||||
|
||||
extern size_t strlcpy(char *dst, const char *src, size_t size);
|
||||
--- udev-084/udev_libc_wrapper.c 2006-01-30 02:51:38.000000000 -0500
|
||||
+++ udev-084/udev_libc_wrapper.c 2006-02-13 17:38:48.000000000 -0500
|
||||
@@ -106,6 +106,20 @@
|
||||
return uid;
|
||||
}
|
||||
|
||||
+gid_t lookup_user_primary_group(const char *user)
|
||||
+{
|
||||
+ struct passwd *pw;
|
||||
+ gid_t gid = 0;
|
||||
+
|
||||
+ pw = getpwnam(user);
|
||||
+ if (pw == NULL)
|
||||
+ info("specified user unknown '%s'", user);
|
||||
+ else
|
||||
+ gid = pw->pw_gid;
|
||||
+
|
||||
+ return gid;
|
||||
+}
|
||||
+
|
||||
gid_t lookup_group(const char *group)
|
||||
{
|
||||
struct group *gr;
|
||||
@@ -126,7 +140,8 @@
|
||||
#define GROUP_FILE "/etc/group"
|
||||
|
||||
/* return the id of a passwd style line, selected by the users name */
|
||||
-static unsigned long get_id_by_name(const char *uname, const char *dbfile)
|
||||
+static unsigned long get_id_field_by_name(const char *uname, const char *dbfile,
|
||||
+ int field)
|
||||
{
|
||||
unsigned long id = 0;
|
||||
char line[LINE_SIZE];
|
||||
@@ -165,8 +180,14 @@
|
||||
if (name == NULL)
|
||||
continue;
|
||||
|
||||
- /* skip pass */
|
||||
- if (strsep(&pos, ":") == NULL)
|
||||
+ /* skip password and n other fields */
|
||||
+ field -= 2;
|
||||
+ while (field > 0) {
|
||||
+ if ((pos == NULL) || (strsep(&pos, ":") == NULL))
|
||||
+ continue;
|
||||
+ field--;
|
||||
+ }
|
||||
+ if (pos == NULL)
|
||||
continue;
|
||||
|
||||
/* get id */
|
||||
@@ -189,6 +210,15 @@
|
||||
return id;
|
||||
}
|
||||
|
||||
+static unsigned long get_id_by_name(const char *uname, const char *dbfile)
|
||||
+{
|
||||
+ return get_id_field_by_name(uname, dbfile, 3);
|
||||
+}
|
||||
+static unsigned long get_second_id_by_name(const char *uname, const char *dbfile)
|
||||
+{
|
||||
+ return get_id_field_by_name(uname, dbfile, 4);
|
||||
+}
|
||||
+
|
||||
uid_t lookup_user(const char *user)
|
||||
{
|
||||
unsigned long id;
|
||||
@@ -197,6 +227,14 @@
|
||||
return (uid_t) id;
|
||||
}
|
||||
|
||||
+gid_t lookup_user_primary_group(const char *user)
|
||||
+{
|
||||
+ unsigned long id;
|
||||
+
|
||||
+ id = get_second_id_by_name(user, PASSWD_FILE);
|
||||
+ return (gid_t) id;
|
||||
+}
|
||||
+
|
||||
gid_t lookup_group(const char *group)
|
||||
{
|
||||
unsigned long id;
|
||||
--- udev-084/extras/volume_id/vol_id.c 2006-01-30 02:51:38.000000000 -0500
|
||||
+++ udev-084/extras/volume_id/vol_id.c 2006-02-13 17:22:56.000000000 -0500
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
/* drop all privileges */
|
||||
nobody_uid = lookup_user("nobody");
|
||||
- nobody_gid = lookup_group("nogroup");
|
||||
+ nobody_gid = lookup_user_primary_group("nobody");
|
||||
if (nobody_uid > 0 && nobody_gid > 0) {
|
||||
if (setgroups(0, NULL) != 0 ||
|
||||
setgid(nobody_gid) != 0 ||
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
--- udev-103/udevtrigger.c.last_modalias 2006-10-20 14:43:35.000000000 +0200
|
||||
+++ udev-103/udevtrigger.c 2006-11-07 14:16:52.000000000 +0100
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <fnmatch.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
+#include <fnmatch.h>
|
||||
|
||||
#include "udev.h"
|
||||
#include "udevd.h"
|
||||
@@ -42,6 +43,13 @@
|
||||
LIST_HEAD(filter_attr_match_list);
|
||||
LIST_HEAD(filter_attr_nomatch_list);
|
||||
|
||||
+/* list of devices whose modaliases we should run last */
|
||||
+static char *last_modalias_list[] = {
|
||||
+ "pci:v*d*sv*sd*bc0Csc03i*", /* USB controller */
|
||||
+ "pci:v*d*sv*sd*bc0Csc00i10*", /* Firewire controller */
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
#ifdef USE_LOG
|
||||
void log_message(int priority, const char *format, ...)
|
||||
{
|
||||
@@ -72,6 +80,36 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
+
|
||||
+static int modalias_is_greylisted(const char *path)
|
||||
+{
|
||||
+
|
||||
+ char filename[PATH_SIZE];
|
||||
+ char alias[PATH_SIZE];
|
||||
+ int fd, i;
|
||||
+
|
||||
+ snprintf(filename,sizeof(filename),"%s/%s/modalias", sysfs_path, path);
|
||||
+ filename[sizeof(filename)-1] = '\0';
|
||||
+
|
||||
+ fd = open(filename, O_RDONLY);
|
||||
+ if (fd == -1)
|
||||
+ return 0;
|
||||
+ read(fd,alias,PATH_SIZE);
|
||||
+ alias[sizeof(alias)-1] = '\0';
|
||||
+ alias[strlen(alias)-1] = '\0';
|
||||
+
|
||||
+ for (i = 0; last_modalias_list[i] != NULL; i++)
|
||||
+ if (!fnmatch(last_modalias_list[i], alias, 0)) {
|
||||
+ close(fd);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ close(fd);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int device_list_insert(const char *path)
|
||||
{
|
||||
char filename[PATH_SIZE];
|
||||
@@ -495,6 +533,10 @@
|
||||
default:
|
||||
goto exit;
|
||||
}
|
||||
+ if (modalias_is_greylisted(path)) {
|
||||
+ device_list = &device_last_list;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (failed)
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
--- udev-091/extras/volume_id/lib/Makefile.nopie 2006-04-25 22:39:59.000000000 +0200
|
||||
+++ udev-091/extras/volume_id/lib/Makefile 2006-05-03 16:23:33.000000000 +0200
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
.shlib/%.o: %.c
|
||||
$(E) " CC " $@
|
||||
- $(Q) $(CC) -c $(CFLAGS) -fPIC $< -o $@
|
||||
+ $(Q) $(subst -fpie,,$(subst -pie,,$(CC) )) -c $(CFLAGS) -fPIC $< -o $@
|
||||
|
||||
libvolume_id.a: $(HEADERS) $(OBJS)
|
||||
$(Q) rm -f $@
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
$(SHLIB): $(HEADERS) .shlib $(addprefix .shlib/,$(OBJS))
|
||||
$(E) " CC " $@
|
||||
- $(Q) $(CC) -shared $(CFLAGS) -o $@ \
|
||||
+ $(Q) $(subst -fpie,,$(subst -pie,,$(CC) )) -shared $(CFLAGS) -o $@ \
|
||||
-Wl,-soname,libvolume_id.so.$(SHLIB_CUR),--version-script,exported_symbols \
|
||||
$(addprefix .shlib/,$(OBJS))
|
||||
$(Q) ln -sf $@ libvolume_id.so.$(SHLIB_CUR)
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.2.2 (GNU/Linux)
|
||||
Comment: See http://www.kernel.org/signature.html for info
|
||||
|
||||
iD8DBQBEMVclyGugalF9Dw4RAkuzAJ9u9BKZ86Pv/KLYSK5bJyhXACMCEACdFEjl
|
||||
e0bVNMtNCImQEiK8abUsIQw=
|
||||
=Gyt7
|
||||
-----END PGP SIGNATURE-----
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
--- udev-091/Makefile.lib64 2006-04-25 22:39:59.000000000 +0200
|
||||
+++ udev-091/Makefile 2006-05-03 18:16:31.000000000 +0200
|
||||
@@ -103,6 +103,8 @@
|
||||
libudevdir = ${prefix}/lib/udev
|
||||
mandir = ${prefix}/usr/share/man
|
||||
configdir = ${etcdir}/udev
|
||||
+libdir ?= ${prefix}/lib
|
||||
+usrlibdir ?= ${prefix}/usr/lib
|
||||
udevdir = /dev
|
||||
DESTDIR =
|
||||
|
||||
@@ -179,6 +181,8 @@
|
||||
RANLIB="$(RANLIB)" \
|
||||
LIB_OBJS="$(LIB_OBJS)" \
|
||||
LIBUDEV="$(PWD)/$(LIBUDEV)" \
|
||||
+ libdir=$(libdir) \
|
||||
+ usrlibdir=$(usrlibdir) \
|
||||
-C $$target $@ || exit 1; \
|
||||
done;
|
||||
.PHONY: all
|
||||
--- udev-091/extras/volume_id/lib/Makefile.lib64 2006-05-03 18:15:28.000000000 +0200
|
||||
+++ udev-091/extras/volume_id/lib/Makefile 2006-05-03 18:15:53.000000000 +0200
|
||||
@@ -4,9 +4,9 @@
|
||||
#
|
||||
# Released under the GNU General Public License, version 2.
|
||||
#
|
||||
-includedir = ${prefix}/usr/include
|
||||
-libdir = ${prefix}/lib
|
||||
-usrlibdir = ${prefix}/usr/lib
|
||||
+includedir ?= ${prefix}/usr/include
|
||||
+libdir ?= ${prefix}/lib
|
||||
+usrlibdir ?= ${prefix}/usr/lib
|
||||
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
--- udev-091/extras/volume_id/Makefile.lib64 2006-04-25 22:39:59.000000000 +0200
|
||||
+++ udev-091/extras/volume_id/Makefile 2006-05-03 18:16:14.000000000 +0200
|
||||
@@ -17,6 +17,9 @@
|
||||
libudevdir = ${prefix}/lib/udev
|
||||
mandir = ${prefix}/usr/share/man
|
||||
configdir = ${etcdir}/udev/
|
||||
+libdir ?= ${prefix}/lib
|
||||
+usrlibdir ?= ${prefix}/usr/lib
|
||||
+
|
||||
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
@@ -32,7 +35,10 @@
|
||||
$(Q) $(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
lib/libvolume_id.a:
|
||||
- $(Q) $(MAKE) -C lib
|
||||
+ $(Q) $(MAKE) \
|
||||
+ libdir=$(libdir) \
|
||||
+ usrlibdir=$(usrlibdir) \
|
||||
+ -C lib
|
||||
|
||||
$(PROG): %: $(HEADERS) %.o lib/libvolume_id.a
|
||||
$(E) " LD " $@
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
--- udev-095/udev_utils_run.c.dbgwait 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-095/udev_utils_run.c 2006-12-18 11:06:04.000000000 +0100
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "udev.h"
|
||||
|
||||
+#define WAIT_TIME 100
|
||||
+
|
||||
extern char **environ;
|
||||
|
||||
int pass_env_to_socket(const char *sockname, const char *devpath, const char *action)
|
||||
@@ -83,6 +85,8 @@
|
||||
char *argv[(sizeof(arg) / 2) + 1];
|
||||
int devnull;
|
||||
int i;
|
||||
+ int waited = 0;
|
||||
+ struct timeval timeout;
|
||||
|
||||
/* build argv from comand */
|
||||
strlcpy(arg, command, sizeof(arg));
|
||||
@@ -175,6 +179,7 @@
|
||||
if (errpipe[WRITE_END] > 0)
|
||||
close(errpipe[WRITE_END]);
|
||||
|
||||
+ waited = 0;
|
||||
/* read child output */
|
||||
while (outpipe[READ_END] > 0 || errpipe[READ_END] > 0) {
|
||||
int fdcount;
|
||||
@@ -185,7 +190,18 @@
|
||||
FD_SET(outpipe[READ_END], &readfds);
|
||||
if (errpipe[READ_END] > 0)
|
||||
FD_SET(errpipe[READ_END], &readfds);
|
||||
- fdcount = select(UDEV_MAX(outpipe[READ_END], errpipe[READ_END])+1, &readfds, NULL, NULL, NULL);
|
||||
+
|
||||
+ timeout.tv_sec = 0;
|
||||
+ timeout.tv_usec = WAIT_TIME * 1000;
|
||||
+ fdcount = select(UDEV_MAX(outpipe[READ_END], errpipe[READ_END])+1, &readfds, NULL, NULL, &timeout);
|
||||
+
|
||||
+ if (fdcount == 0) {
|
||||
+ waited += WAIT_TIME;
|
||||
+ if (waited % 1000 == 0)
|
||||
+ info("Waiting %d seconds for output of '%s(%d)'", waited/1000, command, pid);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
if (fdcount < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
@@ -261,14 +277,24 @@
|
||||
*reslen = respos;
|
||||
}
|
||||
}
|
||||
- waitpid(pid, &status, 0);
|
||||
- if (WIFEXITED(status)) {
|
||||
- info("'%s' returned with status %i", argv[0], WEXITSTATUS(status));
|
||||
- if (WEXITSTATUS(status) != 0)
|
||||
+ while(1) {
|
||||
+ if (waitpid(pid, &status, WNOHANG) == 0) {
|
||||
+ usleep(WAIT_TIME * 1000);
|
||||
+ waited += WAIT_TIME;
|
||||
+ if (waited % 1000 == 0)
|
||||
+ info("Waiting %d seconds for '%s(%d)'", waited/1000, command, pid);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (WIFEXITED(status)) {
|
||||
+ info("'%s' returned with status %i", argv[0], WEXITSTATUS(status));
|
||||
+ if (WEXITSTATUS(status) != 0)
|
||||
+ retval = -1;
|
||||
+ } else {
|
||||
+ err("'%s' abnormal exit", argv[0]);
|
||||
retval = -1;
|
||||
- } else {
|
||||
- err("'%s' abnormal exit", argv[0]);
|
||||
- retval = -1;
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
--- udev-095/udev_rules_parse.c.longcomment 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-095/udev_rules_parse.c 2006-08-10 14:00:58.000000000 +0200
|
||||
@@ -603,6 +603,10 @@
|
||||
cur += count+1;
|
||||
lineno++;
|
||||
|
||||
+ /* see if this is a comment */
|
||||
+ if (bufline[0] == COMMENT_CHARACTER)
|
||||
+ continue;
|
||||
+
|
||||
if (count >= sizeof(line)) {
|
||||
err("line too long, rule skipped '%s:%u'", filename, lineno);
|
||||
continue;
|
||||
@@ -616,10 +620,6 @@
|
||||
if (count == 0)
|
||||
continue;
|
||||
|
||||
- /* see if this is a comment */
|
||||
- if (bufline[0] == COMMENT_CHARACTER)
|
||||
- continue;
|
||||
-
|
||||
/* skip backslash and newline from multi line rules */
|
||||
for (i = j = 0; i < count; i++) {
|
||||
if (bufline[i] == '\\' && bufline[i+1] == '\n')
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
--- udev-095/extras/path_id/path_id 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-100/extras/path_id/path_id 2006-09-07 11:32:45.000000000 +0200
|
||||
@@ -220,7 +220,7 @@
|
||||
}
|
||||
|
||||
handle_firewire () {
|
||||
- :handle_firewire $*
|
||||
+ : handle_firewire $*
|
||||
local DEV=$1
|
||||
if [ -f "$D/ieee1394_id" ] ; then
|
||||
read ieee1394_id < $D/ieee1394_id
|
||||
@@ -407,30 +407,35 @@
|
||||
|
||||
handle_device () {
|
||||
full_sysfs_path="$SYSFS$DEVPATH"
|
||||
- if [ -L $full_sysfs_path/subsystem ]; then
|
||||
- # new sysfs block layout
|
||||
- full_sysfs_path="${full_sysfs_path%/*}"
|
||||
- cd "$full_sysfs_path/subsystem";
|
||||
- subsys="`pwd -P`"
|
||||
- cd "$OPWD"
|
||||
- subsys="${subsys##*/}"
|
||||
- if [ "$subsys" = "block" ]; then
|
||||
- # parent is "block", it's a partition, move one up
|
||||
- full_sysfs_path="${full_sysfs_path%/*}"
|
||||
- fi
|
||||
- cd $full_sysfs_path
|
||||
- else
|
||||
- # old sysfs block layout
|
||||
- if [ ! -L $full_sysfs_path/device ] ; then
|
||||
- if [ -f $full_sysfs_path/range ] ; then return ; fi
|
||||
- full_sysfs_path="${full_sysfs_path%/*}"
|
||||
- : full_sysfs_path "$full_sysfs_path"
|
||||
- if [ ! -L $full_sysfs_path/device -o ! -f $full_sysfs_path/dev ] ; then
|
||||
- return
|
||||
+ case "$DEVPATH" in
|
||||
+ /devices/*)
|
||||
+ # new sysfs layout
|
||||
+ if [ -L $full_sysfs_path/subsystem ]; then
|
||||
+ full_sysfs_path="${full_sysfs_path%/*}"
|
||||
+ cd "$full_sysfs_path/subsystem";
|
||||
+ subsys="`pwd -P`"
|
||||
+ cd "$OPWD"
|
||||
+ subsys="${subsys##*/}"
|
||||
+ if [ "$subsys" = "block" ]; then
|
||||
+ # parent is "block", it's a partition, move one up
|
||||
+ full_sysfs_path="${full_sysfs_path%/*}"
|
||||
+ fi
|
||||
+ cd $full_sysfs_path
|
||||
fi
|
||||
- fi
|
||||
- cd $full_sysfs_path/device
|
||||
- fi
|
||||
+ ;;
|
||||
+ *)
|
||||
+ # old sysfs layout
|
||||
+ if [ ! -L $full_sysfs_path/device ] ; then
|
||||
+ if [ -f $full_sysfs_path/range ] ; then return ; fi
|
||||
+ full_sysfs_path="${full_sysfs_path%/*}"
|
||||
+ : full_sysfs_path "$full_sysfs_path"
|
||||
+ if [ ! -L $full_sysfs_path/device -o ! -f $full_sysfs_path/dev ] ; then
|
||||
+ return
|
||||
+ fi
|
||||
+ fi
|
||||
+ cd $full_sysfs_path/device
|
||||
+ ;;
|
||||
+ esac
|
||||
full_sysfs_device_path="`pwd -P`"
|
||||
cd "$OPWD"
|
||||
D=$full_sysfs_device_path
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
--- udev-095/extras/path_id/path_id 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-100/extras/path_id/path_id 2006-09-07 11:32:45.000000000 +0200
|
||||
@@ -278,15 +278,17 @@ handle_sas () {
|
||||
local DEV=$1
|
||||
local cil adapter controller_dev
|
||||
# SAS device
|
||||
- sas_host_path="${DEV%%/phy*}"
|
||||
+ sas_host_path="${DEV%%/port*}"
|
||||
sas_phy_path="${DEV#*/host*/}"
|
||||
sas_phy_path="${sas_phy_path%%/target*}"
|
||||
sas_phy_id="${sas_phy_path%%/*}"
|
||||
- sas_rphy_id="${sas_phy_path##*/}"
|
||||
- sas_phy_dev="/sys/class/sas_phy/${sas_phy_id}"
|
||||
+ sas_phy_id="${sas_phy_id##*port-}"
|
||||
+ sas_port_id="${sas_phy_path%%/end_device*}"
|
||||
+ sas_port_id="${sas_port_id##*port-}"
|
||||
+ sas_end_id="${sas_phy_path##*end_device-}"
|
||||
+ sas_phy_dev="/sys/class/sas_phy/phy-${sas_phy_id}"
|
||||
if [ -e "$sas_phy_dev/sas_address" ]; then
|
||||
read phy_address < $sas_phy_dev/sas_address
|
||||
- read phy_port < $sas_phy_dev/port_identifier
|
||||
read phy_id < $sas_phy_dev/phy_identifier
|
||||
fi
|
||||
if [ -z "$phy_address" ] ; then
|
||||
@@ -295,22 +297,32 @@ handle_sas () {
|
||||
RESULT=1
|
||||
return
|
||||
fi
|
||||
+ sas_port_dev="/sys/class/sas_port/port-${sas_port_id}"
|
||||
+ if [ -e "$sas_port_dev/num_phys" ] ; then
|
||||
+ read phy_port < $sas_port_dev/num_phys
|
||||
+ fi
|
||||
+ if [ -z "$phy_port" ] ; then
|
||||
+ : no initiator address
|
||||
+ D=
|
||||
+ RESULT=1
|
||||
+ return
|
||||
+ fi
|
||||
sas_phy_address="$phy_address:$phy_port:$phy_id"
|
||||
- sas_rphy_dev="/sys/class/sas_device/${sas_rphy_id}"
|
||||
- if [ -e "$sas_rphy_dev/sas_address" ]; then
|
||||
- read rphy_address < $sas_rphy_dev/sas_address
|
||||
- read rphy_id < $sas_rphy_dev/phy_identifier
|
||||
+ sas_end_dev="/sys/class/sas_device/end_device-${sas_end_id}"
|
||||
+ if [ -e "$sas_end_dev/sas_address" ]; then
|
||||
+ read end_address < $sas_end_dev/sas_address
|
||||
+ read end_id < $sas_end_dev/phy_identifier
|
||||
fi
|
||||
- if [ -z "$rphy_address" ] ; then
|
||||
+ if [ -z "$end_address" ] ; then
|
||||
: no initiator address
|
||||
D=
|
||||
RESULT=1
|
||||
return
|
||||
fi
|
||||
- sas_rphy_address="$rphy_address:$rphy_id"
|
||||
+ sas_end_address="$end_address:$end_id"
|
||||
controller_dev="${sas_host_path%/host[0-9]*}"
|
||||
# SAS devices are always endpoints
|
||||
- d="sas-${sas_phy_address}-${sas_rphy_address}"
|
||||
+ d="sas-${sas_phy_address}-${sas_end_address}"
|
||||
D="$controller_dev"
|
||||
RESULT=0
|
||||
}
|
||||
@@ -470,7 +482,7 @@ handle_device () {
|
||||
*/rport-[0-9]*:[0-9]*-[0-9]*/*)
|
||||
handle_fc "$D"
|
||||
;;
|
||||
- */phy-[0-9]*:[0-9]*/*)
|
||||
+ */end_device-[0-9]*:[0-9]*:[0-9]*/*)
|
||||
handle_sas "$D"
|
||||
;;
|
||||
*/fw-host[0-9]*/*)
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
--- udev-095/udevstart.c.selinux 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-095/udevstart.c 2006-08-16 13:59:52.000000000 +0200
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "udev.h"
|
||||
#include "udev_rules.h"
|
||||
+#include "udev_selinux.h"
|
||||
|
||||
static const char *udev_run_str;
|
||||
static const char *udev_log_str;
|
||||
@@ -339,6 +340,7 @@
|
||||
|
||||
logging_init("udevstart");
|
||||
udev_config_init();
|
||||
+ selinux_init();
|
||||
dbg("version %s", UDEV_VERSION);
|
||||
|
||||
udev_run_str = getenv("UDEV_RUN");
|
||||
--- udev-095/udevd.c.selinux 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-095/udevd.c 2006-08-16 13:59:28.000000000 +0200
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "udev.h"
|
||||
#include "udev_rules.h"
|
||||
#include "udevd.h"
|
||||
+#include "udev_selinux.h"
|
||||
|
||||
static struct udev_rules rules;
|
||||
static int udevd_sock;
|
||||
@@ -868,6 +869,7 @@
|
||||
err("fatal, could not open /dev/null: %s", strerror(errno));
|
||||
|
||||
udev_config_init();
|
||||
+ selinux_init();
|
||||
dbg("version %s", UDEV_VERSION);
|
||||
|
||||
if (getuid() != 0) {
|
||||
--- udev-095/udev_node.c.selinux 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-095/udev_node.c 2006-08-16 13:59:13.000000000 +0200
|
||||
@@ -130,8 +129,6 @@
|
||||
int i;
|
||||
int retval = 0;
|
||||
|
||||
- selinux_init();
|
||||
-
|
||||
snprintf(filename, sizeof(filename), "%s/%s", udev_root, udev->name);
|
||||
filename[sizeof(filename)-1] = '\0';
|
||||
|
||||
--- udev-095/udev.c.selinux 2006-07-04 12:34:55.000000000 +0200
|
||||
+++ udev-095/udev.c 2006-08-16 13:59:19.000000000 +0200
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "udev.h"
|
||||
#include "udev_rules.h"
|
||||
+#include "udev_selinux.h"
|
||||
|
||||
#ifdef USE_LOG
|
||||
void log_message(int priority, const char *format, ...)
|
||||
@@ -93,6 +94,7 @@
|
||||
if (devnull < 0)
|
||||
err("fatal, could not open /dev/null: %s", strerror(errno));
|
||||
udev_config_init();
|
||||
+ selinux_init();
|
||||
dbg("version %s", UDEV_VERSION);
|
||||
|
||||
/* set signal handlers */
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
--- udev-106/udev_selinux.c.selinuxmedia 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/udev_selinux.c 2007-04-11 11:49:14.000000000 +0200
|
||||
@@ -118,10 +118,12 @@
|
||||
char *media;
|
||||
int ret = -1;
|
||||
|
||||
- media = get_media(devname, mode);
|
||||
- if (media) {
|
||||
- ret = matchmediacon(media, &scontext);
|
||||
- free(media);
|
||||
+ if (devname) {
|
||||
+ media = get_media(devname, mode);
|
||||
+ if (media) {
|
||||
+ ret = matchmediacon(media, &scontext);
|
||||
+ free(media);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
@@ -152,6 +154,8 @@
|
||||
* restoration creation purposes.
|
||||
*/
|
||||
if (is_selinux_running()) {
|
||||
+ if (!udev_root[0])
|
||||
+ err("selinux_init: udev_root not set\n");
|
||||
matchpathcon_init_prefix(NULL, udev_root);
|
||||
if (getfscreatecon(&prev_scontext) < 0) {
|
||||
err("getfscreatecon failed\n");
|
||||
--- udev-106/extras/floppy/create_floppy_devices.c.selinuxmedia 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/extras/floppy/create_floppy_devices.c 2007-04-11 11:45:59.000000000 +0200
|
||||
@@ -155,6 +155,7 @@
|
||||
if (type == 0)
|
||||
return 0;
|
||||
|
||||
+ udev_config_init();
|
||||
selinux_init();
|
||||
|
||||
i = 0;
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
--- udev-106/udevd.c.setenv 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/udevd.c 2007-04-25 16:22:19.000000000 +0200
|
||||
@@ -657,6 +657,7 @@
|
||||
struct ucred *cred;
|
||||
char cred_msg[CMSG_SPACE(sizeof(struct ucred))];
|
||||
int *intval;
|
||||
+ char *pos;
|
||||
|
||||
memset(&ctrl_msg, 0x00, sizeof(struct udevd_ctrl_msg));
|
||||
iov.iov_base = &ctrl_msg;
|
||||
@@ -693,6 +694,21 @@
|
||||
}
|
||||
|
||||
switch (ctrl_msg.type) {
|
||||
+ case UDEVD_CTRL_ENV:
|
||||
+ pos = strchr(ctrl_msg.buf, '=');
|
||||
+ if (pos == NULL) {
|
||||
+ err("wrong key format '%s'", ctrl_msg.buf);
|
||||
+ break;
|
||||
+ }
|
||||
+ pos[0] = '\0';
|
||||
+ if (pos[1] == '\0') {
|
||||
+ info("udevd message (ENV) received, unset '%s'", ctrl_msg.buf);
|
||||
+ unsetenv(ctrl_msg.buf);
|
||||
+ } else {
|
||||
+ info("udevd message (ENV) received, set '%s=%s'", ctrl_msg.buf, &pos[1]);
|
||||
+ setenv(ctrl_msg.buf, &pos[1], 1);
|
||||
+ }
|
||||
+ break;
|
||||
case UDEVD_CTRL_STOP_EXEC_QUEUE:
|
||||
info("udevd message (STOP_EXEC_QUEUE) received");
|
||||
stop_exec_q = 1;
|
||||
--- udev-106/udevd.h.setenv 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/udevd.h 2007-04-25 16:22:19.000000000 +0200
|
||||
@@ -46,6 +46,7 @@
|
||||
UDEVD_CTRL_SET_MAX_CHILDS,
|
||||
UDEVD_CTRL_SET_MAX_CHILDS_RUNNING,
|
||||
UDEVD_CTRL_RELOAD_RULES,
|
||||
+ UDEVD_CTRL_ENV,
|
||||
};
|
||||
|
||||
struct udevd_ctrl_msg {
|
||||
--- udev-106/udev_rules_parse.c.setenv 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/udev_rules_parse.c 2007-04-25 16:19:01.000000000 +0200
|
||||
@@ -393,6 +393,7 @@
|
||||
}
|
||||
if (strncmp(attr, "PHYSDEV", 7) == 0)
|
||||
physdev = 1;
|
||||
+ dbg("add_rule_key_pair(%s %s)", attr, value);
|
||||
if (add_rule_key_pair(rule, &rule->env, operation, attr, value) != 0)
|
||||
goto invalid;
|
||||
valid = 1;
|
||||
--- udev-106/udevd.8.setenv 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/udevd.8 2007-04-25 16:22:19.000000000 +0200
|
||||
@@ -65,6 +65,11 @@
|
||||
.RS 4
|
||||
udevcontrol starts the execution of events from udevd.
|
||||
.RE
|
||||
+.PP
|
||||
+\fBenv \fR\fB\fIvar\fR\fR\fB=\fR\fB\fIvalue\fR\fR
|
||||
+.RS 4
|
||||
+Set global variable.
|
||||
+.RE
|
||||
.SH "ENVIRONMENT"
|
||||
.PP
|
||||
\fBUDEV_LOG\fR
|
||||
--- udev-106/udevd.xml.setenv 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/udevd.xml 2007-04-25 16:22:19.000000000 +0200
|
||||
@@ -93,6 +93,12 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
+ <term><option>env <replaceable>var</replaceable>=<replaceable>value</replaceable></option></term>
|
||||
+ <listitem>
|
||||
+ <para>Set global variable.</para>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
<term><option>start_exec_queue</option></term>
|
||||
<listitem>
|
||||
<para>udevcontrol starts the execution of events from udevd.</para>
|
||||
--- udev-106/udevcontrol.c.setenv 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/udevcontrol.c 2007-04-25 16:22:19.000000000 +0200
|
||||
@@ -117,6 +117,15 @@
|
||||
}
|
||||
*intval = count;
|
||||
info("send max_childs_running=%i", *intval);
|
||||
+ } else if (!strncmp(arg, "env", strlen("env"))) {
|
||||
+ val = argv[++i];
|
||||
+ if (val == NULL) {
|
||||
+ fprintf(stderr, "missing key\n");
|
||||
+ goto exit;
|
||||
+ }
|
||||
+ ctrl_msg.type = UDEVD_CTRL_ENV;
|
||||
+ strlcpy(ctrl_msg.buf, val, sizeof(ctrl_msg.buf));
|
||||
+ info("send env '%s'", val);
|
||||
} else if (strcmp(arg, "help") == 0 || strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) {
|
||||
printf("Usage: udevcontrol COMMAND\n"
|
||||
" log_priority=<level> set the udev log level for the daemon\n"
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
--- /dev/null 2006-02-07 10:47:25.401206250 +0100
|
||||
+++ udev-084/extras/check-cdrom.sh 2006-02-07 10:58:51.000000000 +0100
|
||||
@@ -0,0 +1,39 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+pos=0
|
||||
+n=0
|
||||
+sp="$1"
|
||||
+what="$2"
|
||||
+found=0
|
||||
+
|
||||
+[ -e /proc/sys/dev/cdrom/info ] || exit 1
|
||||
+
|
||||
+/bin/cat /proc/sys/dev/cdrom/info | {
|
||||
+ while read line; do
|
||||
+ if [ "$found" = "0" -a "${line/drive name:}" != "$line" ]; then
|
||||
+ set ${line/drive name:}
|
||||
+ while [ $# -gt 0 ]; do
|
||||
+ pos=$[$pos+1]
|
||||
+ if [ "$1" == "$sp" ]; then
|
||||
+ found=1
|
||||
+ break
|
||||
+ fi
|
||||
+ shift
|
||||
+ done
|
||||
+ [ "$found" = "0" ] && exit 1
|
||||
+ elif [ "${line/$what:}" != "$line" ]; then
|
||||
+ set ${line##*$what:}
|
||||
+ while [ $# -gt 0 ]; do
|
||||
+ n=$[$n+1]
|
||||
+ if [ "$n" == "$pos" ]; then
|
||||
+ if [ "$1" = "1" ]; then
|
||||
+ exit 0
|
||||
+ fi
|
||||
+ break
|
||||
+ fi
|
||||
+ shift
|
||||
+ done
|
||||
+ fi
|
||||
+ done
|
||||
+ exit 1
|
||||
+}
|
||||
--- /dev/null 2006-02-07 10:47:25.401206250 +0100
|
||||
+++ udev-084/extras/run_directory/MAKEDEV.dev 2006-02-07 10:58:51.000000000 +0100
|
||||
@@ -0,0 +1,38 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+if [ "$ACTION" = "add" -a -e "$DEVNAME" ]; then
|
||||
+ if [ -x /usr/bin/logger ]; then
|
||||
+ LOGGER=/usr/bin/logger
|
||||
+ elif [ -x /bin/logger ]; then
|
||||
+ LOGGER=/bin/logger
|
||||
+ else
|
||||
+ unset LOGGER
|
||||
+ fi
|
||||
+ #
|
||||
+ # for diagnostics
|
||||
+ #
|
||||
+ if [ -f /etc/udev/udev.conf ]; then
|
||||
+ . /etc/udev/udev.conf
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
+ if [ -t 1 -o -z "$LOGGER" ]; then
|
||||
+ mesg () {
|
||||
+ echo "$@"
|
||||
+ }
|
||||
+ else
|
||||
+ mesg () {
|
||||
+ $LOGGER -t $(basename $0)"[$$]" "$@"
|
||||
+ }
|
||||
+ fi
|
||||
+
|
||||
+ debug_mesg () {
|
||||
+ test -z "$UDEV_LOG" -o "$UDEV_LOG" != "1" && return
|
||||
+ mesg "$@"
|
||||
+ }
|
||||
+
|
||||
+ debug_mesg "/sbin/MAKEDEV ${DEVNAME#$udev_root}"
|
||||
+ /sbin/MAKEDEV "${DEVNAME#$udev_root}"
|
||||
+ debug_mesg "Restoring permissions for " $DEVNAME*
|
||||
+ /sbin/pam_console_apply $DEVNAME*
|
||||
+fi
|
||||
--- /dev/null 2006-02-07 10:47:25.401206250 +0100
|
||||
+++ udev-084/extras/load_floppy_module.sh 2006-02-07 10:58:51.000000000 +0100
|
||||
@@ -0,0 +1,35 @@
|
||||
+#!/bin/sh
|
||||
+########################################################################
|
||||
+#
|
||||
+# Description : load_floppy_module
|
||||
+#
|
||||
+# Authors : Based on Open Suse Udev Rules
|
||||
+# kay.sievers at suse.de
|
||||
+#
|
||||
+# Notes : Loads the floppy module based upon contents of the NVRAM
|
||||
+#
|
||||
+########################################################################
|
||||
+
|
||||
+PROC=/proc/driver/nvram
|
||||
+
|
||||
+# wait for /proc file to appear
|
||||
+loop=10
|
||||
+while ! test -e $PROC; do
|
||||
+ sleep 0.1;
|
||||
+ test "$loop" -gt 0 || break
|
||||
+ loop=$(($loop - 1))
|
||||
+done
|
||||
+
|
||||
+if [ ! -r /proc/driver/nvram ]; then
|
||||
+ exit 0;
|
||||
+fi
|
||||
+
|
||||
+floppy_devices=$(cat $PROC | sed -n '/Floppy.*\..*/p')
|
||||
+
|
||||
+if [ -n "$floppy_devices" ]; then
|
||||
+ /sbin/modprobe block-major-2-
|
||||
+else
|
||||
+ /bin/true
|
||||
+fi
|
||||
+
|
||||
+exit $?
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
--- /dev/null 2006-02-07 10:47:25.401206250 +0100
|
||||
+++ udev-084/extras/udevpermconv.sh 2006-02-07 10:58:51.000000000 +0100
|
||||
@@ -0,0 +1,94 @@
|
||||
+#!/bin/bash
|
||||
+#
|
||||
+# convert old udev permissions.d file to the new rules.d format.
|
||||
+# revision 2
|
||||
+#
|
||||
+# Written by Michael Buesch <mbuesch@freenet.de>
|
||||
+# This is released into the Public Domain.
|
||||
+#
|
||||
+
|
||||
+
|
||||
+perm_file="$1"
|
||||
+
|
||||
+function processLine
|
||||
+{
|
||||
+ local line="$1"
|
||||
+ if [ -z "$line" ]; then
|
||||
+ echo
|
||||
+ return 1
|
||||
+ fi
|
||||
+ if [ "`echo $line | cut -b1`" = "#" ]; then
|
||||
+ # comment
|
||||
+ echo "$line"
|
||||
+ return 2
|
||||
+ fi
|
||||
+
|
||||
+ local i=
|
||||
+ local kern_name=
|
||||
+ local owner=
|
||||
+ local group=
|
||||
+ local mode=
|
||||
+ for ((i = 1; i <= 4; i++)); do
|
||||
+ local tmp="`echo $line | cut -d: -f $i`"
|
||||
+ if [ $i -eq 1 ]; then
|
||||
+ kern_name="$tmp"
|
||||
+ elif [ $i -eq 2 ]; then
|
||||
+ owner="$tmp"
|
||||
+ elif [ $i -eq 3 ]; then
|
||||
+ group="$tmp"
|
||||
+ elif [ $i -eq 4 ]; then
|
||||
+ mode="$tmp"
|
||||
+ fi
|
||||
+ done
|
||||
+ if [ -z "$kern_name" ]; then
|
||||
+ echo "Malformed line: \"$line\"" >&2
|
||||
+ return 3
|
||||
+ fi
|
||||
+ local need_rule="no"
|
||||
+ local out="KERNEL==\"$kern_name\""
|
||||
+ local kern_name_len="`echo $kern_name | wc -c`"
|
||||
+ kern_name_len="`expr $kern_name_len + 9`"
|
||||
+ local num_tabs="`expr 32 - $kern_name_len`"
|
||||
+ num_tabs="`expr $num_tabs / 8`"
|
||||
+ while [ $num_tabs -gt 0 ]; do
|
||||
+ out="${out}\t"
|
||||
+ num_tabs="`expr $num_tabs - 1`"
|
||||
+ done
|
||||
+ if [ -n "$owner" ] && [ "$owner" != "root" ]; then
|
||||
+ out="${out}, OWNER=\"$owner\""
|
||||
+ need_rule="yes"
|
||||
+ fi
|
||||
+ if [ -n "$group" ] && [ "$group" != "root" ]; then
|
||||
+ out="${out}, GROUP=\"$group\""
|
||||
+ need_rule="yes"
|
||||
+ fi
|
||||
+ if [ -n "$mode" ] && [ "$mode" != "0600" ] && [ "$mode" != "600" ]; then
|
||||
+ out="${out}, MODE=\"$mode\""
|
||||
+ need_rule="yes"
|
||||
+ fi
|
||||
+ if [ "$need_rule" = "no" ]; then
|
||||
+ echo "Do not need a rule for: \"$line\" (It's udev default permissions)" >&2
|
||||
+ return 4
|
||||
+ fi
|
||||
+ echo -e "$out"
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+function processInput
|
||||
+{
|
||||
+ echo "Converting udev permissions file. This can take a while..." >&2
|
||||
+ cat $perm_file | \
|
||||
+ while read line; do
|
||||
+ processLine "$line"
|
||||
+ done
|
||||
+ echo "done." >&2
|
||||
+}
|
||||
+
|
||||
+if ! [ -r "$perm_file" ]; then
|
||||
+ echo "Could not read input file" >&2
|
||||
+ echo "Usage: $0 old_permission_file > new_rules_file" >&2
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+processInput
|
||||
+exit 0
|
||||
102
udev-rules.patch
102
udev-rules.patch
|
|
@ -1,102 +0,0 @@
|
|||
--- udev-106/etc/udev/redhat/50-udev.rules.rhrules 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/etc/udev/redhat/50-udev.rules 2007-05-02 12:15:07.000000000 +0200
|
||||
@@ -41,9 +41,6 @@
|
||||
KERNEL=="hvc*", NAME="%k", GROUP="uucp", MODE="0660"
|
||||
KERNEL=="hvsi*", NAME="%k", GROUP="uucp", MODE="0660"
|
||||
KERNEL=="iseries/vtty*", NAME="%k", GROUP="uucp", MODE="0660"
|
||||
-KERNEL=="ttyUSB*", ATTRS{product}=="Palm Handheld*", SYMLINK+="pilot", GROUP="uucp", MODE="0660"
|
||||
-KERNEL=="ttyUSB*", ATTRS{product}=="palmOne Handheld*", SYMLINK+="pilot", GROUP="uucp", MODE="0660"
|
||||
-KERNEL=="ttyUSB*", ATTRS{product}=="Handspring Visor*", SYMLINK+="pilot", GROUP="uucp", MODE="0660"
|
||||
|
||||
# vc devices
|
||||
KERNEL=="vcs", NAME="%k", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
|
||||
@@ -68,9 +65,6 @@
|
||||
KERNEL=="nvram", MODE="0660"
|
||||
KERNEL=="rtc", MODE="0644"
|
||||
|
||||
-# pnp devices
|
||||
-ACTION=="add", SUBSYSTEM=="pnp", RUN+="/bin/sh -c 'while read id; do /lib/udev/modprobe pnp:d$$id; done < /sys/$devpath/id'"
|
||||
-
|
||||
# floppy devices
|
||||
KERNEL=="fd[01]*", GROUP="floppy", MODE="0660"
|
||||
# fix floppy devices
|
||||
@@ -212,7 +206,7 @@
|
||||
KERNEL=="vbi0", SYMLINK+="vbi"
|
||||
KERNEL=="null", SYMLINK+="XOR"
|
||||
|
||||
-KERNEL=="tun", NAME="net/%k"
|
||||
+KERNEL=="tun", NAME="net/%k", MODE="0666"
|
||||
|
||||
KERNEL=="device-mapper", NAME="mapper/control"
|
||||
|
||||
@@ -233,6 +227,7 @@
|
||||
|
||||
KERNEL=="pktcdvd", NAME="%k/control"
|
||||
|
||||
+
|
||||
KERNEL=="hd*[!0-9]", ATTR{removable}=="1", \
|
||||
ATTR{media}=="floppy", \
|
||||
SYMLINK+="floppy floppy-%k", OPTIONS+="ignore_remove, all_partitions"
|
||||
@@ -255,6 +250,7 @@
|
||||
OPTIONS+="ignore_remove"
|
||||
|
||||
|
||||
+
|
||||
#######################################
|
||||
# Persistent block device stuff - begin
|
||||
#######################################
|
||||
@@ -280,7 +276,6 @@
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/lib/udev/usb_id -x"
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/lib/udev/scsi_id -g -x -s %p -d $tempnode"
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/lib/udev/scsi_id -g -x -a -s %p -d $tempnode"
|
||||
-KERNEL=="dasd*[!0-9]", IMPORT{program}="/lib/udev/dasd_id --export $tempnode"
|
||||
KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
|
||||
|
||||
# for partitions import parent information
|
||||
@@ -315,9 +310,6 @@
|
||||
PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", \
|
||||
NAME="%c", MODE="0644"
|
||||
|
||||
-ACTION=="add", SUBSYSTEM=="?*", ENV{MODALIAS}=="?*", RUN+="modprobe $env{MODALIAS}"
|
||||
-
|
||||
-ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", RUN+="/bin/sh -c 'echo 1 > /sys/$DEVPATH/allow_func_id_match'"
|
||||
|
||||
# sd: 0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
|
||||
# sr: 4 TYPE_WORM, 5 TYPE_ROM
|
||||
@@ -351,5 +343,6 @@
|
||||
# mmc block devices
|
||||
ACTION=="add", SUBSYSTEM=="mmc", RUN+="modprobe mmc_block"
|
||||
|
||||
+
|
||||
RUN+="socket:/org/kernel/udev/monitor"
|
||||
|
||||
--- udev-106/etc/udev/redhat/95-pam-console.rules.rhrules 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/etc/udev/redhat/95-pam-console.rules 2007-05-02 12:04:15.000000000 +0200
|
||||
@@ -1 +1 @@
|
||||
-ACTION=="add", SYSFS{dev}=="?*", KERNEL=="?*", RUN+="/sbin/pam_console_apply $env{DEVNAME} $env{DEVLINKS}"
|
||||
+ENV{STARTUP}!="1", ACTION=="add", SYSFS{dev}=="?*", KERNEL=="?*", RUN+="/sbin/pam_console_apply $env{DEVNAME} $env{DEVLINKS}"
|
||||
--- udev-106/etc/udev/redhat/05-udev-early.rules.rhrules 2007-03-03 18:42:09.000000000 +0100
|
||||
+++ udev-106/etc/udev/redhat/05-udev-early.rules 2007-05-02 12:07:55.000000000 +0200
|
||||
@@ -1,10 +1,19 @@
|
||||
# sysfs is populated after the event is sent
|
||||
ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
|
||||
-ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
|
||||
-ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
|
||||
-
|
||||
# ignore these events until someone needs them
|
||||
SUBSYSTEM=="drivers", OPTIONS="ignore_device"
|
||||
SUBSYSTEM=="module", OPTIONS="ignore_device"
|
||||
|
||||
+
|
||||
+ACTION=="add", SUBSYSTEM=="?*", ENV{MODALIAS}=="?*", RUN+="modprobe $env{MODALIAS}", GOTO="skip_wait"
|
||||
+
|
||||
+# pnp devices
|
||||
+ACTION=="add", SUBSYSTEM=="pnp", RUN+="/bin/sh -c 'while read id; do /lib/udev/modprobe pnp:d$$id; done < /sys/$devpath/id'"
|
||||
+
|
||||
+ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
|
||||
+
|
||||
+ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
|
||||
+
|
||||
+LABEL="skip_wait"
|
||||
+
|
||||
ACTION=="add", SUBSYSTEM=="firmware", ENV{FIRMWARE}=="*", RUN="/sbin/firmware_helper", OPTIONS="last_rule"
|
||||
24
udev.nodes
24
udev.nodes
|
|
@ -1,24 +0,0 @@
|
|||
# These device have to be created manually
|
||||
tty1
|
||||
tty2
|
||||
tty3
|
||||
tty4
|
||||
tty5
|
||||
tty6
|
||||
loop0
|
||||
loop1
|
||||
loop2
|
||||
loop3
|
||||
loop4
|
||||
loop5
|
||||
loop6
|
||||
loop7
|
||||
parport0
|
||||
parport1
|
||||
parport2
|
||||
parport3
|
||||
net/tun
|
||||
ppp
|
||||
console
|
||||
null
|
||||
zero
|
||||
251
udevstart2.patch
251
udevstart2.patch
|
|
@ -1,251 +0,0 @@
|
|||
--- udev-084/udevstart.c.udevstart2 2006-01-30 08:51:38.000000000 +0100
|
||||
+++ udev-084/udevstart.c 2006-02-07 10:11:31.000000000 +0100
|
||||
@@ -37,13 +37,13 @@
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <fnmatch.h>
|
||||
|
||||
#include "udev.h"
|
||||
#include "udev_rules.h"
|
||||
|
||||
-static const char *udev_run_str;
|
||||
static const char *udev_log_str;
|
||||
-static struct udev_rules rules;
|
||||
|
||||
#ifdef USE_LOG
|
||||
void log_message(int priority, const char *format, ...)
|
||||
@@ -101,76 +101,60 @@
|
||||
static char *first_list[] = {
|
||||
"/class/mem",
|
||||
"/class/tty",
|
||||
+ "/bus",
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
+/* list of devices whose modaliases we should run last */
|
||||
+static char *last_modalias_list[] = {
|
||||
+ "pci:v*d*sv*sd*bc0Csc03i*", /* USB controller */
|
||||
+ "pci:v*d*sv*sd*bc0Csc00i10*", /* Firewire controller */
|
||||
NULL,
|
||||
};
|
||||
|
||||
static int add_device(const char *devpath)
|
||||
{
|
||||
- struct sysfs_device *dev;
|
||||
- struct udevice *udev;
|
||||
- int retval = 0;
|
||||
-
|
||||
- /* clear and set environment for next event */
|
||||
- clearenv();
|
||||
- setenv("ACTION", "add", 1);
|
||||
- setenv("UDEV_START", "1", 1);
|
||||
- if (udev_log_str)
|
||||
- setenv("UDEV_LOG", udev_log_str, 1);
|
||||
- if (udev_run_str)
|
||||
- setenv("UDEV_RUN", udev_run_str, 1);
|
||||
-
|
||||
- dev = sysfs_device_get(devpath);
|
||||
- if (dev == NULL)
|
||||
- return -1;
|
||||
-
|
||||
- udev = udev_device_init();
|
||||
- if (udev == NULL)
|
||||
- return -1;
|
||||
-
|
||||
- /* override built-in sysfs device */
|
||||
- udev->dev = dev;
|
||||
- strcpy(udev->action, "add");
|
||||
- udev->devt = udev_device_get_devt(udev);
|
||||
-
|
||||
- if (strcmp(udev->dev->subsystem, "net") != 0) {
|
||||
- udev->devt = udev_device_get_devt(udev);
|
||||
- if (major(udev->devt) == 0)
|
||||
- return -1;
|
||||
- }
|
||||
+ char filename[PATH_SIZE];
|
||||
+ int fd;
|
||||
+
|
||||
+ snprintf(filename, sizeof(filename), "%s/%s/uevent", sysfs_path, devpath);
|
||||
+ filename[sizeof(filename)-1] = '\0';
|
||||
+
|
||||
+ dbg("Trigger %s", filename);
|
||||
+ fd = open(filename, O_WRONLY);
|
||||
+ if (fd > 0) {
|
||||
+ write(fd, "add\n", 4);
|
||||
+ close(fd);
|
||||
+ }
|
||||
+ else return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
- dbg("add '%s'", udev->dev->devpath);
|
||||
- setenv("DEVPATH", udev->dev->devpath, 1);
|
||||
- setenv("SUBSYSTEM", udev->dev->subsystem, 1);
|
||||
-
|
||||
- udev_rules_get_name(&rules, udev);
|
||||
- if (udev->ignore_device) {
|
||||
- dbg("device event will be ignored");
|
||||
- goto exit;
|
||||
- }
|
||||
- if (udev->name[0] != '\0')
|
||||
- retval = udev_add_device(udev);
|
||||
- else
|
||||
- info("device node creation supressed");
|
||||
-
|
||||
- if (retval == 0 && udev_run) {
|
||||
- struct name_entry *name_loop;
|
||||
-
|
||||
- dbg("executing run list");
|
||||
- list_for_each_entry(name_loop, &udev->run_list, node) {
|
||||
- if (strncmp(name_loop->name, "socket:", strlen("socket:")) == 0)
|
||||
- pass_env_to_socket(&name_loop->name[strlen("socket:")], udev->dev->devpath, "add");
|
||||
- else {
|
||||
- char program[PATH_SIZE];
|
||||
-
|
||||
- strlcpy(program, name_loop->name, sizeof(program));
|
||||
- udev_rules_apply_format(udev, program, sizeof(program));
|
||||
- run_program(program, udev->dev->subsystem, NULL, 0, NULL, (udev_log_priority >= LOG_INFO));
|
||||
- }
|
||||
+static int modalias_is_greylisted(struct device *dev)
|
||||
+{
|
||||
+
|
||||
+ char filename[PATH_SIZE];
|
||||
+ char alias[PATH_SIZE];
|
||||
+ int fd, i;
|
||||
+
|
||||
+ snprintf(filename,sizeof(filename),"%s/%s/modalias", sysfs_path, dev->path);
|
||||
+ filename[sizeof(filename)-1] = '\0';
|
||||
+
|
||||
+ fd = open(filename, O_RDONLY);
|
||||
+ if (fd == -1)
|
||||
+ return 0;
|
||||
+ read(fd,alias,PATH_SIZE);
|
||||
+ alias[sizeof(alias)-1] = '\0';
|
||||
+ alias[strlen(alias)-1] = '\0';
|
||||
+
|
||||
+ for (i = 0; last_modalias_list[i] != NULL; i++)
|
||||
+ if (!fnmatch(last_modalias_list[i], alias, 0)) {
|
||||
+ close(fd);
|
||||
+ return 1;
|
||||
}
|
||||
- }
|
||||
|
||||
-exit:
|
||||
- udev_device_cleanup(udev);
|
||||
+ close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -184,6 +168,8 @@
|
||||
list_for_each_entry_safe(loop_device, tmp_device, device_list, node) {
|
||||
for (i = 0; first_list[i] != NULL; i++) {
|
||||
if (strncmp(loop_device->path, first_list[i], strlen(first_list[i])) == 0) {
|
||||
+ if (modalias_is_greylisted(loop_device))
|
||||
+ continue;
|
||||
add_device(loop_device->path);
|
||||
list_del(&loop_device->node);
|
||||
free(loop_device);
|
||||
@@ -203,6 +189,8 @@
|
||||
}
|
||||
if (found)
|
||||
continue;
|
||||
+ if (modalias_is_greylisted(loop_device))
|
||||
+ continue;
|
||||
|
||||
add_device(loop_device->path);
|
||||
list_del(&loop_device->node);
|
||||
@@ -222,7 +210,7 @@
|
||||
char filename[PATH_SIZE];
|
||||
struct stat statbuf;
|
||||
|
||||
- snprintf(filename, sizeof(filename), "%s/dev", path);
|
||||
+ snprintf(filename, sizeof(filename), "%s/uevent", path);
|
||||
filename[sizeof(filename)-1] = '\0';
|
||||
|
||||
if (stat(filename, &statbuf) == 0)
|
||||
@@ -279,6 +267,50 @@
|
||||
}
|
||||
}
|
||||
|
||||
+static void udev_scan_bus(struct list_head *device_list)
|
||||
+{
|
||||
+ char base[PATH_SIZE];
|
||||
+ DIR *dir;
|
||||
+ struct dirent *dent;
|
||||
+
|
||||
+ snprintf(base, sizeof(base), "%s/bus", sysfs_path);
|
||||
+ base[sizeof(base)-1] = '\0';
|
||||
+
|
||||
+ dir = opendir(base);
|
||||
+ if (dir != NULL) {
|
||||
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
|
||||
+ char dirname[PATH_SIZE];
|
||||
+ DIR *dir2;
|
||||
+ struct dirent *dent2;
|
||||
+
|
||||
+ if (dent->d_name[0] == '.')
|
||||
+ continue;
|
||||
+
|
||||
+ snprintf(dirname, sizeof(dirname), "%s/%s/devices", base, dent->d_name);
|
||||
+ dirname[sizeof(dirname)-1] = '\0';
|
||||
+
|
||||
+ dir2 = opendir(dirname);
|
||||
+ if (dir2 != NULL) {
|
||||
+ for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {
|
||||
+ char dirname2[PATH_SIZE];
|
||||
+
|
||||
+ if (dent2->d_name[0] == '.')
|
||||
+ continue;
|
||||
+
|
||||
+ snprintf(dirname2, sizeof(dirname2), "%s/%s", dirname, dent2->d_name);
|
||||
+ dirname2[sizeof(dirname2)-1] = '\0';
|
||||
+
|
||||
+ if (has_devt(dirname2))
|
||||
+ device_list_insert(dirname2, device_list);
|
||||
+ }
|
||||
+ closedir(dir2);
|
||||
+ }
|
||||
+ }
|
||||
+ closedir(dir);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
static void udev_scan_class(struct list_head *device_list)
|
||||
{
|
||||
char base[PATH_SIZE];
|
||||
@@ -312,7 +344,7 @@
|
||||
snprintf(dirname2, sizeof(dirname2), "%s/%s", dirname, dent2->d_name);
|
||||
dirname2[sizeof(dirname2)-1] = '\0';
|
||||
|
||||
- if (has_devt(dirname2) || strcmp(dent->d_name, "net") == 0)
|
||||
+ if (has_devt(dirname2))
|
||||
device_list_insert(dirname2, device_list);
|
||||
}
|
||||
closedir(dir2);
|
||||
@@ -342,7 +374,6 @@
|
||||
udev_config_init();
|
||||
dbg("version %s", UDEV_VERSION);
|
||||
|
||||
- udev_run_str = getenv("UDEV_RUN");
|
||||
udev_log_str = getenv("UDEV_LOG");
|
||||
|
||||
/* disable all logging if not explicitely requested */
|
||||
@@ -362,13 +393,12 @@
|
||||
alarm(UDEV_ALARM_TIMEOUT);
|
||||
|
||||
sysfs_init();
|
||||
- udev_rules_init(&rules, 1);
|
||||
|
||||
+ udev_scan_bus(&device_list);
|
||||
udev_scan_class(&device_list);
|
||||
udev_scan_block(&device_list);
|
||||
exec_list(&device_list);
|
||||
|
||||
- udev_rules_cleanup(&rules);
|
||||
sysfs_cleanup();
|
||||
logging_close();
|
||||
return 0;
|
||||
2
upstream
2
upstream
|
|
@ -1,2 +0,0 @@
|
|||
udev-094.tar.bz2
|
||||
udev-104.tar.bz2
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
pub 1024D/517D0F0E 2000-10-10 Linux Kernel Archives Verification Key <ftpadmin@kernel.org>
|
||||
Key fingerprint = C75D C40A 11D7 AF88 9981 ED5B C86B A06A 517D 0F0E
|
||||
sub 4096g/E50A8F2A 2000-10-10
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.0.3 (GNU/Linux)
|
||||
Comment: For info see http://www.gnupg.org
|
||||
|
||||
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
|
||||
=SZZb
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
Loading…
Add table
Add a link
Reference in a new issue