Please correct the Installation instructions on code.fairphone.com

As you could see on thread Need help installing openos, there are some troubles someone could run into, if he/she followed the Installation Guide:

Execute the flashing script:
On any GNU/Linux distribution, make sure that you have “fastboot” installed from your package management system, and execute the flashing script by typing “sh flash-for-unix.sh”. If you have not installed “fastboot” using the distribution package management system, you need to prefix the command above with “sudo”.

  1. Even if you had fastboot installed from your package management system, you need the sudo prefix. (For me on Ubuntu 18.04 LTS, too.)
  2. The navigation to the folder an console should be mentioned. So newbies could find help with an internet search.

Thanks for all efforts und kindest regards

Strange, I don’t understand why

If you have not installed “fastboot” using the distribution package management system, you need to prefix the command above with “sudo”.

should be the case. I’m on opensuse Leap 15.0 where there are no distribution packages (maybe in some “obscure” repo), so I manually downloaded fastboot (and adb for that matter) and placed them in /usr/local/bin (the place for non-package-management binaries).
Now, if I were to run the script with “sudo”, fastboot wouldn’t be found, as the $PATH for sudo does not contain /usr/local/bin on opensuse.

In fact, I was always able to run the FP(O)OS manual installation script without “sudo”.

What happens if you omit in in Ubuntu?

That’s it.
In Ubuntu I installed fastboot using the distribution package management system with
‘sudo aptitude install fastboot’, and fastboot is placed in /usr/bin/fastboot.
If I first omitted the “sudo” in front I got the same error message like @bblablablabla94 tell in the linked thread: “can’t open…”. With “sudo” in front it works flawless.

So for both of us, the instruction is misleading. You did not install using the package system and do not need “sudo”. For me, who installed via package system, I need “sudo”.

From other scripts I’m used to messages like “error, are you root”, when sudo is needed. But here the error message is not that precise. May be there’s a way to give fp2 users, who want to try FP OPEN OS, an easier start. Maybe the script can check the location and if it need root privileges and inform the user.

That really sounds hard to believe. If the file is not found (that “cannot open” message) I’m pretty sure there is nothing in sudo that would make it find the file (proven by his post here: When I type “sudo sh flash-for-unix.sh” I get “sh: 0: Can’t open flash-for-unix.sh”). It just runs it as root (which BTW is something I doubt is neccessary; or at least I would like to understand why it seems necessary on Ubuntu).

I saw some screenshot in the Ubports forum/telegram group the other day.
There it looked like the reason why Ubuntu needs sudo is some permission restriction i.e. without it, e.g. fastboot may very well be found but is then not allowed to do what it needs to do.
And the official package https://packages.ubuntu.com/xenial/amd64/android-tools-fastboot/filelist contains udev rules where I assume those permissions are automatically granted.

So maybe the update of the instruction should be along the lines of

  • If your linux distribution provides official packages, try those first
  • If fastboot ... doesn’t work, try sudo fastboot ... instead

Or… the install script could check what distro it is running on (like this one does: https://github.com/ubports/ubports-installer/blob/master/setup-dev.sh) and automatically call itself with sudo when executed on Ubuntu.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.