Age | Commit message (Collapse) | Author |
|
Based on a patch from Daniel J Walsh <dwalsh@redhat.com>
|
|
Should get rid of some more error reports of libsysfs header issues.
|
|
If we go over our internal limit of 7, then we call out to /bin/sh
otherwise we handle it ourself without relying on a shell.
|
|
Mainly a cleanup of the earlier patches with a few missing pieces
and some cosmetical changes.
I've moved the udev_init_config() to very early init, otherwise we
don't get any logging for the processing of the input. What would I
do without gdb :)
Greg, it's the 7th patch in your box to apply. I will stop now and
wait for you :)
|
|
Here we truncate our input strings from the environment to our
defined limit. It's a bit theroretical but better check for it.
It cleans up some magic length definitions and removes the code
duplication in udev, udevtest and udevsend.
udevd needs to be killed after installation, cause the message size
is changed with this patch.
Should we do this with the 'make install', like we do with the '.udevdb'?
|
|
As promised, here is the next round. We provide in addition to the
already used macros:
strfieldcpy(to, from)
strfieldcat(to, from)
the corresponding friends, if the size of the target is not known and
must be provided by the caller:
strnfieldcpy(to, from, maxsize)
strnfieldcat(to, from, maxsize)
and switch nearly all possibly unsafe users of strcat(), strncat(),
strcpy() and strncpy() to these safer macros.
The last known remaining issue seems the use of sprintf() and
snprintf(). I will take on it later today or tomorrow.
|
|
Hey it's not longer the "goal" to provide a dynamic dev directory,
we have just arrived. So I change it to more self-confident words :)
I've also added the completly missing environment variables to the
man pages.
To stop the misuse of the PROGRAM= call paramenters, we better mention
its limitations.
|
|
On Tue, Feb 24, 2004 at 11:50:52PM +0100, Kay Sievers wrote:
> Here is the first step towards a safer string handling.
> More will follow, but for now only the easy ones :)
>
> Thanks to all who pointed this out. strncat() isn't a nice function. We
> all should remember that the destination string is not terminated if the
> given lenght is shorter than the strlen of the source string.
>
> And shame on the various implementers of strfieldcat() I found in the
> unapplied patches on this list, it's not really better than strncpy()
> and hides the real problem.
Hmm, bk didn't checked in one file, maybe I edited it again as root.
Nevermind, here is the more complete version.
|
|
Nice, here is the corresponding man update which also removes the
mention of the limitation of getgrname() and friends with klibc.
|
|
|
|
I was on the train for 5 hours today and the TODO is almost empty :)
So, at least four people wanted this feature, then here is a actual
working patch.
We may specify now in udev.conf:
udev_rules="/etc/udev/"
and udev will scan the whole directory for files ending with *.rules,
sort it in lexical order and create our rule list from all of the files.
A plain given file will still work and the same applies to the *.permissions.
I sort the files in our usual linked list, cause klibc has no scandir().
|
|
Here we get a very dumb getpwnam() and getgrnam() for klibc to
stop the confusion of not handling textual id's if klibc is used.
If used with initrd we just need to copy the /etc/passwd and /etc/group
file and all should work well.
|
|
external one.
Should fix some more build bugs...
|
|
have sysfsutils installed already.
|
|
|
|
|
|
We want to be started by keventd, as that runs at a very fast priority.
|
|
|
|
|
|
|
|
These are very good devfs-like rules for others to use if they want to.
|
|
These are for examples only, not for everyone to use as they cause too
many problems for different people when they are in the main udev.rules
file.
|
|
|
|
|
|
|
|
|
|
Make TODO really small :)
|
|
Use the new location of libsysfs header files.
|
|
easier to use.
|
|
|
|
happy.
Actually, I'm happy to, startup time is much smaller...
|
|
priorities.
|
|
patch follows :
* remove the restrictive -f flag.
Introduce a more generic "-m iopolicy" one.
* remove useless "int with_sysfs" in env struct
|
|
I dualboot between 2.4.x and 2.6.x right now, and although I
want udev to start up when 2.6 is booting, I don't want it to try when
2.4.x is booting.
This is a small patch to not start up udev if sysfs is not
mounted.
|
|
Add the new %s{filename} to the udev man page.
And add the automatic start of udevd to the udevd man page.
|
|
Thanks to Gentoo for the list of these files.
|
|
Here is the missing man page for udevd/udevsend.
|
|
|
|
Here we change the magic callout part number selector to the new
atribute syntax. The syntax to select the second part of the callout string:
'%2c' is now '%c{2}'
I think it's more clear and we no longer misuse the length argument.
The old syntax is still supported, but we should remove it some
time in the future.
|
|
Here we switch the configs and man pages to the new attribute syntax.
Also the 'partition trick' is mentioned in udev.8
I think it's more clear visible now, that inside the brackets are user
supplied values used and not some magic keys handled:
'SYSFS_dev' is now 'SYSFS{dev}'
The old syntax is still supported.
|
|
|
|
|
|
Patch against current udev bk to add a few ID rule tests.
|
|
|
|
Here is the first try to create all partitons of a blockdevice, since
removable media devices may need to acces the expected partition to
revalidate the media.
It uses the attribute syntax introduced with the last %s{file} patch.
I'm using this with my multi-slot-flash-card-reader:
SYSFS{model}="USB Storage-SMC ", NAME{all_partitions}="smartmedia"
SYSFS{model}="USB Storage-CFC ", NAME{all_partitions}="compactflash"
SYSFS{model}="USB Storage-MSC ", NAME{all_partitions}="memorystick"
SYSFS{model}="USB Storage-MMC ", NAME{all_partitions}="multimedia"
and I get:
tree /udev/
/udev/
|-- memorystick
|-- memorystick1
|-- memorystick10
|-- memorystick11
|-- memorystick12
|-- memorystick13
|-- memorystick14
|-- memorystick15
|-- memorystick2
|-- memorystick3
|-- memorystick4
|-- memorystick5
|-- memorystick6
|-- memorystick7
|-- memorystick8
|-- memorystick9
|-- multimedia
|-- multimedia1
|-- multimedia10
|-- multimedia11
|-- multimedia12
|-- multimedia13
|-- multimedia14
|-- multimedia15
|-- multimedia2
|-- multimedia3
|-- multimedia4
|-- multimedia5
|-- multimedia6
|-- multimedia7
|-- multimedia8
|-- multimedia9
...
If needed, we can make the number of partions to create
adjustable with the attribute?
|
|
On Sun, Feb 15, 2004 at 03:36:00AM +0100, Kay Sievers wrote:
>
> Since we have %s{file} it may be nice to allow SYSFS{file}.
> This patch allows:
>
> BUS="usb", SYSFS{idProduct}="a511", NAME="video%n"
>
> compared to the current:
>
> BUS="usb", SYSFS_idProduct="a511", NAME="video%n"
>
> The curent syntax is still supported.
> Looks a bit nicer and less hackish, I think.
Better patch with infrastructure to easily implement KEY{attribute}
for every other key. The first user is the SYSFS{file} key.
Both versions, brackets or underscore is supported for the attribute.
|
|
On Thu, Feb 12, 2004 at 05:34:57PM -0800, Greg KH wrote:
> On Tue, Feb 10, 2004 at 09:14:20AM +0100, Hannes Reinecke wrote:
> > Hi all,
> >
> > this patch makes the format for NAME and SYMLINK a bit more flexible:
> > I've added a new format specifier '%s{<SYSFS_var>}', which allows for
> > the value of any sysfs entry found for this device to be inserted.
> > Example (for our S/390 fcp adapter):
> >
> > BUS="ccw", SYSFS_devtype="1732/03", NAME="%k" \
> > SYMLINK="zfcp-%s{hba_id}-%s{wwpn}:%s{fcp_lun}"
> >
> > I know this could also be done with an external program, but having this
> > incorporated into udev makes life easier, especially if run from
> > initramfs. Plus it makes the rules easier to follow, as the result is
> > directly visible and need not to be looked up in some external program.
> >
> > Comments etc. welcome.
>
> Oops, sorry I missed this for the 017 release. I'll look at it tomorrow
> and get back to you. At first glance it looks like a good thing.
>
> Oh, you forgot to update the documentation, that's important to do if
> you want this change to make it in :)
I took a part of the code and made a version that uses already implemented
attribute finding logic.
The parsing of the format length '%3x' and the '%x{attribute}' is a fuction now,
maybe there are more possible users in the future.
I've also added the test to udev-test.pl.
|
|
suggested changes.
|
|
|
|
|