Fix camera mounts not showing up in GNOME

This commit is contained in:
Bastien Nocera 2018-12-11 12:08:01 +01:00
parent 83bc67b966
commit d49013b124
2 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,61 @@
From 24d7645039a953ff0a113ff2f913b894e4e254d7 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 11 Dec 2018 11:33:48 +0100
Subject: [PATCH] print-camera-list: Fix udev rules for linux-4.14+
Since commit 1455cf8dbfd0 ("driver core: emit uevents when
device is bound to a driver") the kernel started emitting
"bind" and "unbind" uevents which confuse the libgphoto2
udev rules.
This caused ID_GPHOTO2 and GPHOTO2_DRIVER udev properties not being set
on devices, causing them not to be visible to user-space that uses those
properties (such as gvfs' gphoto2 backend).
See https://github.com/systemd/systemd/issues/8221
---
packaging/generic/print-camera-list.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/packaging/generic/print-camera-list.c b/packaging/generic/print-camera-list.c
index fe982c44e..9057278b8 100644
--- a/packaging/generic/print-camera-list.c
+++ b/packaging/generic/print-camera-list.c
@@ -399,13 +399,13 @@ udev_parse_params (const func_params_t *params, void **data)
*/
static const char * const begin_strings[] = {
/* UDEV_PRE_0_98 */
- "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"
+ "ACTION!=\"add|bind\", GOTO=\"libgphoto2_rules_end\"\n"
"BUS!=\"usb_device\", GOTO=\"libgphoto2_usb_end\"\n\n",
/* UDEV_0_98 */
- "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"
+ "ACTION!=\"add|bind\", GOTO=\"libgphoto2_rules_end\"\n"
"SUBSYSTEM!=\"usb|usb_device\", GOTO=\"libgphoto2_usb_end\"\n\n",
/* UDEV_136 */
- "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"
+ "ACTION!=\"add|bind\", GOTO=\"libgphoto2_rules_end\"\n"
"SUBSYSTEM!=\"usb\", GOTO=\"libgphoto2_usb_end\"\n"
"ENV{DEVTYPE}!=\"usb_device\", GOTO=\"libgphoto2_usb_end\"\n\n"
"ENV{ID_USB_INTERFACES}==\"\", IMPORT{program}=\"usb_id --export %%p\"\n"
@@ -415,7 +415,7 @@ udev_parse_params (const func_params_t *params, void **data)
* more rules . It will be completed in udev_begin_func() */
"ENV{ID_USB_INTERFACES}==\"*:060101:*\", ENV{ID_GPHOTO2}=\"1\", ENV{GPHOTO2_DRIVER}=\"PTP\", ",
/* UDEV_175 */
- "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"
+ "ACTION!=\"add|bind\", GOTO=\"libgphoto2_rules_end\"\n"
"SUBSYSTEM!=\"usb\", GOTO=\"libgphoto2_usb_end\"\n"
"ENV{DEVTYPE}!=\"usb_device\", GOTO=\"libgphoto2_usb_end\"\n\n"
"ENV{ID_USB_INTERFACES}==\"\", IMPORT{builtin}=\"usb_id\"\n"
@@ -426,7 +426,7 @@ udev_parse_params (const func_params_t *params, void **data)
"ENV{ID_USB_INTERFACES}==\"*:060101:*\", ENV{ID_GPHOTO2}=\"1\", ENV{GPHOTO2_DRIVER}=\"PTP\", ",
/* UDEV_201 ... regular stuff is done via hwdb, only scsi generic here. */
- "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"
+ "ACTION!=\"add|bind\", GOTO=\"libgphoto2_rules_end\"\n"
"SUBSYSTEM!=\"usb\", GOTO=\"libgphoto2_usb_end\"\n"
"ENV{ID_USB_INTERFACES}==\"\", IMPORT{builtin}=\"usb_id\"\n"
/* shortcut the most common camera driver, ptp class, so we avoid parsing 1000
--
2.19.2

View File

@ -5,7 +5,7 @@
Name: libgphoto2
Version: 2.5.21
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Library for accessing digital cameras
# GPLV2+ for the main lib (due to exif.c) and most plugins, some plugins GPLv2
License: GPLv2+ and GPLv2
@ -14,6 +14,8 @@ URL: http://www.gphoto.org/
Source0: http://downloads.sourceforge.net/gphoto/%{name}-%{version}.tar.bz2
Patch1: gphoto2-pkgcfg.patch
Patch2: gphoto2-device-return.patch
# https://github.com/gphoto/libgphoto2/pull/332
Patch3: 0001-print-camera-list-Fix-udev-rules-for-linux-4.14.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -144,6 +146,9 @@ rm -rf %{buildroot}%{_datadir}/libgphoto2_port/*/vcamera/
%{_mandir}/man3/%{name}_port.3*
%changelog
* Tue Dec 11 2018 Bastien Nocera <bnocera@redhat.com> - 2.5.21-2
- Fix camera mounts not showing up in GNOME
* Tue Dec 11 2018 Bastien Nocera <bnocera@redhat.com> - 2.5.21-1
- Update to 2.5.21