rpms/udev/devel start_udev, 1.93, 1.94 udev-post.init, 1.13, 1.14 udev.spec, 1.312, 1.313
Harald Hoyer
harald at fedoraproject.org
Thu May 27 09:31:38 UTC 2010
Author: harald
Update of /cvs/pkgs/rpms/udev/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv7812
Modified Files:
start_udev udev-post.init udev.spec
Log Message:
* Thu May 27 2010 Harald Hoyer <harald at redhat.com> 156-2
- cleaned up start_udev and udev-post initscript
- removed redhat specific rules
- removed all the makedev.d stuff, udevd now natively supports
/lib/udev/devices
- added basic devices in /lib/udev/devices
Index: start_udev
===================================================================
RCS file: /cvs/pkgs/rpms/udev/devel/start_udev,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -p -r1.93 -r1.94
--- start_udev 12 May 2010 14:19:12 -0000 1.93
+++ start_udev 27 May 2010 09:31:37 -0000 1.94
@@ -29,32 +29,11 @@ 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
. /etc/sysconfig/udev
prog=udev
-bin=/sbin/udev
-udevd=/sbin/udevd
-MAKEDEV="/sbin/MAKEDEV"
-
-# Check SELinux status
-selinuxfs="$(fstab_decode_str `LC_ALL=C awk '/ selinuxfs / { print $2 }' /proc/mounts`)"
-SELINUX_STATE=
-if [ -n "$selinuxfs" ] && [ "`cat /proc/self/attr/current`" != "kernel" ]; then
- if [ -r "$selinuxfs/enforce" ] ; then
- SELINUX_STATE=`cat "$selinuxfs/enforce"`
- else
- # assume enforcing if you can't read it
- SELINUX_STATE=1
- fi
-fi
touch_recursive() {
( cd $1;
@@ -65,120 +44,6 @@ touch_recursive() {
return 0
}
-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
- [ -d $udev_root/hugepages ] || mkdir -m 0755 $udev_root/hugepages
- [ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV;
-
- USE_MD5="false"
- [[ "$UDEV_USE_MAKEDEV_CACHE" == "yes" && -x /usr/bin/md5sum ]] && USE_MD5="true"
-
- for i in 0 1 2 3 4 5 6 7; do
- [ -b /dev/loop$i ] || /bin/mknod -m 0640 /dev/loop$i b 7 $i
- /bin/chown root:disk /dev/loop$i
- done
-
- for i in 0 1 2 3; do
- [ -c /dev/lp$i ] || /bin/mknod -m 0660 /dev/lp$i c 6 $i
- /bin/chown root:lp /dev/lp$i
- done
-
- [ -d /dev/net ] || mkdir -p /dev/net
- [ -c /dev/net/tun ] || /bin/mknod -m 0666 /dev/net/tun c 10 200
- #/bin/chown root:root /dev/net/tun
-
- [ -c /dev/ppp ] || /bin/mknod -m 0600 /dev/ppp c 108 0
- #/bin/chown root:root /dev/ppp
-
- [ -c /dev/fuse ] || /bin/mknod -m 0666 /dev/fuse c 10 229
- #/bin/chown root:root /dev/fuse
-
- if [ -x "$MAKEDEV" ]; then
- for i in /etc/udev/makedev.d/*.nodes; do
- if [ -f "$i" ]; then
- # use a little caching to speedup things
- if [ "$USE_MD5" == "true" ]; then
- # fix for MAKEDEV shell scripts
- [ -d /dev/.udev/makedev.d ] || mkdir -p /dev/.udev/makedev.d
- md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a))-se$SELINUX_STATE
- if [ -f "/var/lib/udev/makedev.d/${md5}.sh" ];then
- md5file="/var/lib/udev/makedev.d/${md5}.sh"
- else
- md5file="/dev/.udev/makedev.d/${md5}.sh"
- fi
- if [ ! -f "$md5file" ]; then
- ( sed -e 's,#.*,,g' "$i" | \
- xargs_simple -n 100 $MAKEDEV -x -a -S ) \
- > "$md5file"
- fi
- . "$md5file" >$udev_root/null 2>&1
- else
- ( sed -e 's,#.*,,g' "$i" | \
- xargs_simple -n 100 $MAKEDEV -x )
- fi
- 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
- #echo "Warning: $devdir is deprecated. Please use /etc/udev/makedev.d/."
- cp -ar "$@" $udev_root/
- fi
- popd &> "$udev_root/null"
- done
-
- if [ -x /sbin/restorecon ]; then
- /sbin/restorecon -R /dev
- fi
-
-
-}
-
-kill_udevd() {
- if [ -x /sbin/pidof ]; then
- pid=`/sbin/pidof -x udevd`
- [ -n "$pid" ] && kill $pid
- fi
-}
-
findalias () {
local n
for n in "$1"/* ; do
@@ -223,107 +88,63 @@ wait_for_queue() {
}
export ACTION=add
-prog=udev
ret=0
STRING=$"Starting $prog: "
-# propagate $udev_root from /sys
+# propagate /dev from /sys
echo -n "$STRING"
-# mount the tmpfs on ${udev_root%/}, if not already done
-LANG=C awk "\$2 == \"${udev_root%/}\" && ( \$3 == \"devtmpfs\" || \$3 == \"tmpfs\" ) { exit 1 }" /proc/mounts && {
- if LANG=C grep -Fq "none ${udev_root%/}/pts " /proc/mounts; then
- PTSDIR=$(mktemp -d)
- mount --move $udev_root/pts "$PTSDIR"
- fi
- if LANG=C grep -Fq "none ${udev_root%/}/shm " /proc/mounts; then
- SHMDIR=$(mktemp -d)
- mount --move $udev_root/shm "$SHMDIR"
- fi
- # First try to mount a devtmpfs on $udev_root
- mount -n -o mode=0755 -t devtmpfs none "$udev_root" 2>/dev/null \
- || 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 + $?]
-}
+rm -fr /dev/.udev > "/dev/null" 2>&1
-make_extra_nodes
-kill_udevd > "$udev_root/null" 2>&1
-rm -fr $udev_root/.udev > "$udev_root/null" 2>&1
-mkdir -p $udev_root/.udev > "$udev_root/null" 2>&1
UDEV_OPTS=""
-if [ -f "/sys/class/tty/console/uevent" ]; then
- # trigger the sorted events
- echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
-
- cmdline=$(cat /proc/cmdline)
+cmdline=$(cat /proc/cmdline)
- if strstr "$cmdline" udevtrace; then
- UDEV_OPTS="$UDEV_OPTS --debug-trace"
- fi
+if strstr "$cmdline" udevtrace; then
+ UDEV_OPTS="$UDEV_OPTS --debug-trace"
+fi
- if strstr "$cmdline" udevlog; then
- UDEV_OPTS="$UDEV_OPTS --debug"
- /sbin/udevd -d $UDEV_OPTS 2>$udev_root/.udev/udev.log
- else
- /sbin/udevd -d $UDEV_OPTS
- fi
+if strstr "$cmdline" udevlog; then
+ UDEV_OPTS="$UDEV_OPTS --debug"
+ /sbin/udevd -d $UDEV_OPTS 2>/dev/.udev/udev.log
+else
+ /sbin/udevd -d $UDEV_OPTS
+fi
- wait
- ret=$[$ret + $?]
+ret=$[$ret + $?]
- udevtimeout=$(getval udevtimeout $cmdline)
+udevtimeout=$(getval udevtimeout $cmdline)
- if strstr "$cmdline" udevdebug; then
- /sbin/udevadm control --log-priority=debug
- fi
- if strstr "$cmdline" udevinfo; then
- /sbin/udevadm control --log-priority=info
- fi
- if strstr "$cmdline" udevchilds; then
- /sbin/udevadm control --max-childs=$(getval udevchilds $cmdline)
- fi
+if strstr "$cmdline" udevdebug; then
+ /sbin/udevadm control --log-priority=debug
+fi
+if strstr "$cmdline" udevinfo; then
+ /sbin/udevadm control --log-priority=info
+fi
- if strstr "$cmdline" modprobedebug; then
- /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q"
- echo
- findalias /sys | while read modules ; do
- if [ -n "$modules" ]; then
- echo "Loading modules for $modules in 5 seconds"
- sleep 5
- /sbin/modprobe -a -v -q $modules
- wait_for_queue $udevtimeout
- fi
- done
- echo "Triggering Rest"
- fi
+if strstr "$cmdline" modprobedebug; then
+ /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q"
+ echo
+ findalias /sys | while read modules ; do
+ if [ -n "$modules" ]; then
+ echo "Loading modules for $modules in 5 seconds"
+ sleep 5
+ /sbin/modprobe -a -v -q $modules
+ wait_for_queue $udevtimeout
+ fi
+ done
+ echo "Triggering Rest"
+fi
- /sbin/udevadm trigger --action=add
- ret=$[$ret + $?]
- wait_for_queue $udevtimeout
- ret=$[$ret + $?]
- wait
- ret=$[$ret + $?]
- # touch all device files for timezone glitches
- # "find" is in /usr/bin and might not be available
- if [ -f /etc/sysconfig/clock ]; then
- . /etc/sysconfig/clock
- [[ "$UTC" == "false" || "$UTC" == "no" ]] \
- && touch_recursive /dev > "$udev_root/null" 2>&1
- fi
-else
- echo -n " kernel too old for this udev version "
- /sbin/udevd -d $UDEV_OPTS
- ret=10
+/sbin/udevadm trigger --type=subsystems --action=add
+/sbin/udevadm trigger --type=devices --action=add
+wait_for_queue $udevtimeout
+ret=$[$ret + $?]
+
+# touch all device files for timezone glitches
+# "find" is in /usr/bin and might not be available
+if [ -f /etc/sysconfig/clock ]; then
+ . /etc/sysconfig/clock
+ [[ "$UTC" == "false" || "$UTC" == "no" ]] \
+ && touch_recursive /dev > "/dev/null" 2>&1
fi
[ $ret -eq 0 ] && success $"$STRING" || failure $"$STRING"
Index: udev-post.init
===================================================================
RCS file: /cvs/pkgs/rpms/udev/devel/udev-post.init,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- udev-post.init 19 Mar 2010 12:47:12 -0000 1.13
+++ udev-post.init 27 May 2010 09:31:37 -0000 1.14
@@ -55,34 +55,6 @@ case "$1" in
;;
stop)
[ -w /var/lock/subsys ] || exit 4
- STRING=$"Generating udev makedev cache file"
- MAKEDEV="/sbin/MAKEDEV"
- USE_MD5="false"
- [[ "$UDEV_USE_MAKEDEV_CACHE" == "yes" && -x /usr/bin/md5sum ]] && USE_MD5="true"
- if [[ "$USE_MD5" == "true" && -x "$MAKEDEV" ]]; then
- for i in /etc/udev/makedev.d/*.nodes; do
- if [ -f "$i" ]; then
- # use a little caching to speedup things
- md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a))
- md5file="/var/lib/udev/makedev.d/${md5}.sh"
-
- if [ ! -f "$md5file" ]; then
- echo -n $STRING
- ( sed -e 's,#.*,,g' "$i" | \
- xargs $MAKEDEV -x -a -S ) \
- > "$md5file"
- rc=$?
- if [ "$rc" -eq "0" ]; then
- success "$STRING"
- echo
- elif [ "$rc" -eq "1" ]; then
- failure "$STRING"
- echo
- fi
- fi
- fi
- done
- fi
rm -f /var/lock/subsys/udev-post
exit 0
;;
Index: udev.spec
===================================================================
RCS file: /cvs/pkgs/rpms/udev/devel/udev.spec,v
retrieving revision 1.312
retrieving revision 1.313
diff -u -p -r1.312 -r1.313
--- udev.spec 25 May 2010 12:09:05 -0000 1.312
+++ udev.spec 27 May 2010 09:31:37 -0000 1.313
@@ -5,7 +5,7 @@
Summary: A userspace implementation of devfs
Name: udev
Version: 156
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Group: System Environment/Base
Provides: udev-persistent = %{version}-%{release}
@@ -27,7 +27,7 @@ URL: http://www.kernel.org/pub/linux/uti
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service
Requires(pre): /usr/bin/stat /sbin/pidof
-Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd
+Requires(pre): /usr/bin/getent /usr/sbin/groupadd
Requires: hwdata
%ifarch s390 s390x
@@ -36,7 +36,7 @@ Requires: s390utils-base
%endif
BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel
-BuildRequires: glib2-devel bison findutils MAKEDEV
+BuildRequires: glib2-devel bison findutils
BuildRequires: gperf libtool
BuildRequires: libusb-devel libacl-devel
BuildRequires: libxslt
@@ -136,7 +136,7 @@ rm -fr $RPM_BUILD_ROOT%{_docdir}/udev
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
# Deprecated, but keep the ownership
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,makedev.d,scripts,devices}
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,scripts,devices}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dev.d
mkdir -p $RPM_BUILD_ROOT%{_bindir}
touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config
@@ -145,7 +145,6 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi
ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id
for i in \
- rules/redhat/40-redhat.rules \
%ifarch ia64
rules/packages/40-ia64.rules \
%endif
@@ -159,7 +158,9 @@ for i in \
install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}"
done
-mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices}
+mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices,devices/net,devices/pts,devices/shm,devices/hugepages}
+
+ln -s /sbin/MAKEDEV $RPM_BUILD_ROOT%{udev_scriptdir}/devices/MAKEDEV
install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{udev_scriptdir}/fw_unit_symlinks.sh
@@ -174,8 +175,6 @@ install -m 0755 %{SOURCE3} $RPM_BUILD_RO
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/udev
-mkdir -p $RPM_BUILD_ROOT/var/lib/udev/makedev.d
-
%preun
if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then
if [ -x /sbin/pidof ]; then
@@ -192,7 +191,6 @@ fi
exit 0
%pre
-# to be kept
getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || :
getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || :
getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || :
@@ -227,12 +225,6 @@ fi
exit 0
-%triggerin -- selinux-policy
-rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || :
-
-%triggerin -- MAKEDEV
-rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || :
-
%post -n libudev -p /sbin/ldconfig
%postun -n libudev -p /sbin/ldconfig
@@ -267,15 +259,33 @@ rm -rf $RPM_BUILD_ROOT
%attr(0755,root,root) %{udev_scriptdir}/input_id
%attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh
-
%attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/
%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post
%attr(0755,root,root) %dir %{_sysconfdir}/udev/
%attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/
%attr(0755,root,root) %dir %{udev_scriptdir}/
%attr(0755,root,root) %dir %{udev_scriptdir}/devices/
-%attr(0755,root,root) %dir %{_sysconfdir}/udev/makedev.d/
-
+%attr(0755,root,root) %dir %{udev_scriptdir}/devices/net
+%attr(0755,root,root) %dir %{udev_scriptdir}/devices/hugepages
+%attr(0755,root,root) %dir %{udev_scriptdir}/devices/pts
+%attr(0755,root,root) %dir %{udev_scriptdir}/devices/shm
+%{udev_scriptdir}/devices/MAKEDEV
+%attr(666,root,root) %dev(c,10,200) %{udev_scriptdir}/devices/net/tun
+%attr(600,root,root) %dev(c,108,0) %{udev_scriptdir}/devices/ppp
+%attr(666,root,root) %dev(c,10,229) %{udev_scriptdir}/devices/fuse
+%attr(660,root,lp) %dev(c,6,0) %{udev_scriptdir}/devices/lp0
+%attr(660,root,lp) %dev(c,6,1) %{udev_scriptdir}/devices/lp1
+%attr(660,root,lp) %dev(c,6,2) %{udev_scriptdir}/devices/lp2
+%attr(660,root,lp) %dev(c,6,3) %{udev_scriptdir}/devices/lp3
+%attr(640,root,disk) %dev(c,7,0) %{udev_scriptdir}/devices/loop0
+%attr(640,root,disk) %dev(c,7,1) %{udev_scriptdir}/devices/loop1
+%attr(640,root,disk) %dev(c,7,2) %{udev_scriptdir}/devices/loop2
+%attr(640,root,disk) %dev(c,7,3) %{udev_scriptdir}/devices/loop3
+%attr(640,root,disk) %dev(c,7,4) %{udev_scriptdir}/devices/loop4
+%attr(640,root,disk) %dev(c,7,5) %{udev_scriptdir}/devices/loop5
+%attr(640,root,disk) %dev(c,7,6) %{udev_scriptdir}/devices/loop6
+%attr(640,root,disk) %dev(c,7,7) %{udev_scriptdir}/devices/loop7
+
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/udev
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf
@@ -288,14 +298,6 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,root,root) %{_mandir}/man7/udev*.7*
%attr(0644,root,root) %{_mandir}/man8/scsi_id*.8*
-%dir %attr(0755,root,root) /var/lib/udev
-%dir %attr(0755,root,root) /var/lib/udev/makedev.d
-
-# Deprecated, but keep the ownership
-%ghost %dir %{_sysconfdir}/udev/scripts/
-%ghost %dir %{_sysconfdir}/udev/devices/
-%ghost %dir %{_sysconfdir}/dev.d/
-
%attr(0755,root,root) %{udev_scriptdir}/mobile-action-modeswitch
%attr(0755,root,root) %{udev_scriptdir}/pci-db
%attr(0755,root,root) %{udev_scriptdir}/usb-db
@@ -307,6 +309,12 @@ rm -rf $RPM_BUILD_ROOT
%{udev_scriptdir}/keymaps/*
%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck
+# Deprecated, but keep the ownership
+%ghost %dir /var/lib/udev
+%ghost %dir %{_sysconfdir}/udev/scripts/
+%ghost %dir %{_sysconfdir}/udev/devices/
+%ghost %dir %{_sysconfdir}/dev.d/
+%ghost %dir %{_sysconfdir}/udev/makedev.d/
%files -n libudev
%defattr(0644, root, root, 0755)
@@ -341,6 +349,13 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0*
%changelog
+* Thu May 27 2010 Harald Hoyer <harald at redhat.com> 156-2
+- cleaned up start_udev and udev-post initscript
+- removed redhat specific rules
+- removed all the makedev.d stuff, udevd now natively supports
+ /lib/udev/devices
+- added basic devices in /lib/udev/devices
+
* Tue May 25 2010 Harald Hoyer <harald at redhat.com> 156-1
- version 156
More information about the scm-commits
mailing list