summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matt Colyer2009-03-26 09:18:31 -0700
committerGravatar Matt Colyer2009-03-26 09:18:31 -0700
commit1496822b6be9857a16e8e7135c42927b8b348e0c (patch)
treea48a1c974f3f8d86b2c22529ea5cbe6f6e8fb2a0
parent910f6639b54f46ee62dc0038401b1949944c00b6 (diff)
downloadifuse-1496822b6be9857a16e8e7135c42927b8b348e0c.tar.gz
ifuse-1496822b6be9857a16e8e7135c42927b8b348e0c.tar.bz2
Make automounting actually work. [#3 state:resolved]
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac2
-rw-r--r--data/30-ifuse.fdi54
-rw-r--r--data/Makefile.am4
-rwxr-xr-xdata/hal-iphone-setup22
-rw-r--r--fdi/30-ifuse.fdi41
-rw-r--r--fdi/Makefile.am3
-rw-r--r--src/Makefile.am2
-rw-r--r--src/ifuse.c1
9 files changed, 48 insertions, 83 deletions
diff --git a/Makefile.am b/Makefile.am
index 27732b8..a6161ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src data
+SUBDIRS = src fdi
indent:
indent -kr -ut -ts4 -l120 src/*.c
diff --git a/configure.ac b/configure.ac
index 0fc8d09..1598675 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,4 +37,4 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
-AC_OUTPUT(Makefile src/Makefile data/Makefile)
+AC_OUTPUT(Makefile src/Makefile fdi/Makefile)
diff --git a/data/30-ifuse.fdi b/data/30-ifuse.fdi
deleted file mode 100644
index 51ea028..0000000
--- a/data/30-ifuse.fdi
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deviceinfo version="0.2">
- <device>
- <match key="usb_device.vendor_id" int="0x5ac">
- <match key="usb.product_id" compare_ge="0x1290">
- <match key="usb.product_id" compare_le="0x1293">
- <append key="info.capabilities" type="strlist">block</append>
- <append key="info.capabilities" type="strlist">storage</append>
- <merge key="info.callouts.add" type="strlist">hal-iphone-setup</merge>
- <merge key="info.category" type="string">storage</merge>
- <merge key="storage.bus" type="string">usb</merge>
- <merge key="storage.drive_type" type="string">disk</merge>
- <merge key="storage.removable" type="bool">true</merge>
- <merge key="storage.removable.media_available" type="bool">true</merge>
- <merge key="storage.requires_eject" type="bool">false</merge>
- <merge key="storage.hotpluggable" type="bool">false</merge>
- <merge key="storage.media_check_enabled" type="bool">false</merge>
- <merge key="storage.automount_enabled_hint" type="bool">true</merge>
- <merge key="storage.no_partitions_hint" type="bool">true</merge>
- <merge key="storage.model" type="string">iPhone</merge>
- <merge key="storage.vendor" type="string">Apple Computer, Inc.</merge>
- <merge key="storage.orginating_device" type="copy_property">/org/freedesktop/Hal/devices/computer</merge>
- <append key="block.device" type="copy_property">@info.udi:linux.device_file</append>
- <merge key="block.storage_device" type="copy_property">@info.parent:info.udi</merge>
- </match>
- </match>
- </match>
- <match key="info.subsystem" string="usb">
- <match key="usb.vendor_id" int="0x5ac">
- <match key="usb.product_id" compare_ge="0x1290">
- <match key="usb.product_id" compare_le="0x1293">
- <match key="usb.interface.number" int="0x1">
- <remove key="info.capabilities" type="strlist">camera</remove>
- <append key="info.capabilities" type="strlist">block</append>
- <append key="info.capabilities" type="strlist">volume</append>
- <merge key="info.category" type="string">volume</merge>
- <merge key="info.callouts.add" type="strlist">hal-iphone-setup</merge>
- <append key="block.device" type="copy_property">@info.parent:linux.device_file</append>
- <merge key="block.storage_device" type="copy_property">@info.parent:info.udi</merge>
- <merge key="block.is_volume" type="bool">true</merge>
- <merge key="block.no_partitions" type="bool">true</merge>
- <merge key="block.have_scanned" type="bool">false</merge>
- <append key="volume.fstype" type="string">fuse.ifuse</append>
- <merge key="volume.mount.valid_options" type="strlist">allow_other</merge>
- <append key="volume.fsusage" type="string">filesystem</append>
- <append key="volume.label" type="string">iPhone</append>
- <append key="volume.uuid" type="string"></append>
- </match>
- </match>
- </match>
- </match>
- </match>
- </device>
-</deviceinfo>
diff --git a/data/Makefile.am b/data/Makefile.am
deleted file mode 100644
index f9302c4..0000000
--- a/data/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-freedesktopfdidir = $(prefix)/share/hal/fdi/information/20thirdparty/
-freedesktopfdi_DATA = 30-ifuse.fdi
-
-bin_SCRIPTS = hal-iphone-setup
diff --git a/data/hal-iphone-setup b/data/hal-iphone-setup
deleted file mode 100755
index a6cffe6..0000000
--- a/data/hal-iphone-setup
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# borrowed from Fedora and modified to apply device major and minor nodes to the iPhone
-#
-
-hal_set () {
- if [ -n "$2" ]; then
- /usr/bin/hal-set-property --udi "$UDI" --key block.$1 --int "$2"
- else
- /usr/bin/hal-set-property --udi "$UDI" --key block.$1 --remove
- fi
-}
-
-DEVICE_NODE=`hal-get-property --udi "$UDI" --key block.device`
-
-echo $DEVICE_NODE
-
-MAJOR=`stat $DEVICE_NODE --format="%t"`
-MINOR=`stat $DEVICE_NODE --format="%T"`
-
-hal_set major 0x$MAJOR
-hal_set minor 0x$MINOR
diff --git a/fdi/30-ifuse.fdi b/fdi/30-ifuse.fdi
new file mode 100644
index 0000000..a801720
--- /dev/null
+++ b/fdi/30-ifuse.fdi
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<deviceinfo version="0.2">
+ <device>
+ <match key="info.subsystem" string="usb_device">
+ <match key="usb_device.vendor_id" int="0x5ac">
+ <match key="usb_device.product_id" compare_ge="0x1290">
+ <match key="usb_device.product_id" compare_le="0x1293">
+ <append key="info.capabilities" type="strlist">block</append>
+ <append key="info.capabilities" type="strlist">storage</append>
+ <merge key="storage.hotpluggable" type="bool">false</merge>
+ <merge key="storage.removable" type="bool">true</merge>
+ <merge key="storage.automount_enabled_hint" type="bool">true</merge>
+ <merge key="storage.model" type="string">iPhone</merge>
+ <merge key="storage.vendor" type="string">Apple Computer, Inc.</merge>
+ <merge key="storage.orginating_device" type="copy_property">/org/freedesktop/Hal/devices/computer</merge>
+ <append key="block.device" type="copy_property">@info.udi:linux.device_file</append>
+ <merge key="block.storage_device" type="copy_property">@info.parent:info.udi</merge>
+ </match>
+ </match>
+ </match>
+ </match>
+ <match key="info.subsystem" string="usb">
+ <match key="usb.vendor_id" int="0x5ac">
+ <match key="usb.product_id" compare_ge="0x1290">
+ <match key="usb.product_id" compare_le="0x1293">
+ <match key="usb.interface.number" int="0x1">
+ <append key="info.capabilities" type="strlist">block</append>
+ <append key="info.capabilities" type="strlist">volume</append>
+ <append key="block.device" type="copy_property">@info.parent:linux.device_file</append>
+ <merge key="block.storage_device" type="copy_property">@info.parent:info.udi</merge>
+ <append key="volume.fstype" type="string">fuse.ifuse</append>
+ <append key="volume.fsusage" type="string">filesystem</append>
+ <append key="volume.label" type="string">iPhone</append>
+ <append key="volume.uuid" type="string"></append>
+ </match>
+ </match>
+ </match>
+ </match>
+ </match>
+ </device>
+</deviceinfo>
diff --git a/fdi/Makefile.am b/fdi/Makefile.am
new file mode 100644
index 0000000..8cd58d4
--- /dev/null
+++ b/fdi/Makefile.am
@@ -0,0 +1,3 @@
+freedesktopfdidir=$(prefix)/share/hal/fdi/information/20thirdparty
+freedesktopfdi_DATA=30-ifuse.fdi
+
diff --git a/src/Makefile.am b/src/Makefile.am
index b0ea5d5..17798c6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
AM_CFLAGS = $(libglib2_CFLAGS) $(libfuse_CFLAGS) $(libiphone_CFLAGS) -g
AM_LDFLAGS = $(libglib2_LIBS) $(libfuse_LIBS) $(libiphone_LIBS)
-rootsbinexecdir = $(sbindir)
+rootsbinexecdir = /sbin
rootsbinexec_PROGRAMS = mount.fuse.ifuse
mount_fuse_ifuse_SOURCES = ifuse.c
diff --git a/src/ifuse.c b/src/ifuse.c
index f2acc78..5677cbc 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -351,6 +351,7 @@ int main(int argc, char *argv[])
if (fuse_opt_parse(&args, NULL, NULL, ifuse_opt_proc) == -1) {
return -1;
}
+ fuse_opt_add_arg(&args, "-oallow_other");
if (argc < 2) {
fprintf(stderr, "A path to the USB device must be specified\n");