|
1 | 1 | #/bin/sh |
2 | 2 |
|
3 | | -# Gphoto2 2.5.5 compiler and installer script v0.3.1 |
| 3 | +# Gphoto2 2.5.5 compiler and installer script v0.4.1 |
4 | 4 | # |
5 | 5 | # This script is specifically created for Raspbian http://www.raspbian.org |
6 | 6 | # and Raspberry Pi http://www.raspberrypi.org but should work over any |
@@ -159,11 +159,37 @@ echo |
159 | 159 | ldconfig |
160 | 160 |
|
161 | 161 | echo |
162 | | -echo "-----------------------------------------------------------------------------------------------" |
163 | | -echo "Setting up permissions for USB ports, see http://www.gphoto.org/doc/manual/permissions-usb.html" |
164 | | -echo "-----------------------------------------------------------------------------------------------" |
| 162 | +echo "---------------------------------------------------------------------------------" |
| 163 | +echo "Generating udev rules, see http://www.gphoto.org/doc/manual/permissions-usb.html" |
| 164 | +echo "---------------------------------------------------------------------------------" |
165 | 165 | echo |
166 | | -/usr/local/lib/libgphoto2/print-camera-list udev-rules version 0.98 group plugdev mode 0660 > /etc/udev/rules.d/90-libgphoto2.rules |
| 166 | + |
| 167 | +udev_version=$(udevd --version) |
| 168 | + |
| 169 | +if [ "$udev_version" -ge "201" ] |
| 170 | +then |
| 171 | + udev_rules=201 |
| 172 | +elif [ "$udev_version" -ge "175" ] |
| 173 | +then |
| 174 | + udev_rules=175 |
| 175 | +elif [ "$udev_version" -ge "136" ] |
| 176 | +then |
| 177 | + udev_rules=136 |
| 178 | +else |
| 179 | + udev_rules=0.98 |
| 180 | +fi |
| 181 | + |
| 182 | +/usr/local/lib/libgphoto2/print-camera-list udev-rules version $udev_rules group plugdev mode 0660 > /etc/udev/rules.d/90-libgphoto2.rules |
| 183 | + |
| 184 | +if [ "$udev_rules" = "201" ] |
| 185 | +then |
| 186 | + echo |
| 187 | + echo "------------------------------------------------------------------------" |
| 188 | + echo "Generating hwdb file in /etc/udev/hwdb.d/20-gphoto.hwdb. Ignore the NOTE" |
| 189 | + echo "------------------------------------------------------------------------" |
| 190 | + echo |
| 191 | + /usr/local/lib/libgphoto2/print-camera-list hwdb > /etc/udev/hwdb.d/20-gphoto.hwdb |
| 192 | +fi |
167 | 193 |
|
168 | 194 |
|
169 | 195 | echo |
|
0 commit comments