Commit graph

1024 commits

Author SHA1 Message Date
kay.sievers@vrfy.org b608ade8e4 [PATCH] first stupid try for a rule compose gui
On Mon, Mar 15, 2004 at 09:28:17PM +0100, Kay Sievers wrote:
> Here is a first simple and pretty stupid try to make a simple tool for
> composing of a udev rule.
>
> It reads the udevdb to get all currently handled devices and presents a
> list, where you can choose the device to compose the rule for.
>
> The composed rule is just printed out in a window, nothing else by now.
>
> Do we want something like this?
> Nevermind, I always wanted to know, how this newt thing works :)

Here is the next step, I still can't sleep and there are to many patches
pending to make something useful :)
Cause nobody wanted to play with me, I've made a screenshot.
The device list is sorted in alphabetical order now and if there are only
a few recently discovered devices, they are placed on top of the list.

For those who want to have a look:

  http://vrfy.org/projects/udev/udevruler.png

The patch applies on top of today's mmap() patch. The db format is
changed to have the file and line number of the applied rule. So it
should be easy to edit the matching rule with this beast. It compiles
with "make all udevruler".
2005-04-26 21:35:10 -07:00
greg@kroah.com 166612d79d [PATCH] add a question/answer about automounting usb devices to the FAQ.
Thanks to bert hubert <ahu@ds9a.nl> for the text.
2005-04-26 21:35:10 -07:00
rgooch@ras.ucalgary.ca c641a99c6f [PATCH] SCSI logical and physical names for udev
Hi, Greg. Appended is scsi-devfs.sh, a script for udev to implement
devfs-style names for SCSI hard discs, CD-ROM's and generic devices.
This has been tested with both hard discs and CD-ROM's. The SCSI
generic support should be OK for when there is sysfs/udev support for
SCSI generic devices. SCSI tapes are not yet implemented because I
don't have one to test with.

In addition, this script supports physical names, based on PCI bus
location, both longhand (/udev/bus/pci/...) and shorthand
(/udev/sd/pci/*).
2005-04-26 21:35:10 -07:00
greg@kroah.com e4c8910800 [PATCH] Increase the name size as requested by Richard Gooch <rgooch@ras.ucalgary.ca> 2005-04-26 21:35:10 -07:00
greg@kroah.com 30ccd6a3e1 [PATCH] fix udevtest to build properly after the big udev_lib change. 2005-04-26 21:35:10 -07:00
kay.sievers@vrfy.org c81b35c08b [PATCH] replace fgets() with mmap() and introduce udev_lib.[hc]
Here we replace the various fgets() with a mmap() call for the config
file reading, due to the reported performance problems with klibc.

Thanks to Patrick's testing, it makes a very small, close to nothing
speed gain for libc users, but a 6 times speed increase for klibc users
with a 1000 line config file.

I've created a udev_lib.[hc] for this and also moved all the generic
stuff from udev.h in there and uninlined the functions.
2005-04-26 21:35:10 -07:00
tytso@mit.edu c58286656e [PATCH] Trivial man page typo fixes to udev
Fix minor man page typo's.
2005-04-26 21:35:10 -07:00
kay.sievers@vrfy.org 8a0acf85f2 [PATCH] make udevtest a real program :)
Here are the missing pieces for udevtest. A simple man page is added,
the blacklist is removed, cause it can't work without having a subsystem.
The Makefile removes all manpages now with a uninstall and installs
udevtest in /usr/bin/.
Any old version from /sbin/ should be deleted by hand.

The only expected argument is the sysfs devpath, here I changed it to be
more tolerant to the input. The path may now be specified with or
without a leading slash and optionally with the /sys moutpoint prepended.

I hope this will end the confusion about the use of this program :)
2005-04-26 21:35:10 -07:00
greg@kroah.com b99c85e440 [PATCH] 022 release 2005-04-26 21:35:10 -07:00
olh@suse.de 2761f9b951 [PATCH] make spotless
klibc has a target make spotless, this patch makes it possible to clean
the whole udev tree and start from scratch.
2005-04-26 21:35:10 -07:00
async@cc.gatech.edu b1224bc0da [PATCH] fix HOWTO-udev_for_dev for udevdir 2005-04-26 21:35:10 -07:00
kay.sievers@vrfy.org c013b034ae [PATCH] udev-test.pl cleanup
Here is a small name change, so all expected values are named exp_*
2005-04-26 21:35:10 -07:00
greg@kroah.com 7d12d4e175 [PATCH] add big major tests to udev-test.pl 2005-04-26 21:35:09 -07:00
greg@kroah.com a5e8d2b4a3 [PATCH] add a test for a minor over 255 2005-04-26 21:35:09 -07:00
greg@kroah.com 7ddb6f47d7 [PATCH] udev-test.pl: print out major:minor and perm test "ok" if is ok. 2005-04-26 21:35:09 -07:00
greg@kroah.com b9a88fe756 [PATCH] make perm and major:minor test errors be reported properly. 2005-04-26 21:35:09 -07:00
kay.sievers@vrfy.org fa19f1811c [PATCH] add dev node test to udev-test.pl
> Nice, that's a good start.  Now we need to check the major:minor values
> too somehow...

I better do it immediately, before you put it in the empty TODO :)

Patch is a bit big, cause spaces are changed to tabs to get
space for the longer names.
2005-04-26 21:35:09 -07:00
greg@kroah.com 2731fd98c6 [PATCH] remove extra ; in namedev_parse.c
Thanks to Olaf Hering <olh@suse.de> for pointing this out.
2005-04-26 21:35:09 -07:00
olh@suse.de 60ea694525 [PATCH] udev* segfaults with new klibc
current klibc uses regparm on i386. This leads to nice segfaults in all
udev apps. Using the content of the just included MCONFIG file fixes it.
2005-04-26 21:35:09 -07:00
ken@cgi101.com 0c17d02da2 [PATCH] fix a type in docs/libsysfs.txt
Mary Edie Merideth noticed this typo. I think this is what it was supposed
to be. Judging by the pattern.
2005-04-26 21:35:09 -07:00
kay.sievers@vrfy.org c612a0acc8 [PATCH] add permission tests
> Any chance on being able to add a test for this kind of stuff to the
> udev-test.pl script?

Sure, not brilliant but seems to work :)
Only numeric id's are supported so far.
2005-04-26 21:35:09 -07:00
ananth@in.ibm.com 656703759d [PATCH] more Libsysfs updates
On Thu, Mar 11, 2004 at 02:36:23PM +0100, Kay Sievers wrote:
> On Thu, 2004-03-11 at 15:02, Ananth N Mavinakayanahalli wrote:
> > On Thu, Mar 11, 2004 at 02:04:36PM +0100, Kay Sievers wrote:
> > > On Thu, Mar 11, 2004 at 11:53:50AM +0500, Ananth N Mavinakayanahalli wrote:
> > >
> > > > +#define safestrcpy(to, from)	strncpy(to, from, sizeof(to)-1)
> > > > +#define safestrcat(to, from)	strncat(to, from, sizeof(to) - strlen(to)-1)
> > >
> > > These strings are not terminated with '\0' if from is longer than
> > > the sizeof to.
> >
> > Did not do it on purpose as the "to" elements are either calloc'd or memset to
> > '0' explicitly in the library. Thats the reason I mentioned "scaled down" :)
>
> Ahh, sounds good.
>
> > > > +#define safestrncpy(to, from, maxsize) \
> > > > +do { \
> > > > +	to[maxsize-1] = '\0'; \
> > > > +	strncpy(to, from, maxsize-1); \
> > > > +} while (0)
> > > > +
> > > > +#define safestrncat(to, from, maxsize) \
> > > > +do { \
> > > > +	to[maxsize-1] = '\0'; \
> > > > +	strncat(to, from, maxsize - strlen(to)-1); \
> > > > +} while (0)
> > >
> > > We all expect a similar behavior like strncat/strncpy according to the
> > > names, but these macros are limiting by the target size and do not limit
> > > the count of chars copied.
> > > This is confusing I think and suggest using a different name like
> > > 'safestrcopymax()' or something.
> >
> > Good point.. will make the change
>
> Nice. I've had these *n* names too and I forgot about the logic and only
> 10 days later I introduced a ugly bug cause I can't limit the count of
> copied chars :)

Inlined is the patch for this... applies on the earlier _BIG_ patch.
2005-04-26 21:35:09 -07:00
ananth@in.ibm.com d1fb871d99 [PATCH] Libsysfs updates
Please find attached a _BIG_ patch to update udev's libsysfs. Patch applies
on udev-021 and contains:

1. Updates to get udev's libsysfs to the latest (to be released) level.
2. Changes for C++ compatibility (use "char" and not "unsigned char"
	unless absolutely necessary).
3. More importantly, take care of buffer overflows. Libsysfs now uses a
        scaled down version of Kay's "safe" macros.

Tested using a usb-storage device.

I will send you a doc update shortly.
2005-04-26 21:35:09 -07:00
kay.sievers@vrfy.org 0a5417a0eb [PATCH] "symlink only" test
Here is a test for the "symlink only" rule.

Any reason to do the apply_format() inside the loop?
I've changed it.
2005-04-26 21:35:09 -07:00
kay.sievers@vrfy.org 558f80ba64 [PATCH] callout part selector tweak
Martin Schwenke <martin@meltin.net> asked for this feature and posted a
patch:

 The following patch almost let's me have the following configuration:

  PROGRAM="/sbin/aliaser %b %k %n %M %m", RESULT="?*", NAME="%c{1}", SYMLINK="%c{2+}"

 allowing me to specify an arbitrary number of symlinks by saying
 "giveme the second and later words"."


Here is the actual version with tests and a few words in the man page.
2005-04-26 21:35:09 -07:00
kay.sievers@vrfy.org 35b38379ba [PATCH] cleanup callout fork
Here I change the callout fork logic.
The current cersion is unable to read a pipe which is not flushed at once,
Now we read until it's closed.

The maximum argument count is calculated by the strlen now. We have 100
chars for our result buffer so we can't have more than 50 parameters.
So it's much more clear what will happen now and not some magic boundary
where we use shell behind it.

Parameter can be combined to one by using apostrophes.

this on works now:
  BUS="scsi", PROGRAM="/bin/sh -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed  s/foo9/bar9/'", KERNEL="sda3", NAME="%c{7}"

Two new test are also added.
2005-04-26 21:35:09 -07:00
greg@kroah.com a3b37a073d [PATCH] Added multipath-tools 0.1.1 release 2005-04-26 21:35:09 -07:00
greg@kroah.com 49f9acf384 [PATCH] deleted current extras/multipath directory 2005-04-26 21:35:09 -07:00
kay.sievers@vrfy.org e41016d354 [PATCH] allow to specify node permissions in the rule
This allows to set the permissions along with the rule.

This is not a general replacement for the permissions config, but it
may be easier sometimes for the user to specify the permissions along
with the rule, cause the permissions config file wants the final node
name to match, which seems sometimes a bit difficult to guess, if
format % chars are used in the NAME field.

Any value not given in the rule is still be read from the permissions
file or set to the default. This one will also work:

  BUS="usb", KERNEL="video*", NAME="my-%k", OWNER="$local"

A few words to man page are also added and add_perm_dev() is moved into
namedev_parse.c where it belongs to.
2005-04-26 21:35:09 -07:00
ken@cgi101.com 3e16482d25 [PATCH] Added line to udev.permissions.redhat
Added this line to have xterms provide a prompt.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org b86f56ff09 [PATCH] man page beauty
Thanks to Christian Gierke, he sent me a beauty patch for our man pages.
Some typos are fixed and a few word are clarified.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org 2bd07cf29b [PATCH] put symlink only rules to the man page
Here we mention the "symlink only - add it to another rule" feature
to the man page. Andrey, does this describe what you have implemented :)
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org 17794d77b9 [PATCH] rename strn*() macros to strmax
Hey, I wrote the strn*() macros just 10 days ago and yesterday this trap
caught me with the %c{x} bug.
The names are misleading cause we all expect that the from field is limited by
the size argument, but we actually limit the overall size of the destination
string to prevent a overflow.

Here we rename all strn*() macros to str*max(). That should be
more self-explanatory.
2005-04-26 21:35:08 -07:00
md@Linux.IT 3f20eac0a5 [PATCH] udevstart fixes
udevstart_no_retval: currently udevstart will always return rc=22
because of the error handling code. I completely removed it because it
is not used, and returning a generic error to the init script is not
much useful anyway.
2005-04-26 21:35:08 -07:00
ken@cgi101.com 824e601185 [PATCH] Include more examples in the docs area for gentoo and redhat
Here's a patch that puts the udev.rules and udev.permissions files in the
docs dir. This should help people out who install with just the rpm.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org d5f91372dd [PATCH] conditional remove of trailing sysfs whitespace
Hey, it may never happen, that one wants to distinguish attributes by
trailing spaces, but we should not lose the control over it, just for
being lazy :)

Here we remove the trailing spaces of the sysfs attribute only if the
configured value to match doesn't have any trailing spaces by itself.
So if you put a attribute in a rule with spaces at the end, the sysfs
attribute _must_ match exactly.

Is that cool for everyone?

As usual, 2 tests are added for it with a artificial sysfs file and
a few words to the man page.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org ebc39fefd5 [PATCH] clarify udevinfo text
Make udevinfo attribute printing note so clear,
that's nearly impossible to misunderstand it in the future.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org ef672b3dc4 [PATCH] better fix for NAME="foo-%c{N}" gets a truncated name
On Wed, Mar 03, 2004 at 04:56:34PM -0800, Greg KH wrote:
> On Wed, Mar 03, 2004 at 03:57:04PM -0800, Patrick Mansfield wrote:
> >
> > Here is a patch for some new tests.
>
> Applied, thanks.

Here is a small improvement, which looks much better.

Hey Pat, thanks a lot for finding the recent bug, hope this one will
not break it again :)
2005-04-26 21:35:08 -07:00
hannal@us.ibm.com a3fa7908e2 [PATCH] Small fix to remove extra "will" in man page
remove extraneous word.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org d00bd1724b [PATCH] overall trivial trivial cleanup
Here I try to make the style a bit more consistant in the different
files, so that new patches just copy the 'right' one :)

Some "magic" numbers are replaced and udevtest.c is catched up with udev.
2005-04-26 21:35:08 -07:00
patmans@us.ibm.com 56c963dc4d [PATCH] add tests for NAME="foo-%c{N}"
Here is a patch for some new tests.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org 27c3403dd8 [PATCH] fix NAME="foo-%c{N}" gets a truncated name
On Wed, Mar 03, 2004 at 02:43:34PM -0800, Patrick Mansfield wrote:
> Here is a fix and a new test for the problem Atul hit, where if we have a
> NAME based on a result of the form:
>
> 	NAME="foo-%c{7}"
>
> udev truncates the name. Without any prefix (the foo- in this example),
> the rule was working OK.

Here is a fix for the fix :)

Sorry, I broke it yesterday.
2005-04-26 21:35:08 -07:00
greg@kroah.com e4f9c4a46d [PATCH] 021_bk mark 2005-04-26 21:35:08 -07:00
greg@kroah.com 5895eb31fe [PATCH] fix the build for older versions of gcc 2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org 9fe3f9a938 [PATCH] cleanup mult field string handling
Here I try to cleanup our various multifield iteration over the strings.
Inspired by our nice list.h we now have a macro to iterate over the string
and process the parts of it:
It makes the code more readable and we don't change the string while we
process it like the former strsep() does.

Example:

  foreach_strpart(dev->symlink, " ", pos, len) {
  	if (strncmp(&dev->symlink[pos], find_name, len) != 0)
  		continue;

  	...
  }

For the callout part selector %c{2} we separate now not only by space but
also newline and return characters, cause some programs may give multiline
values back. A possible RESULT match must contain wildcards for these
characters.

Also a bug in the recent udevinfo symlink query feature is fixed.
2005-04-26 21:35:08 -07:00
greg@kroah.com 88ed4bbe56 [PATCH] 021 release 2005-04-26 21:35:08 -07:00
greg@kroah.com 0d1956de0e [PATCH] fix udev.spec to find udevinfo now that it has moved to /usr/bin 2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org e56f005817 [PATCH] install udevinfo in /usr/bin
Here we rename the former tiny $(HELPER) to $(INFO)
cause it's no longer only a helper :)
And install it in /usr/bin instead of /sbin cause any user
may want to call it and we don't need it on startup.
2005-04-26 21:35:07 -07:00
kay.sievers@vrfy.org e9f504e8d8 [PATCH] blacklist pcmcia_socket
Is this something for the blacklist?

/sys/class/pcmcia_socket/
|-- pcmcia_socket0
|   |-- device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:02:00.0
|   `-- driver -> ../../../bus/pci/drivers/yenta_cardbus
`-- pcmcia_socket1
    |-- device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:02:00.1
        `-- driver -> ../../../bus/pci/drivers/yenta_cardbus
2005-04-26 21:35:07 -07:00
greg@kroah.com dfe421a965 [PATCH] Fix another problem with Makefile installing initscript 2005-04-26 21:35:07 -07:00