[lang]

Present Perfect

Personal
Projects
Packages
Patches
Presents
Linux

Picture Gallery
Present Perfect

desktopcouch on N900

Filed under: couchdb,Hacking,maemo — Thomas @ 12:05 pm

2010-1-17
12:05 pm

It took quite a bit of blood, sweat, tears, and dirty hacks, but finally:

Nokia-N900-42-11:~# apt-get install desktopcouch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
couchdb-bin erlang-base erlang-crypto erlang-inets erlang-mnesia
erlang-public-key erlang-runtime-tools erlang-ssl erlang-xmerl libjs
python-desktopcouch python-desktopcouch-records python-keyring
Suggested packages:
couchdb erlang-tools erlang erlang-manpages erlang-doc-html
python-keyring-gnome python-keyring-kwallet
Recommended packages:
erlang-syntax-tools
The following NEW packages will be installed:
couchdb-bin desktopcouch erlang-base erlang-crypto erlang-inets
erlang-mnesia erlang-public-key erlang-runtime-tools erlang-ssl erlang-xmerl
libjs python-desktopcouch python-desktopcouch-records python-keyring
0 upgraded, 14 newly installed, 0 to remove and 9 not upgraded.
Need to get 0B/12,5MB of archives.
After this operation, 27,9MB of additional disk space will be used.
Do you want to continue [Y/n]?
WARNING: The following packages cannot be authenticated!
erlang-base erlang-crypto erlang-mnesia erlang-runtime-tools
erlang-public-key erlang-ssl erlang-inets erlang-xmerl libjs couchdb-bin
python-keyring python-desktopcouch python-desktopcouch-records desktopcouch
Install these packages without verification [y/N]? y
Selecting previously deselected package erlang-base.
(Reading database ... 27651 files and directories currently installed.)
Unpacking erlang-base (from .../erlang-base_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package erlang-crypto.
Unpacking erlang-crypto (from .../erlang-crypto_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package erlang-mnesia.
Unpacking erlang-mnesia (from .../erlang-mnesia_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package erlang-runtime-tools.
Unpacking erlang-runtime-tools (from .../erlang-runtime-tools_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package erlang-public-key.
Unpacking erlang-public-key (from .../erlang-public-key_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package erlang-ssl.
Unpacking erlang-ssl (from .../erlang-ssl_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package erlang-inets.
Unpacking erlang-inets (from .../erlang-inets_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package erlang-xmerl.
Unpacking erlang-xmerl (from .../erlang-xmerl_1%3a13.b.2.1-dfsg-3maemo2_armel.deb) ...
Selecting previously deselected package libjs.
Unpacking libjs (from .../libjs_1.8.0-rc1-1_armel.deb) ...
Selecting previously deselected package couchdb-bin.
Unpacking couchdb-bin (from .../couchdb-bin_0.10.0-0maemo3_armel.deb) ...
Selecting previously deselected package python-keyring.
Unpacking python-keyring (from .../python-keyring_0.2-3_all.deb) ...
Selecting previously deselected package python-desktopcouch.
Unpacking python-desktopcouch (from .../python-desktopcouch_0.5.1-0maemo1_all.deb) ...
Selecting previously deselected package python-desktopcouch-records.
Unpacking python-desktopcouch-records (from .../python-desktopcouch-records_0.5.1-0maemo1_all.deb) ...
Selecting previously deselected package desktopcouch.
Unpacking desktopcouch (from .../desktopcouch_0.5.1-0maemo1_all.deb) ...
Setting up erlang-base (1:13.b.2.1-dfsg-3maemo2) ...
Searching for services which depend on erlang and should be started...none found.
Setting up erlang-crypto (1:13.b.2.1-dfsg-3maemo2) ...
Setting up erlang-mnesia (1:13.b.2.1-dfsg-3maemo2) ...
Setting up erlang-runtime-tools (1:13.b.2.1-dfsg-3maemo2) ...
Setting up erlang-public-key (1:13.b.2.1-dfsg-3maemo2) ...
Setting up erlang-ssl (1:13.b.2.1-dfsg-3maemo2) ...
Setting up erlang-inets (1:13.b.2.1-dfsg-3maemo2) ...
Setting up erlang-xmerl (1:13.b.2.1-dfsg-3maemo2) ...
Setting up libjs (1.8.0-rc1-1) ...
Setting up couchdb-bin (0.10.0-0maemo3) ...
Setting up python-keyring (0.2-3) ...
Setting up python-desktopcouch (0.5.1-0maemo1) ...
Setting up python-desktopcouch-records (0.5.1-0maemo1) ...
Setting up desktopcouch (0.5.1-0maemo1) ...
Nokia-N900-42-11:~# dbus-send --session --dest=org.desktopcouch.CouchDB \
> --print-reply --type=method_call / \
> org.desktopcouch.CouchDB.getPort
method return sender=:1.516 -> dest=:1.515 reply_serial=2
int32 53864
Nokia-N900-42-11:~#

Among other things, I had to:

  • port desktopcouch to use python-keyring as suggested by the desktopcouch hackers, although I’m not sure what they now want to do with it since there’s no way to make it compatible with their current way of storing in gnome-keyring
  • Build the arm parts of erlang and couchdb on my phone in a chroot, since qemu-arm-sb actually hangs when executing erlc. Had to build it in an actual maemo chroot as well; the easy-deb chroot was not a solution since it comes with newer C and ssl libraries.
  • figure out how to package spidermonkey, instead of depending on xulrunner the way the debian couchdb does
  • package lots of missing packages; for example, while maemo has avahi, it didn’t have the python bindings built.

For the adventurous, I think you should be able to download tao.install on your phone, then go to console and run the same apt-get install command as I did. Please let me know if it worked for you !

Now, need to figure out (or get told by the desktopcouch hackers) how I can set up pairing with UbuntuOne for my data without needing to port the whole gnome applet…

22 Comments »

  1. This is awesome!

    Comment by Jan Lehnardt — 2010-1-17 @ 2:01 pm

  2. Nice :)

    “Now, need to figure out (or get told by the desktopcouch hackers) how I can set up pairing with UbuntuOne for my data without needing to port the whole gnome applet…”

    I would be interested in the last part as well. Can you update your post if you find this out?

    Comment by Stephan — 2010-1-17 @ 2:33 pm

  3. Great news!!! Thanks for that. I hope I see UbuntuOne client on my N900 soon. ;)

    Comment by Michał — 2010-1-17 @ 3:48 pm

  4. Genius.

    To pair desktopcouch with Ubuntu One, add a record to the management database.

    See http://bazaar.launchpad.net/~sil/ubuntuone-client/create-mgt-desktopcouch-db/annotate/head:/bin/ubuntuone-client-applet#L319 for code to create this; basically, you call desktopcouch.pair.couchdb_pairing.couchdb_io.put_static_paired_service(None, “ubuntuone”) and that sets it up for you.

    The record should end up looking something like this:

    {“_id”:”SOMEID”,
    “push_to_server”:true,
    “record_type”:”http://www.freedesktop.org/wiki/Specifications/desktopcouch/paired_server”,
    “ctime”:”2009-10-16 13:11″,
    “oauth”:{
    “consumer_secret”:”hammertime”,
    “token”:”YOUR U1 TOKEN”,
    “consumer_key”:”ubuntuone”,
    “token_secret”:”YOUR U1 TOKEN SECRET”
    },
    “service_name”:”ubuntuone”,
    “pairing_identifier”:”72e6da63-b691-4aaf-81b5-06d8ada1825b”,
    “pull_from_server”:true
    }

    Comment by sil — 2010-1-17 @ 4:20 pm

  5. Ubuntu One really needs a way to select which components are sync’d … Notes and Contacts (and Calendar when they realise that’s missing)… but not files would be good for an N900, but if I try to sync 20Gb of files, it’s probably gonna end up in tears…

    Comment by James Lewis — 2010-1-17 @ 6:42 pm

  6. James: in Lucid, you’ll be able to select some folders and not others for syncing, which should solve that problem; you can already select some desktopcouch databases and not others to be synced, if you’re technical enough to need that.

    Comment by sil — 2010-1-17 @ 7:20 pm

  7. what about pairing to a desktop, avoiding ubuntuone.

    Comment by ssam — 2010-1-18 @ 1:38 pm

  8. ssam: you can pair desktopcouches with one another without going into the cloud; run desktopcouch-pair on both ends. I don’t know whether Thomas has been able to port desktopcouch-pair to the N900, but you can get around that by manually adding the appropriate records to the management database in both desktopcouches.

    Comment by sil — 2010-1-22 @ 9:41 am

  9. Would it be possible to also host the source files (the .dsc, .orig.tar.gz, and the .diff.gz files)? I’d like to be able to hack from where you left off.

    Thanks,
    Andrew

    Comment by astraw — 2010-3-4 @ 5:12 pm

  10. Astraw, sure, but could you give me some feedback first on whether the packages work at all for you ? I have yet to receive some feedback.

    Comment by Thomas — 2010-3-8 @ 11:30 am

  11. what repos should I add? after adding tao.install, i get these on apt-get install desktopcouch.

    The following packages have unmet dependencies:
    desktopcouch: Depends: couchdb-bin (>= 0.10.0-0maemo1) but it is not going to be installed
    Depends: python-twisted-core but it is not going to be installed
    Depends: python-desktopcouch but it is not going to be installed
    Depends: python-desktopcouch-records but it is not going to be installed

    drilling down a bit, the first issue is due to missing libicu42. I did not look further.

    Comment by astraw — 2010-3-18 @ 10:12 am

  12. OK, it looks like all I needed was the “extras-devel” repository and desktopcouch is apparently running just fine. Sweet.

    However, I’m trying to run my own instance of couchdb (now that it’s installed…) but when I run “couchdb” I get:

    Nokia-N900-42-11:/etc/couchdb# couchdb
    Apache CouchDB 0.10.0 (LogLevel=info) is starting.
    {“init terminating in do_boot”,{{badmatch,{error,shutdown}},[{couch_server_sup,start_server,1},{erl_eval,do_apply,5},{erl_eval,exprs,5},{init,start_it,1},{init,start_em,1}]}}

    Crash dump was written to: erl_crash.dump
    init terminating in do_boot ()

    Comment by astraw — 2010-3-20 @ 6:03 am

  13. Also, I wanted to say that your packages seem to have copies of many files in /opt/maemo in addition to /.

    Comment by astraw — 2010-3-20 @ 6:03 am

  14. So far, it seems to be working OK, but I haven’t managed to get it to pair with Ubuntu One yet:

    Nokia-N900-42-11:~$ desktopcouch-pair
    Traceback (most recent call last):
    File “/usr/bin/desktopcouch-pair”, line 68, in
    from desktopcouch.pair.couchdb_pairing import network_io
    File “/usr/lib/python2.5/site-packages/desktopcouch/pair/couchdb_pairing/network_io.py”, line 24, in
    from twisted.internet import ssl
    File “/usr/lib/python2.5/site-packages/twisted/internet/ssl.py”, line 46, in
    from OpenSSL import SSL
    ImportError: No module named OpenSSL

    Comment by astraw — 2010-3-20 @ 7:15 am

  15. Would very much like to try this, but cannot find/understand where I should pull the packages from. Help? Thanks.

    Comment by Mikael — 2010-5-20 @ 7:32 am

  16. Like the post says: download the tao.install file and try and update.

    Comment by Thomas — 2010-5-24 @ 11:20 am

  17. Thanks for the reply. As luck would have it, MicroB overlayed that part of the text with the right-hand menu, and copy-pasting the text lost the link… Now, saved by the Opera browser, I actually see the link and will give it a try as soon as I am within range of the home network.

    Comment by Mikael — 2010-5-24 @ 3:29 pm

  18. Eh. First needed python-twisted-core. When istalling that, rootfs full. Did you have some rootfs hack in place?

    Comment by Mikael — 2010-5-24 @ 9:47 pm

  19. Hm. You can optify it (I was pretty sure it was already but maybe not ?) but yeah, I remember making space on the rootfs for the last upgrade, by among other things symlinking some apt directories to my user file system.

    Comment by Thomas — 2010-5-25 @ 12:41 pm

  20. Hi Thomas,
    nice work! One question: can you make couchdb available for fremantle-1.3 in your repository, that would be awesome
    Thanks!

    Comment by thekorn — 2010-12-3 @ 9:07 pm

  21. Thomas,

    Would you happen to have a package of erlang-base for maemo version R13B03 or later? I’m trying to get Basho’s rebar https://bitbucket.org/basho/rebar/wiki/Home working on my n900 to compile webmachine but it requires version 5.7.4 or erts or later and R13B0201 has 5.7.3.

    Thanks,
    Jeff

    Comment by Jeff — 2011-7-26 @ 9:49 am

  22. Hey Jeff,

    no I don’t, and I remember it was very complicated to build erlang, because the maemo build system’s qemu-arm was hanging forever randomly on the build. I ended up doing a mix between compiling in a chroot on my phone by hand and copying compiled erlang files from the x86 build.

    I think your best bet (assuming all that code is pure erlang) is to just copy beam files for the newer webmachine if they are compatible.

    Comment by Thomas — 2011-8-1 @ 11:55 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

picture