Plasma Mobile installation on Nexus 5X

PlasmaMobile-00

I have been watching Plasma Mobile for a little while and have tested it in a virtual machine but haven’t made it a priority to get some real hardware to test it on until now. I recently broke my Samsung Galaxy 5S… again… but in many ways it was falling apart. I could not unlock the bootloader and every consecutive update from Samsung made the phone less usable. It would get hot and chew through the battery quickly but be incredibly slow. Looking at the battery usage it was always the Android System that was on top of the list. The last time it was used was when navigating to a destination, the phone became unresponsive, the screen went black and was incredibly hot.

Recently, it was announced that KDE Connect is available for Plasma Mobile which was the tipping point for me to say, it is time to test Plasma Mobile on something other than a virtual machine. So, I purchased Nexus 5X on ebay for $80, I figured, why not.

Nexus 5X-Android

Using this guide, Unlock for Beginners, as my base, I put this together as a distilled version of the guide that can be used on openSUSE but probably any other distribution of Linux as well.

Going through this, it took me a bit to really understand and take a course of action so to make this easier for someone of similar goals. I am running this on openSUSE Tumbleweed but the instructions for Leap should be the same. It really was a rather painless process so this doesn’t write-up doesn’t have much for trouble shooting.

Download the Tools

After some extensive reading and poking around, I chose the minimal method to perform this task. Instead of the full Android SDK, just the ADB Tools.

First step was to download the ADB/Fastboot (platform-tools)

I put it in my Projects folder.

~/Projects/adb/

In that folder, extracted the downloaded zip file, which is easy to do with KDE Plasma’s file manager, Dolphin. If you would like to do it in the terminal (your version may vary):

unzip platform-tools_r28.0.1-linux.zip -d platform-tools

Next, navigate to the folder, platform-tools and executed:

./adb version

which gave the output

Android Debug Bridge version 1.0.40
Version 4986621
Installed as /home/cubiclenate/Projects/adb/platform-tools/adb

Activate Developer Mode on the Nexus 5X

Navigate to: Settings > System > About phone

Scroll to the bottom of the list and tap Build Number 7 times. It will give you a countdown of how many more times you need to tap it after a few taps

Enable adb/USB Debugging

Navigate to: Settings > System > Developer options

There should be three toggles that are on:

A toggle at the top of the screen that should be On

Toggle OEM unlocking to On

Nexus 5X-Developer Options

Scroll down to the Debugging section and ensure that USB debugging is toggled On.

Prepare Desktop Linux

On my openSUSE machine, check to see if you have a plugdev group.

cut -d: -f1 /etc/group | sort | grep plugdev

If you don’t see plugdev returned, add it.

sudo groupadd plugdev

Then add your username to the plugdev group

sudo usermod -aG plugdev $LOGNAME

Logout and log back in for the group changes to take affect

Flash the Phone

Send the command to reboot into the Fastboot Mode

./adb reboot bootloader

The phone will reboot into this screen:

Nexus 5X-Fastboot

Note the PRODUCT NAME is bullhead. More on that later.

Just to verify, I checked that I could do the fastboot thing

./fastboot devices

And it gave me the output

00493e6b7693cba7        fastboot

I have no idea if I should leaving that number is a security risk or not but in this case, I’m not terrible worried.

Next step was to perform the oem unlock and make this phone do some complaining

./fastboot oem unlock

Nexus 5X-Unlock Bootloader

Select YES to Unlock the bootloader on the Mobile.

It should give you very encouraging output similar to this:

OKAY [301.881s]
Finished. Total time: 301.881s

Point of No Return

This process will erase the complete memory of the Nexus 5X. If that matters to you, be sure to back up everything that matters to you.

./fastboot format cache

Output should be similar to this:

Couldn’t parse erase-block-size ‘0x’.
Couldn’t parse logical-block-size ‘0x’.
Creating filesystem with parameters:
Size: 100663296
Block size: 4096
Blocks per group: 32768
Inodes per group: 6144
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 24576
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/6144 inodes and 1422/24576 blocks
target reported max download size of 536870912 bytes
erasing ‘cache’…
OKAY [  0.081s]
sending ‘cache’ (5688 KB)…
OKAY [  0.214s]
writing ‘cache’…
OKAY [  0.063s]
finished. total time: 0.357s

Then format the User Data:

./fastboot format userdata

With the output similar to this:

mke2fs 1.44.3 (10-July-2018)
Creating filesystem with 6661115 4k blocks and 1667904 inodes
Filesystem UUID: fea22557-b249-45e8-aca6-3230969b647b
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

Sending ‘userdata’ (4272 KB)                       OKAY [  0.181s]
Writing ‘userdata’                                 OKAY [  0.064s]
Finished. Total time: 0.388s

Now your phone is ready to flash Plasma Mobile. Though, it can also be noted that if you want to install custom firmware, that could be done as well.

Flashing Plasma Mobile

For this initial foray into Plasma Mobile, I used the the Neon Architecture reference.

In my ~/Projects folder I created a subdirectory PlasmaMobile

mkdir PlasmaMobile

Then pulled the latest Plasma Mobile flashing tool from GitHub

git clone https://github.com/plasma-phone-packaging/pm-flashtool.git

Changed directory to the location of flashtool

cd pm-flashtool

While still in fastboot mode, in terminal, Executed pm-flash

./pm-flash

This required a bit of interaction. It is important that you do not install the wrong image on the phone, something about bricking the device… which is bad.

+ CACHEDIR=cache
+ echo ‘Waiting for device to be in the fastboot mode’
Waiting for device to be in the fastboot mode
+ fastboot getvar product
product: bullhead
finished. total time: 0.020s
++ fastboot getvar product
++ head -1
++ awk ‘-F: ‘ ‘{print $2}’
+ DEVICE_NAME=bullhead
+ confirm ‘Connected device is bullhead, is that correct? [y/N]’
+ read -r -p ‘Connected device is bullhead, is that correct? [y/N] ‘ response
Connected device is bullhead, is that correct? [y/N]

I input y then hit enter as this is a bullhead device which is verified on the Fastboot Mode.

Unfortunately, due to my lack of prep work, I ended up on a Google Splash screen. Thanks to the fine folks on the Plasma Mobile Telegram group I was instructed to run the Flash-Vendor application to put the correct driver blob that would be compatible with Plasma Mobile

./flash-vendor

As soon as it completed, the phone rebooted and very shortly thereafter, I was greeted with a snazzy looking Plasma Mobile desktop. My initial impressions are very positive. I like the look and feel. The application menu is a different take from what you would see on Android but perfectly functional.

Nexus 5X-PlasmaMoble-01.jpg

The settings tool is similar to what you would see on the Plasma Desktop with real customization options. The kind of options that bring an ear-to-ear smile to your face.

Instead of Google Play, the application manager is Discover. This manages your updates as well of which I was told I had 309 updates waiting for me…. but I learned that updating in this manner is not yet supported, so don’t do that.

The authentication dialog feels like it isn’t really meant for mobile but I can overlook that small bit.

The network manager is by far the best network manager I have ever seen on a Mobile. I will admit, I am quite biased about this bit as I think the Plasma Desktop Network Manager is the best I’ve seen yet.

PlasmaMobile-Network Manager.jpg

I have only one issue, at the time of this writing, that prevents me from using this full time. I cannot actually place any calls with it. I am sure that the fix is forthcoming or maybe the problem is entirely with me. Once I have that hammered out, I will update this accordingly.

Final Thoughts

I am just now exploring the fine offerings of Plasma Mobile what it can do and what it can not do. The scope of this blathering is just the installation of Plasma Mobile on the Nexus 5X. I will continue to noodle around with it in hopes of making it my full-time daily driver mobile device in the very near future.

If you have a compatible device and some time to experiment, I recommend this as a fine afternoon activity. Perhaps you can even help out with the project and further the cause of having a truly free and open platform on your mobile.

References

Plasma-Mobile Project Site

XRA Developers Forum, Nexus-5X How To For Beginners Guide

platform-tools-latest-linux.zip

Neon Architecture Reference

Nexus 5X specifications on GSM Arena

11 thoughts on “Plasma Mobile installation on Nexus 5X

  1. Thanks for the very detailed instructions.

    I would really like to try Plasma Mobile but I’d have to say that a phone that can’t actually make calls makes it a complete non-starter.

    1. If you have the funds or the hardware, it is worth noodling on with a second device. It really is very close to being a daily driver.

  2. Thank you for the instructions.
    I followed all the steps and they worked fine without error messages.

    Unfortunately, ./flash-vendor didn’t help me.
    The phone is stuck at the Google splash screen.
    I tried several times without success and I haven’t been able to find a solution on the internet.

    Any advice?

    Thank you.

    1. I have some unfortunate news for you on that. You MAY have run into the issue that plagues that device where the SoC essentially desolders itself from the board. There is a way to reflow the solder. My Nexus 5X has also done this and I may try to fix it in the future.

      1. Thank you for your quick reply.
        I have been able to restore the phone by downloading the latest factory image from developers.google.com.
        Meanwhile, I had a closer look at the output of pm-flash.
        The problem seems to be these two messages:
        mount: mounting /dev/block/mmcblk0p40 on /cache failed: Device or resource busy
        mount: mounting /dev/block/mmcblk0p45 on /data failed: Device or resource busy

        The pm-flash script finished without errors, but after rebooting, the Android system came up again.

        Unfortunately, I have not been able to solve this issue.
        Apparently, the data partition is encrypted and has to be formatted.

        First, I tried:
        fastboot format data
        This produced:
        fastboot: error: Formatting is not supported for file system with type ”.

        Next, I followed the steps shown at https://andi34.github.io/faq/faq_twrp.html, but that didn’t work either.
        I don’t know what else I could try.
        Could it really be a hardware problem?
        The phone works fine with the original Android system.

      2. On github, I found out how to get rid of the mount errors.
        But that didn’t help.

        After pm-flash, the phone boots the Android system again, not Plasma Mobile.
        When I got back to fastboot mode then and run flash-vendor, the phone gets stuck showing just the Google logo.

      3. That does sound like the hardware failure with which that device was plagued. I have kept mine and I do want to attempt fixing it but I have other projects that are sitting ahead of it. 🙂

      4. Thank you again.
        Is there any way to find out whether it is really that hardware failure?

        All I can find on the internet is a boot loop problem.
        However, the phone is working perfectly fine with Android.
        I am also able to unlock the bootloader, run fastboot, etc.
        pm-flash runs without any error messages, but the phone still boots into Android.

        So before I give it to some repair service who tells me that nothing’s wrong with the phone, I’d like to make sure that there is actually a hardware failure.

      5. Alright, I finally managed to install Plasma Mobile.
        For some reason, the last five lines of the script rootstock-touch-install were not executed:
        adb reboot bootloader
        fastboot getvar product 2> /dev/null
        fastboot flash boot $BOOTIMG 2> /dev/null
        fastboot continue 2> /dev/null
        echo “[done]”
        I wondered why “[done]” was not printed in the shell when pm-flash had finished, and why the phone did not boot automatically as described in the official instructions, but stayed in fastboot mode instead.
        When I tried to run the first command in the shell, i.e.
        adb reboot bootloader
        I received the error message “error: no devices/emulators found”.
        After that, I ran the three fastboot commands in the shell and the phone rebooted and got stuck showing the Google logo.
        Next, I executed the flash-vendor script as instructed in the official instructions and the phone rebooted and Plasma Linux came up.

        I will post this on the github pages soon.

Leave a Reply