[oe] invalidating udev cache, how?

Koen Kooi k.kooi at student.utwente.nl
Thu Dec 4 17:03:02 UTC 2008


On 04-12-08 17:35, Thomas Kunze wrote:
> Koen Kooi schrieb:
>> Hi,
>>
>> The udev 124 has cache (/etc/dev.tar) to avoid doing the coldplug udev
>> dance that can take a few seconds to a minute depending on machine
>> speed and kernel options. It is working a bit too well at the moment:
>>
>> * user boots image with 2.6.26 kernel on an omap board
>> * user gets /dev/fb0
>> * user fixes the bootargs in uboot to enable the overlay
>> * user doesn't get /dev/fb1
>>
>> so remove /etc/dev.tar and reboot: /dev/fb1 appears.
>>
>> I also encountered a case where the permissions on /dev/null where
>> wrong during first boot (it's a mystery why that happened) and udev
>> cached those making ssh daemons fail on boot.
>>
>> My current ideas:
>>
>> 1) remove /etc/dev.tar if its > x weeks old
>> 2) recreate it on shutdown
>> 3) remove it after x times
>>
>> option 1) breaks on systems without an RTC and/or no /etc/timestamp
>> option 2) moves the slowness to shutdown
>> option 3) requires extra logic and filesystem access
>>
>> and all options don't fix the first case I mentioned, they all take a
>> while to make /dev/fb1 appear.
>>
>> The key is that it should be transparent to users, so adding a check
>> for .e.g 'ignore_dev.tar=1' in bootargs wouldn't work, since that
>> implies that users are aware of the problem and know how to 'fix' it.
>>
>> Does anyone have other ways to invalidate the cache, and if not, which
>> option would get your vote?
> I don't think it should be invalidated automagically. Problems only
> happen if some bootloader args are changed, don't they? In this case its
> ok to let the user unvalidate the cache. (A user who changes bootloader
> arguments should be able to do this. )
> But maybe we should add a message to udev script like:
> udev: no coldplugging, using /etc/udev.tar as cache
> to make it more obvious that udev uses a cache.

Bootloader args, kernel updates and even changing a powersupply or usb 
hub can change the dev nodes, so putting the burden on the (usually 
unsuspecting) user is not an option. Or imagine things like the BUG 
where coldplugging your modules won't work, only hot-plugging.

regards,

Koen









More information about the Openembedded-devel mailing list