Build Sailfish OS firmware your own

Hello Sailfish OS community! I have compiled files and scripts with simple instructions here:

You can build your own fastboot flashable firmware for Jolla, Inoi and other devices using official jolla repositories using your own credentials.

Best wishes

35 Likes

Nice to see you @coderus - hope you are well and thriving in your job!

3 Likes

Hi,
This looks cool butā€¦ what is it?
I know this is for devs but I canā€™t resist to be curious.
(I apologize for being only able to read --human-readable things)

Is this for those who have special hardware, maybe?
Thanks

1 Like

Remember when you downloaded the archive from Jollaā€™s website and then flashed your phone? With this project youā€™ll be able to produce your own image.

I think you can use this project for various purposes. For instance, you want a newer version of a specific project or as you said for a specific hardware.

2 Likes

main goal is to build flashable firmware for jolla devices, e.g. jolla1, jollac, inoi r7, jolla tablet, etc.

2 Likes

Oh really? Wow!
We tried to achieve this for long on N900 without success IIRC (at least for --human-readable people).
So, once the installation is ok, with apps and settings, we can make a flashable image with it? This is so class!

Hmm, only for these devices or specially, but not only?

yes only officially supported devices. it takes device configuration file - ks, and jolla repositories to download packages from repositories and pack it to flashable images.

1 Like

Ok, got it. Thank you much for explaining.

@coderus many thanks for this instruction and build tool :smiley:.
Can you give any additional information where i can get the values for ā€˜ā€¦ -e DEVICE=l500d -e DEVICE_VENDOR=qualcomm ā€¦ā€™ and what .ks file to use e.g. for the tablet or GeminiPDA?
I did not find this information on this devices it self :thinking:.
EDIT: For the GeminiPDA i got an image on the Jolla shop, but not for the table (or the Jolla Phone) :smirk:.

check header of build.sh file, it gives you default examples for execution.
also you can get it from your repositories pattern - look at ssu lr output.

1 Like

Very nice!
I wanted to build a tablet image since it is such a PITA to upgrade from scratch, but ran into problems.
So simplifying, i used the command from README.md, with my username and password from the credentials-store section of ssu.ini.

The failure iā€™m getting is as follows:

  File "/usr/bin/mic", line 219, in <module>
    sys.exit(mic.main())
  File "/usr/lib/python3.8/site-packages/mic/utils/cmdln.py", line 257, in main
    return self.cmd(args)
  File "/usr/lib/python3.8/site-packages/mic/utils/cmdln.py", line 280, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python3.8/site-packages/mic/utils/cmdln.py", line 412, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python3.8/site-packages/mic/utils/cmdln.py", line 1084, in _dispatch_cmd
    return handler(argv)
  File "/usr/bin/mic", line 88, in do_create
    cr.main(argv[1:])
  File "/usr/lib/python3.8/site-packages/mic/creator.py", line 266, in main
    return self.cmd(args)
  File "/usr/lib/python3.8/site-packages/mic/utils/cmdln.py", line 280, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python3.8/site-packages/mic/utils/cmdln.py", line 412, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python3.8/site-packages/mic/utils/cmdln.py", line 1100, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/mic/plugins/imager/loop_plugin.py", line 68, in do_create
    creator.check_depend_tools()
  File "/usr/lib/python3.8/site-packages/mic/imager/baseimager.py", line 1303, in check_depend_tools
    fs.find_binary_path(tool)
  File "/usr/lib/python3.8/site-packages/mic/utils/fs_related.py", line 60, in find_binary_path
    raise CreatorError("Command '%s' is not available." % binary)
mic.utils.errors.CreatorError: <creator>Command 'modprobe' is not available.

Iā€™m not very familiar with dockerā€¦ but the common ways to get a shell and poke around in the container is failing with this one.

Have you tried just installing modprobe and making it available in your PATH? Or is that error in the container?

I just assumed it is from inside the container, since it would have no business messing with my host system. And for completeness, the command is available on the host.

1 Like

hello, you running it not in my container, isnā€™t it?

Not sure i understandā€¦ i assumed the commands were to be run from host, and ā€œdocker run ā€¦ā€ does the magic.

attah@obsidian repos/sfos-builder $ docker build -t sfos-builder .
attah@obsidian repos/sfos-builder $ docker run --privileged --rm -it -v $PWD:/share -w /share -e RELEASE=4.3.0.15 -e USERNAME=attah -e PASSWORD=$SuperSecretPassword -e ARCH=armv7hl -e DEVICE=l500d -e DEVICE_VENDOR=qualcomm sfos-builder l500d-eu-lvm.ks

Then it very much looks like mic inside then container is complaining about missing modprobe.

Hmm, seems i got a bit further nowā€¦ added this to the Dockerfile:

test -f /usr/sbin/modprobe || zypper -n in kmod

(not sure that is where modprobe is expected to end up though)

Now itā€™s complaining about missing feature-sailfish-eas. Hmmm.

Edit: that might be because of credentials from unlicensed phoneā€¦ trying another.
Edit2: Crapā€¦ unauthorized, does it need to be from an architecture-matching device? Or identical to the target?

Credentials from a matching device did the trick!
But i seem to be missing output filesā€¦ i only got 6 for the tablet, and not any sailfish.img* files.
Looking back at the output, grep seems to have been missing and dd failedā€¦ but despite that the job claimed to be successful.

Edit: and ā€œā€˜gnu-grepā€™ is already installed.ā€ but maybe not as /bin/grep which something seems to want?
Edit2: test -f /bin/grep || ln -s /usr/bin/grep /bin/grep in Dockerfile fixed thatā€¦ now it is missing /usr/bin/img2simg_jolla
I donā€™t think that is from droid-tools-imager and canā€™t figure out what package to addā€¦

itā€™s installed into /usr/local/bin, check if itā€™s inside path

Path is as follows: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin (at least when the Dockerfile executes)
And indeed /usr/local/bin/img2simg_jolla exists.
But for some reason it is expected in /usr/bin/

Symlinkingā€¦

Edit: Success! Iā€™ll send you my diff in an issue when iā€™ve made dinner.

ah okay probably my fault, iā€™ll inspect ks files

1 Like