Coda File System

breaking the long silence

From: <u-thti_at_aetey.se>
Date: Tue, 27 Oct 2015 22:28:24 +0100
Hello all,

Some news.

Now I am accessing Coda on an Android-compatible phone,
among others listening to music. R/W access works too.

Of course Coda is not integrated into the peculiar Android
privilege management, but this is a side issue. Passing
tokens between different uids is trivial in shell, a GUI
for this would be straightforward.

The challenge which I did not attack was use of bionic.
The Coda client is built independently of any Android-related SDK,
with musl.

Musl looks sufficient (modulo dns resolution - it expects a
resolv.conf which has to be provided in some way, possibly by fetching
the data from the android environment).
A bionic-based build is left as an optional future exercise.

The Coda client installer for ARM Linux happened also to work on
Android-arm, wrapped into some trivial "sandboxing": Venus runs
"underneath" in a local filesystem while android is chrooted.

Depending on your preferences you can underneath the chroot use either a
full-featured Linux of some kind or otherwise only the bare coda client
(it does not need anything besides a writable place for the cache,
resolv.conf and some device files).

Do not forget "mount -o bind,shared /coda /android/coda" after
starting venus and before starting android init.
(Do not forget to give venus some device files, too, before starting
the android init who populates its /dev properly afterwards.)

The kernel is to be rebuilt, enabling Coda in the kernel config.
No other modifications are mandatory in the Android setup.

A /etc/resolv.conf in the android part is needed if you wish to clog "from
the inside" (you may otherwise run Linux with X11 or sshd underneath
android and do clog there). Of course you need then to unpack the coda
client in the chroot too, to have the clog-related binaries.

As a side note, starting the same coda client venus binary inside the
android chroot (without having run it from underneath) yields "/coda
already mounted", wonder what is causing this.

Prerequisits:
- self-sufficient Coda client userspace binaries and scripts
  (Aetey's installer is highly recommended :)
- a rebuilt Android/Replicant kernel with a one-line change in the config,
  Coda enabled
- hackable/rooted Android-compatible phone

Passing tokens can be done like the following:

Store the token in a file
 touch /tmp/token
 chmod 600 /tmp/token
 clog -dump codauser_at_coda.realm >/tmp/token
Password: ....

Give the rights to root (good for the file manager)
# clog -method fromfile -- /tmp/token

For a certain app, like music player:
# su -c 'clog -method fromfile -- -' u0_a0 </tmp/token

Regards,
Rune
Received on 2015-10-27 17:29:07