rcn-ee / repos

repos.rcn-ee.com
41 stars 30 forks source link

bb-customizations: overlap between generic-board-startup and /etc/udev/rules.d/*gpio*.rules #40

Open nahuel opened 6 years ago

nahuel commented 6 years ago

The /etc/udev/rules.d/*gpio*.rules files changes the owner/group of the gpio device files to root:gpio, but this is also done in /opt/scripts/boot/generic-startup.sh so there seems to be a redundancy here. Also a race condition between udev and generic-statup.sh will manifest if you add your own udev rules files to set the gpio device files owner/group to be run after the bb-customizations ones with another user/group, breaking what you expect from an udev based system. Probably it will be better to remove the chown's from generic-startup.sh

Besides this, I think the *.rules files must use RUN+= instead of PROGRAM= to call chown.

turmary commented 5 years ago

I have also a confusion about /etc/udev/rules.d/*gpio*.rules They slow down the Debian system startup speed, take extra time more than a miniute.

RobertCNelson commented 5 years ago

@turmary do you have any hints/patches for speed up?

turmary commented 5 years ago

Yes, I have a patch which tested on PocketBeagle Linux v4.9.X. Instead of travesing /sys/devices/platform/ocp/ocp\:*pinmux by chown/chmod, it only traverse specific /sys/devices/platform/ocp/ocp\:XXX_pinmux path each time the udev rule executing. etc_udev_rules_d.patch.txt

It will speed up the startup one minute time approximately.

I also noticed that keywords OWNER/GROUP/MODE in rules file doesn't take effect.

amilcarlucas commented 4 years ago

@turmary can you do a github pull request against current master?

RobertCNelson commented 4 years ago

@amilcarlucas gpio permissions are no longer done in generic-startup.sh, it should all be taken by the udev rules:

https://github.com/beagleboard/customizations/tree/master/etc/udev/rules.d

Regards,