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

Adding support for PTP Compatible Digital Camera's #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions configs/amlogic_xios-xbmc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ BR2_PACKAGE_DOSFSTOOLS_DOSFSCK=y
BR2_PACKAGE_DOSFSTOOLS_DOSFSLABEL=y
BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_E2FSPROGS_UTILS=y
BR2_PACKAGE_GPHOTOFS=y
BR2_PACKAGE_MTD=y
BR2_PACKAGE_NTFS_3G=y
BR2_PACKAGE_NTFSPROGS=n
Expand Down
1 change: 1 addition & 0 deletions configs/amlogic_xios_m3-xbmc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ BR2_PACKAGE_DOSFSTOOLS_DOSFSCK=y
BR2_PACKAGE_DOSFSTOOLS_DOSFSLABEL=y
BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_E2FSPROGS_UTILS=y
BR2_PACKAGE_GPHOTOFS=y
BR2_PACKAGE_MTD=y
BR2_PACKAGE_NTFS_3G=y
BR2_PACKAGE_NTFSPROGS=n
Expand Down
2 changes: 2 additions & 0 deletions package/thirdparty/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ source "package/thirdparty/xbmc/Config.in"
source "package/thirdparty/xbmcpvr/Config.in"
source "package/thirdparty/xios-skin/Config.in"
source "package/thirdparty/boblight/Config.in"
source "package/thirdparty/gphotofs/Config.in"
source "package/thirdparty/libgphoto2/Config.in"

endmenu
2 changes: 2 additions & 0 deletions package/thirdparty/gphotofs/40-gphoto.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ENV{INTERFACE}=="6/1/1", ACTION=="add", SUBSYSTEM=="usb", RUN+="/bin/sh /usr/bin/mountptp.sh"
ENV{INTERFACE}=="6/1/1", ACTION=="remove", SUBSYSTEM=="usb", RUN+="/bin/sh /usr/bin/umountptp.sh"
9 changes: 9 additions & 0 deletions package/thirdparty/gphotofs/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
config BR2_PACKAGE_GPHOTOFS
bool "gphotofs"
select BR2_PACKAGE_LIBUSB-COMPAT
select BR2_PACKAGE_LIBGPHOTO2
select BR2_PACKAGE_FUSE
help
gphotofs

http://www.gphoto.org
24 changes: 24 additions & 0 deletions package/thirdparty/gphotofs/gphotofs.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#############################################################
#
# GPHOTOFS
#
#############################################################

GPHOTOFS_VERSION = 0.5
GPHOTOFS_SOURCE = gphotofs-$(GPHOTOFS_VERSION).tar.gz
GPHOTOFS_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/gphoto/gphotofs
GPHOTOFS_INSTALL_STAGING = YES
GPHOTOFS_INSTALL_TARGET = YES
GPHOTOFS_DEPENDENCIES = host-libgphoto2 libusb-compat libfuse libgphoto2 udev
GPHOTOFS_CONF_ENV += LDFLAGS+="-lgphoto2"

define GPHOTOFS_INSTALL_UDEV
$(HOST_DIR)/usr/lib/libgphoto2/print-camera-list udev-rules version 175 mode 0660 > $(TARGET_DIR)/etc/udev/rules.d/40-gphoto.rules
cat package/thirdparty/gphotofs/40-gphoto.rules >> $(TARGET_DIR)/etc/udev/rules.d/40-gphoto.rules
$(INSTALL) -m 0755 package/thirdparty/gphotofs/mountptp.sh $(TARGET_DIR)/usr/bin/mountptp.sh
$(INSTALL) -m 0755 package/thirdparty/gphotofs/umountptp.sh $(TARGET_DIR)/usr/bin/umountptp.sh
endef

GPHOTOFS_POST_INSTALL_TARGET_HOOKS += GPHOTOFS_INSTALL_UDEV

$(eval $(call AUTOTARGETS,package/thirdparty,gphotofs))
11 changes: 11 additions & 0 deletions package/thirdparty/gphotofs/mountptp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
#Make Directory if it doesn't exist
if [ ! -d /media/camera ]; then
/bin/mkdir /media/camera
fi
# If something already mounted, dismount it
if grep -qs '/media/camera ' /proc/mounts; then
/bin/umount /media/camera
fi
# Mount the camera
/usr/bin/gphotofs /media/camera
5 changes: 5 additions & 0 deletions package/thirdparty/gphotofs/umountptp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# If its still mounted, then dismount it
if grep -qs '/media/camera ' /proc/mounts; then
umount /media/camera
fi
7 changes: 7 additions & 0 deletions package/thirdparty/libgphoto2/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config BR2_PACKAGE_LIBGPHOTO2
bool "libgphoto2"
select BR2_PACKAGE_LIBUSB-COMPAT
help
libgphoto2

http://www.gphoto.org
17 changes: 17 additions & 0 deletions package/thirdparty/libgphoto2/libgphoto2.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#############################################################
#
# LIBGPHOTO2
#
#############################################################

LIBGPHOTO2_VERSION = 2.5.0
LIBGPHOTO2_SOURCE = libgphoto2-$(LIBGPHOTO2_VERSION).tar.gz
LIBGPHOTO2_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/gphoto/libgphoto
LIBGPHOTO2_INSTALL_STAGING = YES
LIBGPHOTO2_INSTALL_TARGET = YES
LIBGPHOTO2_CONF_OPT = --enable-static --enable-shared
LIBGPHOTO2_DEPENDENCIES = host-pkg-config libusb-compat libtool
HOST_LIBGPHOTO2_CONF_OPT = --enable-shared --enable-static --without-libusb-1.0 --without-libusb

$(eval $(call AUTOTARGETS,package/thirdparty,libgphoto2))
$(eval $(call AUTOTARGETS,package/thirdparty,libgphoto2,host))