Hello community,
here is the log from the commit of package udev for openSUSE:Factory
checked in at Tue Mar 24 18:38:46 CET 2009.
--------
--- udev/udev.changes 2009-03-03 21:03:14.000000000 +0100
+++ udev/udev.changes 2009-03-24 03:17:32.062379000 +0100
@@ -1,0 +2,12 @@
+Tue Mar 24 03:14:36 CET 2009 - kay.sievers@novell.com
+
+- new upstream release 140
+ udevadm settle - add --seq-start= --seq-end=
+
+-------------------------------------------------------------------
+Mon Mar 9 21:46:30 CET 2009 - mmarek@suse.cz
+
+- renamed /etc/modprobe.d/pnp-aliases.conf to 50-pnp-aliases.conf
+ so that 99-local.conf comes last
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
pnp-aliases.conf
udev-139.tar.bz2
New:
----
50-pnp-aliases.conf
udev-140.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ udev.spec ++++++
--- /var/tmp/diff_new_pack.h25717/_old 2009-03-24 18:36:44.000000000 +0100
+++ /var/tmp/diff_new_pack.h25717/_new 2009-03-24 18:36:44.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package udev (Version 139)
+# spec file for package udev (Version 140)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -20,7 +20,7 @@
Name: udev
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
-Version: 139
+Version: 140
Release: 1
License: GPL v2 or later
Group: System/Kernel
@@ -33,7 +33,7 @@
Source0: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2
Source60: boot.udev
Source61: boot.udev_retry
-Source62: pnp-aliases.conf
+Source62: 50-pnp-aliases.conf
%description
udev's main task is to create and remove device nodes in /dev when a
@@ -148,7 +148,7 @@
cp rules/suse/*.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
install -m755 -D %{S:60} $RPM_BUILD_ROOT/etc/init.d/boot.udev
install -m755 -D %{S:61} $RPM_BUILD_ROOT/etc/init.d/boot.udev_retry
-install -m644 -D %{S:62} $RPM_BUILD_ROOT/etc/modprobe.d/pnp-aliases.conf
+install -m644 -D %{S:62} $RPM_BUILD_ROOT/etc/modprobe.d/50-pnp-aliases.conf
# install initial /dev + static devices (nodes are in the files section below)
mkdir -p $RPM_BUILD_ROOT/lib/udev/devices
mkdir -p $RPM_BUILD_ROOT/lib/udev/devices/pts
@@ -233,7 +233,7 @@
%config(noreplace) %{_sysconfdir}/udev/udev.conf
%config(noreplace) %{_sysconfdir}/scsi_id.config
%dir %{_sysconfdir}/modprobe.d/
-%{_sysconfdir}/modprobe.d/pnp-aliases.conf
+%{_sysconfdir}/modprobe.d/50-pnp-aliases.conf
%{_mandir}/man?/*.[0-9]*
%doc docs/writing_udev_rules
# static devices, copied to /dev at every bootup
@@ -296,6 +296,12 @@
/%{_lib}/libvolume_id.so.*
%changelog
+* Tue Mar 24 2009 kay.sievers@novell.com
+- new upstream release 140
+ udevadm settle - add --seq-start= --seq-end=
+* Mon Mar 09 2009 mmarek@suse.cz
+- renamed /etc/modprobe.d/pnp-aliases.conf to 50-pnp-aliases.conf
+ so that 99-local.conf comes last
* Tue Mar 03 2009 kay.sievers@novell.com
- new upstream release 139
fixes for the block device monitor
++++++ 50-pnp-aliases.conf ++++++
# do not edit this file, it will be overwritten on update
# installed by udev
alias acpi*:PNP0700:* floppy
++++++ udev-139.tar.bz2 -> udev-140.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/ChangeLog new/udev-140/ChangeLog
--- old/udev-139/ChangeLog 2009-02-26 23:28:11.000000000 +0100
+++ new/udev-140/ChangeLog 2009-03-13 13:13:55.000000000 +0100
@@ -1,3 +1,30 @@
+Summary of changes from v139 to v140
+============================================
+
+Harald Hoyer (1):
+ libvolume_id: bump age
+
+Kay Sievers (12):
+ version bump
+ update TODO
+ volume_id: ntfs - fix uuid setting
+ update TODO
+ rules: Fedora update
+ libudev: queue - use lstat() to check existence of symlink
+ udevadm: settle - add --seq-start= --seq-end=
+ udevd: switch watch symlinks to devpath
+ udevadm: add text for new options to command and man page
+ update TODO
+ libudev: ctrl - return error after sending ctrl message
+ udevadm: settle - use timeout signal, instead of loop counter
+
+Michael Prokop (1):
+ fix compile error in debug mode
+
+Scott James Remnant (1):
+ udevadm: settle - synchronise with the udev daemon
+
+
Summary of changes from v138 to v139
============================================
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/configure new/udev-140/configure
--- old/udev-139/configure 2009-02-26 14:16:09.000000000 +0100
+++ new/udev-140/configure 2009-03-11 13:29:50.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for udev 139.
+# Generated by GNU Autoconf 2.63 for udev 140.
#
# Report bugs to .
#
@@ -745,8 +745,8 @@
# Identity of this package.
PACKAGE_NAME='udev'
PACKAGE_TARNAME='udev'
-PACKAGE_VERSION='139'
-PACKAGE_STRING='udev 139'
+PACKAGE_VERSION='140'
+PACKAGE_STRING='udev 140'
PACKAGE_BUGREPORT='linux-hotplug@vger.kernel.org'
ac_unique_file="udev/udevd.c"
@@ -1484,7 +1484,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures udev 139 to adapt to many kinds of systems.
+\`configure' configures udev 140 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1554,7 +1554,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of udev 139:";;
+ short | recursive ) echo "Configuration of udev 140:";;
esac
cat <<\_ACEOF
@@ -1659,7 +1659,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-udev configure 139
+udev configure 140
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1673,7 +1673,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by udev $as_me 139, which was
+It was created by udev $as_me 140, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2391,7 +2391,7 @@
# Define the identity of the package.
PACKAGE='udev'
- VERSION='139'
+ VERSION='140'
cat >>confdefs.h <<_ACEOF
@@ -11625,16 +11625,16 @@
test "$prefix" = NONE && test "$exec_prefix" = NONE && exec_prefix=
-LIBUDEV_LT_CURRENT=0
-LIBUDEV_LT_REVISION=9
-LIBUDEV_LT_AGE=0
+LIBUDEV_LT_CURRENT=1
+LIBUDEV_LT_REVISION=0
+LIBUDEV_LT_AGE=1
-VOLID_LT_CURRENT=1
-VOLID_LT_REVISION=9
-VOLID_LT_AGE=0
+VOLID_LT_CURRENT=2
+VOLID_LT_REVISION=0
+VOLID_LT_AGE=1
@@ -12362,7 +12362,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by udev $as_me 139, which was
+This file was extended by udev $as_me 140, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12425,7 +12425,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-udev config.status 139
+udev config.status 140
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/configure.ac new/udev-140/configure.ac
--- old/udev-139/configure.ac 2009-02-26 14:15:52.000000000 +0100
+++ new/udev-140/configure.ac 2009-03-11 13:23:02.000000000 +0100
@@ -1,5 +1,5 @@
AC_INIT([udev],
- [139],
+ [140],
[linux-hotplug@vger.kernel.org])
AC_PREREQ(2.60)
AC_CONFIG_SRCDIR([udev/udevd.c])
@@ -15,17 +15,17 @@
test "$prefix" = NONE && test "$exec_prefix" = NONE && exec_prefix=
dnl /* libudev version */
-LIBUDEV_LT_CURRENT=0
-LIBUDEV_LT_REVISION=9
-LIBUDEV_LT_AGE=0
+LIBUDEV_LT_CURRENT=1
+LIBUDEV_LT_REVISION=0
+LIBUDEV_LT_AGE=1
AC_SUBST(LIBUDEV_LT_CURRENT)
AC_SUBST(LIBUDEV_LT_REVISION)
AC_SUBST(LIBUDEV_LT_AGE)
dnl /* libvolume_id version */
-VOLID_LT_CURRENT=1
-VOLID_LT_REVISION=9
-VOLID_LT_AGE=0
+VOLID_LT_CURRENT=2
+VOLID_LT_REVISION=0
+VOLID_LT_AGE=1
AC_SUBST(VOLID_LT_CURRENT)
AC_SUBST(VOLID_LT_REVISION)
AC_SUBST(VOLID_LT_AGE)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/extras/volume_id/lib/ntfs.c new/udev-140/extras/volume_id/lib/ntfs.c
--- old/udev-139/extras/volume_id/lib/ntfs.c 2008-11-13 21:42:56.000000000 +0100
+++ new/udev-140/extras/volume_id/lib/ntfs.c 2009-03-03 13:21:08.000000000 +0100
@@ -97,6 +97,7 @@
int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size)
{
+ uint8_t volume_serial[8];
unsigned int sector_size;
unsigned int cluster_size;
uint64_t mft_cluster;
@@ -119,7 +120,7 @@
if (memcmp(ns->oem_id, "NTFS", 4) != 0)
return -1;
- volume_id_set_uuid(id, ns->volume_serial, 0, UUID_64BIT_LE);
+ memcpy(volume_serial, ns->volume_serial, sizeof(volume_serial));
sector_size = le16_to_cpu(ns->bytes_per_sector);
if (sector_size < 0x200)
@@ -193,6 +194,7 @@
}
}
+ volume_id_set_uuid(id, volume_serial, 0, UUID_64BIT_LE);
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
id->type = "ntfs";
/* we think this is ntfs, but we make sure no other signatures are found */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/NEWS new/udev-140/NEWS
--- old/udev-139/NEWS 2009-02-26 23:06:58.000000000 +0100
+++ new/udev-140/NEWS 2009-03-13 13:16:08.000000000 +0100
@@ -1,3 +1,10 @@
+udev 140
+========
+Bugfixes.
+
+"udevadm settle" now optionally accepts a range of events to wait for,
+instead of waiting for "all" events.
+
udev 139
========
Bugfixes.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/rules/redhat/95-pam-console.rules new/udev-140/rules/redhat/95-pam-console.rules
--- old/udev-139/rules/redhat/95-pam-console.rules 2008-10-16 18:03:43.000000000 +0200
+++ new/udev-140/rules/redhat/95-pam-console.rules 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-ENV{STARTUP}!="1", ACTION=="add", SYSFS{dev}=="?*", KERNEL=="?*", RUN+="/sbin/pam_console_apply $env{DEVNAME} $env{DEVLINKS}"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/rules/rules.d/50-udev-default.rules new/udev-140/rules/rules.d/50-udev-default.rules
--- old/udev-139/rules/rules.d/50-udev-default.rules 2009-01-15 17:04:59.000000000 +0100
+++ new/udev-140/rules/rules.d/50-udev-default.rules 2009-03-04 15:54:24.000000000 +0100
@@ -1,4 +1,5 @@
# do not edit this file, it will be overwritten on update
+# initramfs:default
SUBSYSTEM=="block", SYMLINK+="block/%M:%m"
SUBSYSTEM!="block", SYMLINK+="char/%M:%m"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/TODO new/udev-140/TODO
--- old/udev-139/TODO 2009-01-21 11:33:12.000000000 +0100
+++ new/udev-140/TODO 2009-03-13 13:13:45.000000000 +0100
@@ -1,11 +1,12 @@
- o add scsi:t-0x09* to ch and remove modprobe rule
+ o drop modprobe floppy alias (SUSE), it will be in the module (2.6.30)
+ o drop the DVB shell script rule (2.6.29)
+ o remove MMC rules, they got a modalias now (2.6.30)
+ o add scsi:t-0x09* to "ch" and remove modprobe rule
o switch device mapper rules to:
dmsetup info -c --nameprefixes --unquoted --rows --noheadings \
-o name,uuid,suspended,readonly,major,minor,open,tables_loaded
- o implement path_id with libudev
+ o implement path_id in C with libudev (?)
o convert firmware.sh to C (?)
- o drop the DVB shell script rule (2.6.29+)
o "udevadm control" commands will only accept the --<command> syntax
o symlink names to udevadm will no longer be resolved to old command names
- o get distros to agree on a default set of rules
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/lib/libudev-ctrl.c new/udev-140/udev/lib/libudev-ctrl.c
--- old/udev-139/udev/lib/libudev-ctrl.c 2008-11-01 20:11:26.000000000 +0100
+++ new/udev-140/udev/lib/libudev-ctrl.c 2009-03-12 13:00:56.000000000 +0100
@@ -42,6 +42,7 @@
UDEV_CTRL_SET_ENV,
UDEV_CTRL_SET_MAX_CHILDS,
UDEV_CTRL_SET_MAX_CHILDS_RUNNING,
+ UDEV_CTRL_SETTLE,
};
struct udev_ctrl_msg_wire {
@@ -58,6 +59,7 @@
int refcount;
struct udev_ctrl *uctrl;
struct udev_ctrl_msg_wire ctrl_msg_wire;
+ pid_t pid;
};
struct udev_ctrl {
@@ -168,38 +170,37 @@
int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority)
{
- ctrl_send(uctrl, UDEV_CTRL_SET_LOG_LEVEL, priority, NULL);
- return 0;
+ return ctrl_send(uctrl, UDEV_CTRL_SET_LOG_LEVEL, priority, NULL);
}
int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl)
{
- ctrl_send(uctrl, UDEV_CTRL_STOP_EXEC_QUEUE, 0, NULL);
- return 0;
+ return ctrl_send(uctrl, UDEV_CTRL_STOP_EXEC_QUEUE, 0, NULL);
}
int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl)
{
- ctrl_send(uctrl, UDEV_CTRL_START_EXEC_QUEUE, 0, NULL);
- return 0;
+ return ctrl_send(uctrl, UDEV_CTRL_START_EXEC_QUEUE, 0, NULL);
}
int udev_ctrl_send_reload_rules(struct udev_ctrl *uctrl)
{
- ctrl_send(uctrl, UDEV_CTRL_RELOAD_RULES, 0, NULL);
- return 0;
+ return ctrl_send(uctrl, UDEV_CTRL_RELOAD_RULES, 0, NULL);
}
int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key)
{
- ctrl_send(uctrl, UDEV_CTRL_SET_ENV, 0, key);
- return 0;
+ return ctrl_send(uctrl, UDEV_CTRL_SET_ENV, 0, key);
}
int udev_ctrl_send_set_max_childs(struct udev_ctrl *uctrl, int count)
{
- ctrl_send(uctrl, UDEV_CTRL_SET_MAX_CHILDS, count, NULL);
- return 0;
+ return ctrl_send(uctrl, UDEV_CTRL_SET_MAX_CHILDS, count, NULL);
+}
+
+int udev_ctrl_send_settle(struct udev_ctrl *uctrl)
+{
+ return ctrl_send(uctrl, UDEV_CTRL_SETTLE, 0, NULL);
}
struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl *uctrl)
@@ -245,6 +246,8 @@
goto err;
}
+ uctrl_msg->pid = cred->pid;
+
if (uctrl_msg->ctrl_msg_wire.magic != UDEV_CTRL_MAGIC) {
err(uctrl->udev, "message magic 0x%08x doesn't match, ignore it\n", uctrl_msg->ctrl_msg_wire.magic);
goto err;
@@ -317,3 +320,10 @@
return ctrl_msg->ctrl_msg_wire.intval;
return -1;
}
+
+pid_t udev_ctrl_get_settle(struct udev_ctrl_msg *ctrl_msg)
+{
+ if (ctrl_msg->ctrl_msg_wire.type == UDEV_CTRL_SETTLE)
+ return ctrl_msg->pid;
+ return -1;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/lib/libudev-private.h new/udev-140/udev/lib/libudev-private.h
--- old/udev-139/udev/lib/libudev-private.h 2009-02-23 21:20:59.000000000 +0100
+++ new/udev-140/udev/lib/libudev-private.h 2009-03-12 13:00:56.000000000 +0100
@@ -109,6 +109,7 @@
extern int udev_ctrl_send_stop_exec_queue(struct udev_ctrl *uctrl);
extern int udev_ctrl_send_start_exec_queue(struct udev_ctrl *uctrl);
extern int udev_ctrl_send_reload_rules(struct udev_ctrl *uctrl);
+extern int udev_ctrl_send_settle(struct udev_ctrl *uctrl);
extern int udev_ctrl_send_set_env(struct udev_ctrl *uctrl, const char *key);
extern int udev_ctrl_send_set_max_childs(struct udev_ctrl *uctrl, int count);
struct udev_ctrl_msg;
@@ -120,6 +121,7 @@
extern int udev_ctrl_get_stop_exec_queue(struct udev_ctrl_msg *ctrl_msg);
extern int udev_ctrl_get_start_exec_queue(struct udev_ctrl_msg *ctrl_msg);
extern int udev_ctrl_get_reload_rules(struct udev_ctrl_msg *ctrl_msg);
+extern pid_t udev_ctrl_get_settle(struct udev_ctrl_msg *ctrl_msg);
extern const char *udev_ctrl_get_set_env(struct udev_ctrl_msg *ctrl_msg);
extern int udev_ctrl_get_set_max_childs(struct udev_ctrl_msg *ctrl_msg);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/lib/libudev-queue.c new/udev-140/udev/lib/libudev-queue.c
--- old/udev-139/udev/lib/libudev-queue.c 2008-11-06 19:33:57.000000000 +0100
+++ new/udev-140/udev/lib/libudev-queue.c 2009-03-04 23:28:44.000000000 +0100
@@ -194,7 +194,7 @@
}
snprintf(filename, sizeof(filename), "%s/.udev/queue/%llu",
udev_get_dev_path(udev_queue->udev), seqnum);
- if (stat(filename, &statbuf) == 0)
+ if (lstat(filename, &statbuf) == 0)
return 0;
dbg(udev_queue->udev, "seqnum: %llu finished\n", seqnum);
return 1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevadm.8 new/udev-140/udev/udevadm.8
--- old/udev-139/udev/udevadm.8 2009-02-26 14:14:05.000000000 +0100
+++ new/udev-140/udev/udevadm.8 2009-03-07 02:22:41.000000000 +0100
@@ -335,6 +335,16 @@
Maximum number of seconds to wait for the event queue to become empty\&. The default value is 180 seconds\&. A value of 0 will check if the queue is empty and always return immediately\&.
.RE
.PP
+\fB\-\-seq\-start=\fR\fB\fIseqnum\fR\fR
+.RS 4
+Wait only for events after the given sequence number\&.
+.RE
+.PP
+\fB\-\-seq\-end=\fR\fB\fIseqnum\fR\fR
+.RS 4
+Wait only for events before the given sequence number\&.
+.RE
+.PP
\fB\-\-quiet\fR
.RS 4
Do not print any output, like the remaining queue entries when reaching the timeout\&.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevadm-info.c new/udev-140/udev/udevadm-info.c
--- old/udev-139/udev/udevadm-info.c 2009-02-26 22:53:54.000000000 +0100
+++ new/udev-140/udev/udevadm-info.c 2009-03-07 02:31:38.000000000 +0100
@@ -387,8 +387,7 @@
" of parent devices\n"
" --device-id-of-file=<file> print major:minor of device containing this file\n"
" --export-db export the content of the udev database\n"
- " --help print this text\n"
- "\n");
+ " --help\n\n");
goto exit;
default:
goto exit;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevadm-monitor.c new/udev-140/udev/udevadm-monitor.c
--- old/udev-139/udev/udevadm-monitor.c 2008-10-16 18:03:45.000000000 +0200
+++ new/udev-140/udev/udevadm-monitor.c 2009-03-07 02:30:11.000000000 +0100
@@ -104,7 +104,7 @@
" --env print the whole event environment\n"
" --kernel print kernel uevents\n"
" --udev print udev events\n"
- " --help print this help text\n\n");
+ " --help\n\n");
default:
goto out;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevadm-settle.c new/udev-140/udev/udevadm-settle.c
--- old/udev-139/udev/udevadm-settle.c 2009-01-31 20:00:56.000000000 +0100
+++ new/udev-140/udev/udevadm-settle.c 2009-03-12 22:36:43.000000000 +0100
@@ -1,5 +1,7 @@
/*
* Copyright (C) 2006-2008 Kay Sievers
+ * Copyright (C) 2009 Canonical Ltd.
+ * Copyright (C) 2009 Scott James Remnant
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +27,7 @@
#include
#include
#include
+#include
#include
#include
@@ -33,31 +36,61 @@
#define DEFAULT_TIMEOUT 180
#define LOOP_PER_SECOND 20
+static int volatile is_timeout;
+
+static void asmlinkage sig_handler(int signum)
+{
+ switch (signum) {
+ case SIGALRM:
+ is_timeout = 1;
+ case SIGUSR1:
+ ;
+ }
+}
+
int udevadm_settle(struct udev *udev, int argc, char *argv[])
{
static const struct option options[] = {
+ { "seq-start", required_argument, NULL, 's' },
+ { "seq-end", required_argument, NULL, 'e' },
{ "timeout", required_argument, NULL, 't' },
{ "quiet", no_argument, NULL, 'q' },
{ "help", no_argument, NULL, 'h' },
{}
};
- int timeout = DEFAULT_TIMEOUT;
+ unsigned long long start = 0;
+ unsigned long long end = 0;
int quiet = 0;
+ int timeout = 0;
+ struct sigaction act;
struct udev_queue *udev_queue = NULL;
- int loop;
int rc = 0;
dbg(udev, "version %s\n", VERSION);
+ /* set signal handlers */
+ memset(&act, 0x00, sizeof(act));
+ act.sa_handler = (void (*)(int)) sig_handler;
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = 0;
+ sigaction(SIGALRM, &act, NULL);
+ sigaction(SIGUSR1, &act, NULL);
+
while (1) {
int option;
int seconds;
- option = getopt_long(argc, argv, "t:qh", options, NULL);
+ option = getopt_long(argc, argv, "s:e:t:qh", options, NULL);
if (option == -1)
break;
switch (option) {
+ case 's':
+ start = strtoull(optarg, NULL, 0);
+ break;
+ case 'e':
+ end = strtoull(optarg, NULL, 0);
+ break;
case 't':
seconds = atoi(optarg);
if (seconds >= 0)
@@ -70,23 +103,98 @@
quiet = 1;
break;
case 'h':
- printf("Usage: udevadm settle [--help] [--timeout=<seconds>] [--quiet]\n\n");
+ printf("Usage: udevadm settle OPTIONS\n"
+ " --timeout=<seconds> maximum time to wait for events\n"
+ " --seq-start=<seqnum> first seqnum to wait for\n"
+ " --seq-end=<seqnum> last seqnum to wait for\n"
+ " --quiet do not print list after timeout\n"
+ " --help\n\n");
goto exit;
}
}
+ if (timeout > 0)
+ alarm(timeout);
+ else
+ alarm(DEFAULT_TIMEOUT);
+
udev_queue = udev_queue_new(udev);
if (udev_queue == NULL)
goto exit;
- loop = timeout * LOOP_PER_SECOND;
- while (loop--) {
+
+ if (start > 0) {
+ unsigned long long kernel_seq;
+
+ kernel_seq = udev_queue_get_kernel_seqnum(udev_queue);
+
+ /* unless specified, the last event is the current kernel seqnum */
+ if (end == 0)
+ end = udev_queue_get_kernel_seqnum(udev_queue);
+
+ if (start > end) {
+ err(udev, "seq-start larger than seq-end, ignoring\n");
+ fprintf(stderr, "seq-start larger than seq-end, ignoring\n");
+ start = 0;
+ end = 0;
+ }
+
+ if (start > kernel_seq || end > kernel_seq) {
+ err(udev, "seq-start or seq-end larger than current kernel value, ignoring\n");
+ fprintf(stderr, "seq-start or seq-end larger than current kernel value, ignoring\n");
+ start = 0;
+ end = 0;
+ }
+ info(udev, "start=%llu end=%llu current=%llu\n", start, end, kernel_seq);
+ } else {
+ if (end > 0) {
+ err(udev, "seq-end needs seq-start parameter, ignoring\n");
+ fprintf(stderr, "seq-end needs seq-start parameter, ignoring\n");
+ end = 0;
+ }
+ }
+
+ /* guarantee that the udev daemon isn't pre-processing */
+ if (getuid() == 0) {
+ struct udev_ctrl *uctrl;
+
+ uctrl = udev_ctrl_new_from_socket(udev, UDEV_CTRL_SOCK_PATH);
+ if (uctrl != NULL) {
+ sigset_t mask, oldmask;
+
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR1);
+ sigaddset(&mask, SIGALRM);
+ sigprocmask(SIG_BLOCK, &mask, &oldmask);
+ if (udev_ctrl_send_settle(uctrl) > 0)
+ sigsuspend(&oldmask);
+ udev_ctrl_unref(uctrl);
+ }
+ }
+
+ while (!is_timeout) {
+ /* exit if queue is empty */
if (udev_queue_get_queue_is_empty(udev_queue))
break;
+
+ /* if asked for, wait for a specific sequence of events */
+ if (start > 0) {
+ unsigned long long seq;
+ int finished;
+
+ finished = 0;
+ for (seq = start; seq <= end; seq++) {
+ finished = udev_queue_get_seqnum_is_finished(udev_queue, seq);
+ if (!finished)
+ break;
+ }
+ if (finished)
+ break;
+ }
usleep(1000 * 1000 / LOOP_PER_SECOND);
}
/* if we reached the timeout, print the list of remaining events */
- if (loop <= 0) {
+ if (is_timeout) {
struct udev_list_entry *list_entry;
if (!quiet) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevadm-test.c new/udev-140/udev/udevadm-test.c
--- old/udev-139/udev/udevadm-test.c 2009-02-24 14:44:51.000000000 +0100
+++ new/udev-140/udev/udevadm-test.c 2009-03-07 02:30:29.000000000 +0100
@@ -64,7 +64,7 @@
case 'h':
printf("Usage: udevadm test OPTIONS <syspath>\n"
" --action=<string> set action string\n"
- " --help print this help text\n\n");
+ " --help\n\n");
exit(0);
default:
exit(1);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevadm-trigger.c new/udev-140/udev/udevadm-trigger.c
--- old/udev-139/udev/udevadm-trigger.c 2008-10-20 18:09:59.000000000 +0200
+++ new/udev-140/udev/udevadm-trigger.c 2009-03-07 02:32:03.000000000 +0100
@@ -180,8 +180,7 @@
" --subsystem-nomatch=<subsystem> exclude devices from a matching subystem\n"
" --attr-match= trigger devices with a matching attribute\n"
" --attr-nomatch= exclude devices with a matching attribute\n"
- " --help print this text\n"
- "\n");
+ " --help\n\n");
goto exit;
default:
goto exit;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevadm.xml new/udev-140/udev/udevadm.xml
--- old/udev-139/udev/udevadm.xml 2009-01-16 21:32:25.000000000 +0100
+++ new/udev-140/udev/udevadm.xml 2009-03-07 02:22:39.000000000 +0100
@@ -225,6 +225,18 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--seq-start=<replaceable>seqnum</replaceable></option></term>
+ <listitem>
+ <para>Wait only for events after the given sequence number.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--seq-end=<replaceable>seqnum</replaceable></option></term>
+ <listitem>
+ <para>Wait only for events before the given sequence number.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--quiet</option></term>
<listitem>
<para>Do not print any output, like the remaining queue entries when reaching the timeout.</para>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udevd.c new/udev-140/udev/udevd.c
--- old/udev-139/udev/udevd.c 2009-02-24 15:05:51.000000000 +0100
+++ new/udev-140/udev/udevd.c 2009-03-12 13:00:56.000000000 +0100
@@ -1,6 +1,8 @@
/*
* Copyright (C) 2004-2008 Kay Sievers
* Copyright (C) 2004 Chris Friesen
+ * Copyright (C) 2009 Canonical Ltd.
+ * Copyright (C) 2009 Scott James Remnant
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,6 +71,7 @@
static volatile int udev_exit;
static volatile int reload_config;
static volatile int signal_received;
+static volatile pid_t settle_pid;
static int run_exec_q;
static int stop_exec_q;
static int max_childs;
@@ -513,6 +516,11 @@
info(udev, "udevd message (SET_MAX_CHILDS) received, max_childs=%i\n", i);
max_childs = i;
}
+
+ settle_pid = udev_ctrl_get_settle(ctrl_msg);
+ if (settle_pid > 0) {
+ info(udev, "udevd message (SETTLE) received\n");
+ }
udev_ctrl_msg_unref(ctrl_msg);
}
@@ -1023,6 +1031,11 @@
if (!stop_exec_q)
event_queue_manager(udev);
}
+
+ if (settle_pid > 0) {
+ kill(settle_pid, SIGUSR1);
+ settle_pid = 0;
+ }
}
cleanup_queue_dir(udev);
rc = 0;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udev-rules.c new/udev-140/udev/udev-rules.c
--- old/udev-139/udev/udev-rules.c 2009-02-25 11:15:34.000000000 +0100
+++ new/udev-140/udev/udev-rules.c 2009-03-03 17:27:00.000000000 +0100
@@ -363,7 +363,7 @@
token_str(type), operation_str(op), value, string_glob_str(glob), token->key.mode);
break;
case TK_A_INOTIFY_WATCH:
- dbg(rules->udev, "%s %u\n", token_str(type), token->key.i);
+ dbg(rules->udev, "%s %u\n", token_str(type), token->key.watch);
break;
case TK_A_NUM_FAKE_PART:
dbg(rules->udev, "%s %u\n", token_str(type), token->key.num_fake_part);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-139/udev/udev-watch.c new/udev-140/udev/udev-watch.c
--- old/udev-139/udev/udev-watch.c 2009-02-24 14:53:04.000000000 +0100
+++ new/udev-140/udev/udev-watch.c 2009-03-05 00:34:23.000000000 +0100
@@ -85,6 +85,7 @@
while ((ent = readdir(dir)) != NULL) {
char path[UTIL_PATH_SIZE];
char buf[UTIL_PATH_SIZE];
+ ssize_t syslen;
ssize_t len;
struct udev_device *dev;
@@ -95,13 +96,13 @@
util_strlcat(path, "/", sizeof(path));
util_strlcat(path, ent->d_name, sizeof(path));
- len = readlink(path, buf, sizeof(buf));
- if (len <= 0) {
+ syslen = util_strlcpy(buf, udev_get_sys_path(udev), sizeof(buf));
+ len = readlink(path, &buf[syslen], sizeof(buf)-syslen);
+ if (len <= 0 || len >= (ssize_t)(sizeof(buf)-syslen)) {
unlink(path);
continue;
}
-
- buf[len] = '\0';
+ buf[syslen + len] = '\0';
dbg(udev, "old watch to '%s' found\n", buf);
dev = udev_device_new_from_syspath(udev, buf);
if (dev == NULL) {
@@ -142,7 +143,7 @@
snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd);
util_create_path(udev, filename);
unlink(filename);
- symlink(udev_device_get_syspath(dev), filename);
+ symlink(udev_device_get_devpath(dev), filename);
udev_device_set_watch_handle(dev, wd);
}
@@ -172,16 +173,17 @@
{
char filename[UTIL_PATH_SIZE];
char buf[UTIL_PATH_SIZE];
+ ssize_t syslen;
ssize_t len;
if (inotify_fd < 0 || wd < 0)
return NULL;
snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd);
- len = readlink(filename, buf, sizeof(buf));
- if (len > 0) {
- buf[len] = '\0';
-
+ syslen = util_strlcpy(buf, udev_get_sys_path(udev), sizeof(buf));
+ len = readlink(filename, &buf[syslen], sizeof(buf)-syslen);
+ if (len > 0 || len < (ssize_t)(sizeof(buf)-syslen)) {
+ buf[syslen + len] = '\0';
return udev_device_new_from_syspath(udev, buf);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org