Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify udev-rules application #3643

Merged
merged 1 commit into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ The scripts and commands below invoke `wget, git, add-apt-repository` which may
**Note** on graphic sub-system utilization:<br />
*glfw3*, *mesa* and *gtk* packages are required if you plan to build the SDK's OpenGl-enabled examples. The *librealsense* core library and a range of demos/tools are designed for headless environment deployment.

3. Install Intel Realsense permission scripts located in librealsense source directory:<br />
`sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/` <br />
`sudo udevadm control --reload-rules && udevadm trigger`
3. Run Intel Realsense permissions script located from librealsense root directory:<br />
`./scripts/setup_udev_rules.sh`
<br />

4. Build and apply patched kernel modules for: <br />
Expand Down
20 changes: 20 additions & 0 deletions scripts/setup_udev_rules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -e

echo "Setting-up permissions for RealSense devices"

exec 3>&2
exec 2> /dev/null
con_dev=$(ls /dev/video* | wc -l)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will find UVC but not T265. I can't thing of a generic way to have T265 boot/loaded devices other than explicit PID/VID

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also probably limit it to 8086 VID

exec 2>&3

if [ $con_dev -ne 0 ];
then
echo -e "\e[32m"
read -p "Remove all RealSense cameras attached. Hit any key when ready"
echo -e "\e[0m"
fi

sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger

echo "udev-rules successfully installed"