p2kfuse - a FUSE filesystem for Motorola P2K mobile phones
This is a FUSE filesystem to make it possible
to mount certain models of Motorola mobile phone under Linux. To use it
you'll need to have FUSE, libusb and p2kmoto installed on your system.
FUSE and libusb are probably available as part of your Linux distribution.
p2kmoto is less common. It's part of
moto4lin.
You'll need the most recent
version from SVN as it has some improvements over the released version.
For convenience I've packaged p2kmoto. The source RPM includes some patches.
p2kfuse is also available from the same place:
p2kfuse needs to have access to the mobile phone. You can manage this
by running it as root, but that isn't a terribly good idea. There are
a couple of other approaches:
-
The p2kfuse binary can be made setuid root. It only runs as root for
long enough to connect to the phone. Once it's done that it drops
root privileges and runs as the user who invoked it.
-
You can set up udev rules that alter the permissions on the devices
associated with the mobile phone so that members of a certain group
have access. The p2kfuse RPM includes a rules file that works for
my Motorola V235. You'll need to add the necessary device ids if
you have a different phone. You'll also need to add any users who
are to have access to the phone to the group 'phone'.
Once p2kfuse is installed you can mount your phone as a filesystem with
a command like:
p2kfuse /mnt/phone
and unmount it with:
fusermount -u /mnt/phone
There are a number of limitations to this program. Documentation on
how to access files in Motorola mobile phones is hard to come by, so it
isn't clear how many of these limitations are fundamental and how many
are due to the p2kmoto library.
Here are some things to note:
-
It doesn't seem to be possible to create empty files. Instead p2kfuse
makes a file containing two null bytes.
-
The list of files returned by the phone doesn't include directories,
only files. The existence of directories has to be inferred from
the paths of the files. This means that it isn't possible to know
about empty directories on the phone. It is possible to create an
empty directory, and because p2kfuse caches information about the
filesystem layout it's possible to see such a directory so long as
the phone remains mounted. However, before unmouting the filesystem
you should create at least one file in the new directory otherwise
you'll never see it again.
-
For reasons that are unclear it isn't possible to create directories
in some places in the filesystem, even though files can be created.
-
I've made files that have the system attribute read only. I didn't
want to break my phone by accidentally deleting important files.
-
Filesystem statistics are returned for the individual volumes on
the phone, not the filesystem as a whole. Thus the command
df -k /mnt/phone doesn't return any useful information whereas
df -k /mnt/phone/a does.
-
Because it's only possible to have one file open at a time the
contents of all open files are cached in memory.
Ron Yorston
27th April 2008