================================
udev:source=063-0.1 (previous: 064-0.1)
cvc rdiff udev -1 /[EMAIL PROTECTED]:devel//[EMAIL PROTECTED]:desktop/063-0.1
================================
063-0.1 Ken VanDine ([EMAIL PROTECTED]) Mon Aug 1 15:16:00 2005
Back to 063 and merged
udev-063.tar.bz2: new
hotplug.rules: new
# do not call hotplug.d and dev.d for "drivers" and "module" events
SUBSYSTEM=="drivers", OPTIONS="last_rule"
SUBSYSTEM=="module", OPTIONS="last_rule"
# compatibility support for the obsolete hotplug.d and dev.d directories
ENV{UDEVD_EVENT}=="1", RUN+="/sbin/udev_run_hotplugd"
RUN+="/sbin/udev_run_devd"
udev-062-build.patch: new
--- udev-062/udevd.c.foo 2005-07-08 22:25:46.000000000 -0400
+++ udev-062/udevd.c 2005-07-08 22:26:00.000000000 -0400
@@ -38,6 +38,9 @@
#include <sys/un.h>
#include <sys/sysinfo.h>
#include <sys/stat.h>
+
+#define __u32 u_int32_t
+#define __u16 u_int16_t
#include <linux/netlink.h>
#include "list.h"
--- udev-062/Makefile.foo 2005-07-08 22:30:36.000000000 -0400
+++ udev-062/Makefile 2005-07-08 22:31:22.000000000 -0400
@@ -112,7 +112,7 @@
CFLAGS += -D_GNU_SOURCE
# use '-Os' optimization if available, else use -O2
-OPTFLAGS := $(call cc-supports, -Os, -O2)
+OPTFLAGS := $(RPM_OPT_FLAGS)
HEADERS = \
udev.h \
@@ -159,15 +159,9 @@
endif
# if DEBUG is enabled, then we do not strip or optimize
-ifeq ($(strip $(DEBUG)),true)
- CFLAGS += -O1 -g -DDEBUG
- LDFLAGS += -Wl
- STRIPCMD = /bin/true -Since_we_are_debugging
-else
- CFLAGS += $(OPTFLAGS) -fomit-frame-pointer
- LDFLAGS += -s -Wl
- STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
-endif
+CFLAGS += $(OPTFLAGS)
+LDFLAGS += -Wl
+STRIPCMD = /bin/true
# If we are using our version of klibc, then we need to build, link it, and
then
# link udev against it statically. Otherwise, use glibc and link dynamically.
--- udev-062/Makefile.ff 2005-07-08 22:32:07.000000000 -0400
+++ udev-062/Makefile 2005-07-08 22:33:28.000000000 -0400
@@ -185,13 +185,8 @@
LDFLAGS += -static
endif
-ifeq ($(strip $(V)),false)
- [EMAIL PROTECTED](PWD)/ccdv
- HOST_PROGS=ccdv
-else
- QUIET=
- HOST_PROGS=
-endif
+QUIET=
+HOST_PROGS=
# config files automatically generated
GEN_CONFIGS = $(LOCAL_CFG_DIR)/udev.conf
@@ -229,10 +224,6 @@
# header files automatically generated
GEN_HEADERS = udev_version.h
-ccdv:
- @echo "Building ccdv"
- @$(HOSTCC) -O1 ccdv.c -o ccdv
-
# Rules on how to create the generated header files
udev_version.h:
@echo "Creating udev_version.h"
firmware_helper.c: new
/*
* 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;
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:
close(fw_fd);
set_loading(devpath, -1);
log_err(fw_path, rc);
return rc;
}
udev.recipe: changed
Index: udev.recipe
====================================================================
contents(size sha1)
inode(mtime owner group)
--- udev.recipe /[EMAIL PROTECTED]:devel//[EMAIL PROTECTED]:desktop/064-0.1
+++ udev.recipe /[EMAIL PROTECTED]:devel//[EMAIL PROTECTED]:desktop/063-0.1
@@ -8,21 +8,20 @@
'bison:runtime', 'pam:devel' ]
name = 'udev'
- version = '064'
+ version = '063'
def setup(r):
- srpm =
'http://download.fedora.redhat.com/pub/fedora/linux/core/4/SRPMS/udev-058-1.src.rpm'
+ srpm =
'http://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/udev-063-3.src.rpm'
r.addArchive('ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%(name)s-%(version)s.tar.bz2')
# addons and extra features
+#XXX verify
r.addSource('udev.rules', rpm=srpm)
+ r.addSource('udev.conf', rpm=srpm)
r.addSource('pam_console.dev', rpm=srpm)
- r.addSource('udev.conf', rpm=srpm)
- r.addSource('ata_identify.c', rpm=srpm,
- dir='ata_identify/')
- r.addSource('ata_identify-Makefile', rpm=srpm,
- dir='ata_identify/', dest='Makefile')
+ r.addSource('MAKEDEV.dev', rpm=srpm)
+ r.addSource('hotplug.rules', rpm=srpm)
r.addSource('udev.get_persistent_device_name.sh', rpm=srpm)
r.addSource('udev.get_unique_hardware_path.sh', rpm=srpm)
r.addSource('udev.get_unique_drive_id.sh', rpm=srpm)
@@ -31,24 +30,28 @@
r.addSource('ide-media.sh', rpm=srpm)
r.addSource('dvb.sh', rpm=srpm)
r.addSource('start_udev', rpm=srpm)
+ r.addSource('udev.html', rpm=srpm)
r.addSource('udev.nodes', rpm=srpm)
r.addSource('udevpermconv.sh', rpm=srpm)
- r.addSource('MAKEDEV.dev', rpm=srpm)
+ r.addSource('firmware_helper.c', rpm=srpm)
+ r.addPatch('udev-062-build.patch', rpm=srpm)
r.addPatch('udev-039-scsi_id-tmp_dir.patch', rpm=srpm)
r.Replace('MAKEDEV -x', 'MAKEDEV', 'start_udev')
- r.Make('USE_KLIBC=false udevdir="/dev"')
+ r.Make('USE_KLIBC=false udevdir="/dev" EXTRAS="extras/scsi_id '
+ 'extras/chassis_id extras/ata_id extras/usb_id '
+ 'extras/run_directory" all')
r.MakeInstall()
-
- r.Make(subDir='ata_identify')
- r.MakeInstall(subDir='ata_identify')
r.Make("LIBDIR=%(libdir)s", subDir='pam_console_setowner')
+ r.Run('%(cc)s %(cflags)s -o firmware_helper firmware_helper.c')
+
+ r.Install('udev.rules', '%(sysconfdir)s/udev/rules.d/50-udev.rules')
+ r.Install('hotplug.rules', '%(sysconfdir)s/udev/rules.d/hotplug.rules')
r.Install('udev.conf', '%(sysconfdir)s/udev/')
- r.Install('udev.rules', '%(sysconfdir)s/udev/rules.d/50-udev.rules')
r.Install('udev.get_persistent_device_name.sh',
'%(essentialsbindir)s/', mode=0755)
r.Install('udev.get_unique_hardware_path.sh', '%(essentialsbindir)s/',
mode=0755)
r.Install('udev.get_unique_drive_id.sh', '%(essentialsbindir)s/',
mode=0755)
@@ -63,10 +66,7 @@
r.Install('pam_console.dev',
'%(sysconfdir)s/udev/scripts/pam_console.dev', mode=0755)
r.Symlink('%(sysconfdir)s/udev/scripts/pam_console.dev',
'%(sysconfdir)s/dev.d/default/05-pam_console.dev')
-
- r.Move('etc/dev.d/net/hotplug.dev', '%(sysconfdir)s/udev/scripts/')
- r.Symlink('%(sysconfdir)s/udev/scripts/hotplug.dev',
'%(sysconfdir)s/dev.d/net/')
-
+ r.Install('firmware_helper', '%(essentialbindir)s/')
r.Install('check-cdrom.sh',
'%(sysconfdir)s/udev/scripts/check-cdrom.sh', mode=0755)
r.Install('ide-media.sh', '%(sysconfdir)s/udev/scripts/ide-media.sh',
mode=0755)
r.Install('MAKEDEV.dev', '%(sysconfdir)s/udev/scripts/MAKEDEV.dev',
mode=0755)
udev.html: new
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Fedora Project, sponsored by Red Hat</title>
<base href="http://fedora.redhat.com/">
<meta http-equiv="Content-Type" content="text/html">
<link rel="stylesheet" type="text/css" media="print"
href="/css/print.css">
<style type="text/css" media="screen">
@import url("/css/layout.css");
@import url("/css/content.css");
@import url("/css/docbook.css");
</style>
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<link rel="shortcut icon" href="/images/favicon.ico">
<link rel="icon" href="/images/favicon.ico">
</head>
<body>
<!-- header BEGIN -->
<div id="fedora-header">
<div id="fedora-header-logo">
<a href="/"><img
src="/images/header-fedora_logo.png" alt="Fedora Project"></a>
</div>
<div id="fedora-header-items">
<span class="fedora-header-icon">
<a href="/download/"><img
src="/images/header-download.png" alt=" ">Download</a>
<a href="/projects/"><img
src="/images/header-projects.png" alt=" ">Projects</a>
<a href="/about/faq/"><img
src="/images/header-faq.png" alt=" ">FAQ</a></span>
</div>
</div>
<div id="fedora-nav"></div>
<!-- header END -->
<!-- leftside BEGIN -->
<div id="fedora-side-left">
<div id="fedora-side-nav-label">Site Navigation:</div> <ul
id="fedora-side-nav">
<li><a href="/">Home</a></li>
<li><a href="/download/">Download</a></li>
<li><a href="/docs/">Docs</a></li>
<li><a href="/projects/">Projects</a></li>
<li><a href="/participate/">Participate</a></li>
<li><a href="/about/">About</a></li>
</ul>
</div>
<!-- leftside END -->
<!-- content BEGIN -->
<div id="fedora-middle-two">
<div class="fedora-corner-tr"> </div>
<div class="fedora-corner-tl"> </div>
<div id="fedora-content">
<!-- content BEGIN -->
<h1>Udev on Fedora</h1>
<h2>by Harald Hoyer</h2>
<p>
This document tries to reveal the secrets of udev and how it
works on Fedora.
</p>
<p>
udev was developed by Greg Kroah-Hartman <[EMAIL
PROTECTED]> with much
help from Dan Stekloff <[EMAIL PROTECTED]>, Kay
Sievers <[EMAIL PROTECTED]>,
and many others.
</p>
<p>
The <a
href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html">udev
homepage</a> and the
Linux-hotplug-devel mailing list <a
href="https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel">https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel</a>
are the main development sources.
</p><p>
</p>
<h2>What Does Udev Do?</h2>
<p>
udev provides a dynamic device directory containing only the
files for
actually present devices. It creates or removes device node
files usually
located in the <tt class="filename">/dev/</tt> directory, or it
renames network interfaces.
</p><p>
As part of the hotplug subsystem, udev is executed if a
kernel device
is added or removed from the system. On device creation,
udev reads
the sysfs directory of the given device to collect device
attributes
like label, serial number or bus device number. These
attributes may
be used as keys to determine a unique name for the device.
udev maintains
a database for devices present on the system.
On device removal, udev queries its database for the name of
the device
file to be deleted.
</p><p>
udev gets called by hotplug, if a module is loaded, and a
device is added
or removed. udev looks in <tt class="filename">/sys/</tt>, if
the driver provides a "dev" file, which
contains the major and minor number for a device node to
communicate with
the driver. After looking in the udev rules (in the <tt
class="filename">/etc/udev/rules.d/</tt> directory), which
specify the device node filename and symlinks, a device node is
created
in <tt class="filename">/dev/</tt> with the permissions, which
are specified in <tt class="filename">/etc/udev/permissions.d/</tt>.
</p>
After device node creation, removal, or network device
renaming, udev
executes the programs in the directory tree under <tt
class="filename">/etc/dev.d/</tt>. The
name of a program must end with the <tt
class="filename">.dev</tt> suffix, to be recognized.
In addition to the hotplug environment variables, DEVNAME is
exported
to make the name of the created node or the name the network
device is
renamed to, available to the executed program. The programs
in every
directory are sorted in lexical order, while the
directories are
searched in the following order:
<ul>
<li><tt class="filename">/etc/dev.d/$(DEVNAME)/*.dev</tt></li>
<li><tt class="filename">/etc/dev.d/$(SUBSYSTEM)/*.dev</tt></li>
<li><tt class="filename">/etc/dev.d/default/*.dev</tt></li>
</ul>
<h2>How is Udev Integrated on Fedora?</h2>
<h3><tt class="command">initrd</tt> / <tt
class="command">initfs</tt></h3>
<p>
<tt class="command">mkinitrd</tt> copies <tt
class="filename">/sbin/udev.static</tt>
to the <tt class="command">initrd</tt> <tt
class="filename">/sbin/udev</tt> and symlinks it to
<tt class="filename">/sbin/udevstart</tt>.
</p><p>
After the kernel boots, it executes the nash script of the <tt
class="command">initrd</tt>. This
mounts a tmpfs filesystem on <tt class="filename">/dev/</tt>. Instead of
hotplug <tt class="command">/sbin/udev</tt> is
called in the <tt class="command">initrd</tt> phase. udevstart creates all
device nodes for the
devices, which are compiled in the kernel and for the modules, which
are loaded by nash. </p>
<h4>Problems</h4>
The whole udev and hotplug infrastructure is
not available in <tt class="command">initrd</tt>. Thus no hotplug scripts, udev
rules, and
permissions and no <tt class="filename">/etc/dev.d/</tt> scripts are executed
for any hotplug
event, which is sent from the kernel.
<h3><tt class="filename">rc.sysinit</tt></h3>
<p> First, if SELinux is loaded and enabled,
the context of <tt class="filename">/dev/</tt> is set. <tt
class="filename">rc.sysinit</tt> calls <tt
class="filename">/sbin/start_udev</tt>.
<tt class="filename">start_udev</tt> mounts a tmpfs filesystem on <tt
class="filename">/dev/</tt>, if there is none already
mounted. Then it creates some device nodes, which need module
autoloading, or where there is no kernel module. After that
<tt class="command">/sbin/udevstart</tt> is called again, which simulates the
hotplug events in
the <tt class="command">initrd</tt> phase, to apply the whole udev rules and
permissions. After
that <tt class="filename">rc.sysinit</tt> parses the ouput of <tt
class="filename">/sbin/kmodule</tt> and loads every
module. This should provide device nodes for all hardware found on your
computer. </p>
<h3>Console User Permissions</h3>
<p>
<tt class="filename">/etc/dev.d/default/pam_console.dev</tt> is called whenever
a device node is
created and calls <tt class="filename">/sbin/pam_console_setowner</tt> with the
filename (and an
optional symlink) of the device node. This sets the permissions for
console users like specified in <tt
class="filename">/etc/security/console.perms</tt>. </p>
<h2>Customizing Udev on Fedora</h2>
<p>
Read the manpage of udev and udevinfo.
Please try not to modify the files of RPM packages.
</p>
<h3>New Rules</h3>
<p>
New rules should be placed in a file, which ends in <tt
class="filename">.rules</tt> in
<tt class="filename">/etc/udev/rules.d/</tt>. Please do not use <tt
class="filename">50-udev.rules</tt>. The supported and
preferred way is to create rules without the "NAME" tag and only
create "SYMLINK"s. </p><p>
A nice document describing how to write rules can be found on
<a
href="http://www.reactivated.net/udevrules.php">http://www.reactivated.net/udevrules.php</a>.
</p>
<h3>Permissions</h3>
New permissions should be placed in a file, which ends in
<tt class="filename">.permissions</tt> in <tt
class="filename">/etc/udev/permissions.d/</tt>. Please do not use
<tt class="filename">50-udev.permissions</tt>.
<h3>But I Really Want My Device Node!</h3>
<p>
Put them in <tt class="filename">/etc/udev/devices/</tt>, and
they will get copied to <tt class="filename">/dev/</tt>. <a
href="https://bugzilla.redhat.com/bugzilla">File a bugzilla entry</a>, if you
think that should be done per default.
</p>
<h2>Updating to udev Without <tt
class="filename">/dev/</tt></h2>
<p>
The steps to upgrade without Anaconda or a rescue CD are (NOT
recommended):
</p>
<ul>
<li>start from a kernel-2.6
</li><li>Make sure <tt class="filename">/sys/</tt> is mounted
</li><li>Install the latest <tt
class="filename">initscripts</tt> package
</li><li>Install the latest <tt class="filename">udev</tt>
package
</li><li>Execute <tt class="command">/sbin/start_udev</tt>
</li><li>Install the latest <tt class="filename">mkinitrd</tt>
package
</li><li>Install the latest <tt class="filename">kernel</tt>
package
</li><li>Or execute <tt class="command">mkinitrd</tt> for your
existing kernel(s)
</li></ul>
<h2>Udev without <tt class="command">initrd</tt></h2>
<p>Install Fedore Core as usual and reboot. Execute the
following commands
</p>
<pre class="screen">
<tt class="command">
mkdir /tmp/dev
mount --move /dev /tmp/dev
sbin/MAKEDEV null console zero
mount --move /tmp/dev /dev
</tt></pre>
Install your kernel without an <tt class="command">initrd</tt>.
Reboot.
<p>
You will get some SELinux errors, and syslogd will not work as
expected.
</p>
<h2>Current Problems on Fedora</h2>
<p>
<a
href="http://bugzilla.redhat.com/bugzilla/buglist.cgi?short_desc_type=allwordssubstr&component=udev&bug_status=ASSIGNED&bug_status=MODIFIED&bug_status=NEEDINFO&bug_status=NEW&bug_status=REOPENED&bug_status=VERIFIED&bug_severity=high&bug_severity=low&bug_severity=normal&bug_severity=security&bug_severity=translation&long_desc_type=allwordssubstr&bug_file_loc_type=allwordssubstr&status_whiteboard_type=allwordssubstr&fixed_in_type=allwordssubstr&devel_whiteboard_type=allwordssubstr&keywords_type=allwords&cust_facing=YES&emailassigned_to1=1&emailtype1=exact&emailreporter2=1&emailtype2=exact&bugidtype=include&chfieldto=Now&cmdtype=doit&remaction=run&namedcmd=blank&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop">All
open bugs for <code class="filename">udev</code></a>
</p>
<h3>Nvidia</h3>
<p>Quick solution: If you do not need rhgb, just load the
nvidia module in <tt class="filename">/etc/rc.local</tt>
</p><p>
If you have udev >= 032-5, load the nvidia module:
</p>
<pre class="screen">
<tt class="command">
cp -a /dev/nvidia* /etc/udev/devices
chown root.root /etc/udev/devices/nvidia*
</tt></pre>
<p>The Bugzilla for this problem is <strike><a
href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=133900">133900</a></strike>.</p>
<h3>Palm Pilot</h3>
<p>
If you have udev >= 032-5, execute the command:
</p>
<pre class="screen">
<tt class="command">
ln -s ttyUSB1 /etc/udev/devices/pilot
</tt></pre>
<h3>ISDN</h3>
<p>
If you have udev >= 032-5:
</p>
<pre class="screen">
<tt class="command">
/sbin/MAKEDEV -d /etc/udev/devices isdn
</tt></pre>
</pre>
<!-- content END -->
</div>
<div class="fedora-corner-br"> </div>
<div class="fedora-corner-bl"> </div>
</div>
<!-- content END -->
<!-- footer BEGIN -->
<div id="fedora-footer">
Copyright © 2003-2004 Red Hat, Inc. All rights
reserved.
<br>The Fedora Project is not a supported product of
Red Hat, Inc.
<br><a href="/legal/">Legal</a> | <a
href="/about/trademarks/">Trademark Guidelines</a>
<br>
This page last modified at: 2004/10/16 02:25:17
<br>
</div>
<!-- footer END -->
</body>
</html>
ata_identify.c: removed
udev-064.tar.bz2: removed
ata_identify-Makefile: removed
Committed by: krv
_______________________________________________
Desktop-commits mailing list
[email protected]
http://lists.bizrace.com/mailman/listinfo/desktop-commits