[HOWTO] ✏ Compiling Fairphone Open OS / Rooting

I tried cloning the fairphone osos repos as described in the build instructions, but the given http-address 404s and the ssh-address gives “Permission denied” although i did add my key in gerrit. Does anyone know where else i can get the sources?

If you are running Ubuntu 16.04 which uses OpenSSH 7 then you will need to add a .ssh/config file with the gerrit host to allow the right cypher: http://www.openssh.com/legacy.html

For Example:

user@skylake:~/fairphone_os$ repo init -u ssh://code.fairphone.com:29418/fp2-dev/manifest -b fp2-sibon
Unable to negotiate with 37.187.31.110 port 29418: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

Edit needed:

user@skylake:~$ cat .ssh/config
Host code.fairphone.com
KexAlgorithms +diffie-hellman-group1-sha1

1 Like

@tom.longshine did you also do a ssh-add on your private key?

elajoie@skylake:~$ ssh-add .ssh/id_rsa
Identity added: .ssh/id_rsa (.ssh/id_rsa)

Thanks for your help, but i already did allow the legacy cypher. ssh-add is just for the ssh-agent and didn’t have an effect.

@tom.longshine Have you tried looking at debugging?

This setting enables level 3 debugging:

elajoie@skylake:~$ cat .ssh/config
Host code.fairphone.com KexAlgorithms +diffie-hellman-group1-sha1 LogLevel DEBUG3

The last time I sync’ed I did not see any new code (lastest changes/commits Jan 2016). Do other people see more commits? Maybe I’m doing it wrong.

Here is a log: http://termbin.com/5xdj
It basically just rejects my key, but i did add the key to gerrit, so i suspect that the repo is gone/changed location (especially in conjunction with the http-access 404ing). Can you please test whether the repo init -u ssh://code.fairphone.com:29418/fp2-dev/manifest -b fp2-sibon command currently works, to exclude that possibility.

@tom.longshine
Works for me:
elajoie@skylake:~/fairphone_os$ repo init -u ssh://code.fairphone.com:29418/fp2-dev/manifest -b fp2-sibon

Your identity is: Eric Lajoie elajoie@ericlajoie.com
If you want to change this, please re-run ‘repo init’ with --config-name

repo has been initialized in /home/elajoie/fairphone_os

Maybe line 46 in your .ssh/known_hosts file needs to be removed and you can add the one below:

[code.fairphone.com]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCTQ1o0jhAfkLvMbXwUXLGdPWZ7VvyFLaMTxT6/LmiLqg20E/6oKEw/2Hw5mINhpFRvd7BGZ7n8FieXqJ1Z+FIsAyZA90e5tpqAihRU9Lmh2s4IeADRxEv0gLxiVvkc7DmcCIZM6SDEKq5xuZZqSvSy/VQxxfGRfUt6PykVRLw7jw==

Also can you confirm you did a ssh-add .ssh/id_rsa on your private key as I had same issue and it started working after I added it.

Thanks for your testing.
Replacing the line in the known_hosts-file had no effect (eyeballing, the old line had the same fingerprint). I can confirm that i did a ssh-add and ssh-add -l shows that the key is indeed added

$ ssh-add -l 2048 SHA256:nL03OxEiqvxK0QA98fv4pgXxrtARuxgm9lPhnVZF5sw /home/tom/.ssh/id_rsa (RSA)

@tom.longshine

Only thing I can imagine is Gerrit might not have the full key or your local client may have an older private ket added.

Can you try this:

  1. ssh-keygen (without pass phrase)
  2. ssh-add .ssh/id_rsa
  3. Log into Gerrit and make sure it looks simular with your new public key from .ssh/id_rsa.pub
  4. repo sync (make sure this works as your debug output showed googlesource.com connections I did not have)
  5. repo init -u ssh://code.fairphone.com:29418/fp2-dev/manifest -b fp2-sibon

I moved my ~/.ssh directory, generated a new key, added it to gerrit and modified ~/.ssh/config and ~/.ssh/known_hosts as necessary. repo sync fails, saying that it requires repo init first. The googlesource.com connections are missing if i do not delete the .repo directory, so you probably had that still lying around (Did you try in a completely fresh directory?). repo init -u ssh://code.fairphone.com:29418/fp2-dev/manifest -b fp2-sibon still fails with “Permission denied”. :frowning:

However, I noticed when using http, that despite http://code.fairphone.com/gerrit/fp2-dev/manifest 404ing repo sync still seems to do its thing (throwing a lot more 404s on the go). The 404 of http://code.fairphone.com/gerrit/fp2-dev/manifest seems to be quiet on some plattforms and confused me into assuming the repo init failed.

Thank you very much for your help! :slight_smile:

@tom.longshine
Did you follow all these steps before?
https://code.fairphone.com/projects/fp-osos/dev/fairphone-os-build-instructions.html#fairphone-os-build-instructions

Specifically grabbing the repo file and updating path variable.

I played around with repo today and changed my manifest to: default remote="origin" revision="fp2-sibon-2.0.2" Will I get more recent code with this branch?

Update: I do not understand how the manifest works. Can someone explain me how to switch to the latest “meta” branch/revision that matches the code from the latest update (1.2.8)?

I still don’t understand why Fairphone team don’t bring (more) help on this thread. :neutral_face:

Maybe @anon12454812 or @keesj can give some informations?

1 Like

Yes, I did. As said, the http-repo-url seems to work despite the 404, so I don’t care about the broken ssh-auth anymore (I just need the repo to build a google-free image, would be much easier if fairphone offered a prebuilt image …).

Unfortunately, the build fails with some obscure linker error (log: http://termbin.com/545w). :frowning:

Most probably your compiler is to new, try gcc-4.8, as stated on the first post.

I would be interested in this as well.

I’ve stopped using the repo because I don’t know how to get the latest code.

It still builds here, I just have no clue what code I’m using. I’m pretty sure it’s not the released code, but it’s hard to check that. But don’t see any recent CVEs in the commits or other changes.

Have you tried removing the build/ dir and starting all over again? Maybe it’s best to wait until they update everything for the new code basis. Are you using a very up-to-date archlinux? Make sure some tools are old enough :slight_smile: (clang linker prebuild issues – no clue, really, but as @jochensp said … maybe it’s a problem with combining your local gcc with the prebuild tools?)

remove build/
$ repo sync -c
and try using the 2.0.2 bin blobs.

But as I said: It’s best just to wait a while longer. I don’t think we have the latest code yet.

Could someone from the Fairphone-Team PLEASE tell whether the download on code.fairphone.com is now updated to version 1.2.8?

2 Likes

In case someone else wants to try this on arch linux (I’ve given up and will try the docker image now):

With all this in place I finally run into the same make error as merci (build-log: http://termbin.com/d648):