ros-drivers / pointgrey_camera_driver

ROS driver for Pt. Grey cameras, based on the official FlyCapture2 SDK.
128 stars 180 forks source link

Better udev handling #2

Closed mikepurvis closed 9 years ago

mikepurvis commented 10 years ago

Right now this is manual:

sudo udevadm control --reload-rules
sudo udevadm trigger

Normally one would use dh_installudev, but since we don't have the ability to modify debian/rules from the bloom default, it may be simpler to just place these in a debian/postinst script.

Related QA link: http://answers.ros.org/question/133966/install-directly-to-etcudevrulesd/

mikepurvis commented 10 years ago

Also: In general, the business of installing a rule file directly to /etc/udev is bad news bears. Some of the alternatives are discussed briefly here:

http://answers.ros.org/question/133966/install-directly-to-etcudevrulesd/

mikepurvis commented 10 years ago

The correct way to handle this is using the udev debhelper, dh_installudev.

However, I believe the only way to do this at present is by using bloom's patching facility to slip it into the release repo after the main template generation has taken place, eg:

https://github.com/ros-drivers-gbp/pointgrey_camera_driver-release/blob/debian/indigo/pointgrey_camera_driver/debian/rules.em

This is possible, just needs some time to investigate.

cottsay commented 9 years ago

@mikepurvis, I see two issues from the Fedora side of things right now related to this. It looks like you've got the latest bloom, and are generating your package for Fedora. Kudos for that!

The fist issue is that any files that are installed to the system outside of /opt/ros/<distro> have to be explicitly listed in the RPM spec file. To fix this, you'll need to use a bloom patch to the rpm/<distro>/pointgrey_camera_driver repo like I have done to a fork of your release repo: https://github.com/smd-ros-rpm-release/pointgrey_camera_driver-release/commit/2fc96291202738da3e502d078ff57406de2001f8 You'll need to do this for Hydro and Indigo, but before you do that, please solve the next issue.

The second issue is that the same udev rule is installed to the same location on Hydro and Indigo, forming a file conflict and making it impossible to install the Hydro and Indigo versions of this package simultaneously. The simple solution is to find a way to make the name of the udev rule unique to the rosdistro. This is done in other packages.

mikepurvis commented 9 years ago

@cottsay, I've removed the outside-install now— dh_installudev is able to pick up the rules from inside the debian folder, so they should no longer impact the RPM.

I believe that resolves the issue.