Mailinglist Archive: opensuse-commit (1187 mails)

< Previous Next >
commit udev
  • From: root@xxxxxxx (h_root)
  • Date: Tue, 25 Apr 2006 21:56:26 +0200 (CEST)
  • Message-id: <20060425195626.8F3D68C46E@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package udev
checked in at Tue Apr 25 21:56:26 CEST 2006.

--------
--- udev/udev.changes 2006-04-21 19:57:42.000000000 +0200
+++ STABLE/udev/udev.changes 2006-04-25 17:38:22.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Apr 24 19:38:59 CEST 2006 - kay.sievers@xxxxxxx
+
+- export initial seqnum from udevd (#169064)
+- fix wrong use of "==" and "=" - future udev versions will fail here
+
+-------------------------------------------------------------------

New:
----
udev-initial-seqnum-01.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ udev.spec ++++++
--- /var/tmp/diff_new_pack.0E48Gv/_old 2006-04-25 21:56:14.000000000 +0200
+++ /var/tmp/diff_new_pack.0E48Gv/_new 2006-04-25 21:56:14.000000000 +0200
@@ -13,7 +13,7 @@
Name: udev
URL: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/
Version: 085
-Release: 20
+Release: 22
License: GPL
Group: System/Kernel
Summary: A rule based device node and kernel event manager
@@ -28,6 +28,7 @@
Patch4: allow-comma-01.patch
Patch5: udev-export-seqnum-02.patch
Patch6: udevtrigger-fix-order-01.patch
+Patch7: udev-initial-seqnum-01.patch
#
Source1: path_id
#
@@ -74,6 +75,7 @@
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%patch7 -p1

%build
make V=1 EXTRAS=%{extras} STRIPCMD= OPTFLAGS="${RPM_OPT_FLAGS}" all
@@ -226,6 +228,9 @@
%attr(600,root,root) %dev(c,10,200) /lib/udev/devices/fwmonitor

%changelog -n udev
+* Mon Apr 24 2006 - kay.sievers@xxxxxxx
+- export initial seqnum from udevd (#169064)
+- fix wrong use of "==" and "=" - future udev versions will fail here
* Fri Apr 21 2006 - kay.sievers@xxxxxxx
- fix silly typo in dm persistent rules (#163073)
- adapt path_id for SAS devices (#164085)


++++++ 50-udev-default.rules ++++++
--- udev/50-udev-default.rules 2006-04-07 16:53:11.000000000 +0200
+++ STABLE/udev/50-udev-default.rules 2006-04-24 19:22:49.000000000 +0200
@@ -113,8 +113,8 @@
# sd: 0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
# sr: 4 TYPE_WORM, 5 TYPE_ROM
# st/osst: 1 TYPE_TAPE
-ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="0|7|14", RUN+="/bin/sh -c 'echo 60 > /sys$$DEVPATH/timeout'"
-ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="1", RUN+="/bin/sh -c 'echo 900 > /sys$$DEVPATH/timeout'"
+ACTION=="add", SUBSYSTEM=="scsi" , SYSFS{type}=="0|7|14", RUN+="/bin/sh -c 'echo 60 > /sys$$DEVPATH/timeout'"
+ACTION=="add", SUBSYSTEM=="scsi" , SYSFS{type}=="1", RUN+="/bin/sh -c 'echo 900 > /sys$$DEVPATH/timeout'"
SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{type}=="0|7|14", RUN+="/sbin/modprobe sd_mod"
SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{type}=="1", SYSFS{vendor}=="On[sS]tream", RUN+="/sbin/modprobe osst"
SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{type}=="1", RUN+="/sbin/modprobe st"











++++++ udev-initial-seqnum-01.patch ++++++
diff --git a/udevd.c b/udevd.c
index b0c38eb..eb1080b 100644
--- a/udevd.c
+++ b/udevd.c
@@ -250,7 +250,7 @@ static void udev_event_run(struct uevent
/* child */
close(uevent_netlink_sock);
close(udevd_sock);
- if (inotify_fd > 0)
+ if (inotify_fd >= 0)
close(inotify_fd);
close(signal_pipe[READ_END]);
close(signal_pipe[WRITE_END]);
@@ -287,7 +287,7 @@ static void msg_queue_insert(struct ueve
strlcpy(filename, udev_root, sizeof(filename));
strlcat(filename, "/" EVENT_SEQNUM, sizeof(filename));
fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0644);
- if (fd > 0) {
+ if (fd >= 0) {
char str[32];
int len;

@@ -821,6 +821,33 @@ static int init_uevent_netlink_sock(void
return 0;
}

+static void export_initial_seqnum(void)
+{
+ char filename[PATH_SIZE];
+ int fd;
+ char seqnum[32];
+ ssize_t len = 0;
+
+ strlcpy(filename, sysfs_path, sizeof(filename));
+ strlcat(filename, "/kernel/uevent_seqnum", sizeof(filename));
+ fd = open(filename, O_RDONLY);
+ if (fd >= 0) {
+ len = read(fd, seqnum, sizeof(seqnum)-1);
+ close(fd);
+ }
+ if (len <= 0) {
+ strcpy(seqnum, "0\n");
+ len = 3;
+ }
+ strlcpy(filename, udev_root, sizeof(filename));
+ strlcat(filename, "/" EVENT_SEQNUM, sizeof(filename));
+ fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0644);
+ if (fd >= 0) {
+ write(fd, seqnum, len);
+ close(fd);
+ }
+}
+
int main(int argc, char *argv[], char *envp[])
{
int retval;
@@ -893,6 +920,8 @@ int main(int argc, char *argv[], char *e
sysfs_init();
udev_rules_init(&rules, 1);

+ export_initial_seqnum();
+
if (daemonize) {
pid_t pid;

@@ -1014,7 +1043,7 @@ int main(int argc, char *argv[], char *e
FD_SET(signal_pipe[READ_END], &readfds);
FD_SET(udevd_sock, &readfds);
FD_SET(uevent_netlink_sock, &readfds);
- if (inotify_fd > 0)
+ if (inotify_fd >= 0)
FD_SET(inotify_fd, &readfds);

fdcount = select(maxfd+1, &readfds, NULL, NULL, NULL);
@@ -1046,7 +1075,7 @@ int main(int argc, char *argv[], char *e
}

/* rules directory inotify watch */
- if ((inotify_fd > 0) && FD_ISSET(inotify_fd, &readfds)) {
+ if ((inotify_fd >= 0) && FD_ISSET(inotify_fd, &readfds)) {
int nbytes;

/* discard all possible events, we can just reload the config */
@@ -1089,16 +1118,16 @@ exit:
udev_rules_cleanup(&rules);
sysfs_cleanup();

- if (signal_pipe[READ_END] > 0)
+ if (signal_pipe[READ_END] >= 0)
close(signal_pipe[READ_END]);
- if (signal_pipe[WRITE_END] > 0)
+ if (signal_pipe[WRITE_END] >= 0)
close(signal_pipe[WRITE_END]);

- if (udevd_sock > 0)
+ if (udevd_sock >= 0)
close(udevd_sock);
- if (inotify_fd > 0)
+ if (inotify_fd >= 0)
close(inotify_fd);
- if (uevent_netlink_sock > 0)
+ if (uevent_netlink_sock >= 0)
close(uevent_netlink_sock);

logging_close();

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...


< Previous Next >