Putting LineageOS on a Samsung Galaxy S9 (SM-G960F/DS)

LineageOS on the Samsung Galaxy S9

Recently, a friend of mine wanted to get away from the stock software of their phone, and asked for my help to install LineageOS. There were several write-ups about how to do this, so I’m just sharing my experience of making this process work, in case it is useful to someone else.

First things first, LineageOS says that you need to be on the latest Android 10 firmware for this to work. So, after getting the phone, I turned on automatic updates under software update and had to go through 4 rounds of downloading and installing the updates. This took a while on a 10 Mbps internet connection, about 3 hours. But finally, it was up to date from Android 9 to now be Android 10 with the latest firmware.

During this time, I also downloaded the latest LineageOS nightly and recovery for the S9. As seen from their site.

Now with the latest firmware, I enabled developer options by clicking on about phone, and multiple taps of the build number to enable developer options. I looked in the developer options for the OEM unlock option, but it was no-where to be found. Interesting…. But, a quick search of XDA revealed that you have to wait 7 days after enabling the developer options before you can see the OEM unlock option. However, a user, named altai1963 had a neat post about disabling automatic time updates and changing the date to be a month ago and tricking the phone that more than 7 days had passed. So, I used it, and sure enough, it worked like a charm.

I did notice though, that I didn’t need to follow all of the steps they had done. All I did was uncheck auto date/time, and set the date back one month. Then the OEM unlock option became available under developer options. After I clicked on it, it asks if you want to wipe all of your data and proceed, to which I said yes. The phone rebooted to the Samsung logo for a while with a blue flashing notification light. After about 4 minutes, it said “Android wirt restarten” and then rebooted in (I believe) German.

Fortunately, Australian English was an option from the drop-down, as was Canadian English, so I went with my old friends the Aussies and clicked through the startup screens, choosing to skip setup of anything, since I was about to wipe it anyways to install LineageOS.

Now the fun begins….

I powered off the phone from the menu, and then held Volume down, the Bixby button, and Power button to power it on. Within a second, the screen was green with a download icon and lots of text, so I released all of the buttons, and per the on screen instructions, pressed volume up to allow changes.

Per LineageOS’s instructions, I tested that Heimdall (which was already installed on my Linux computer) was working and compatible with the phone:


$ heimdall print-pit
Heimdall v1.4.1

Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Entry Count: 32
Unknown 1: 1598902083
Unknown 2: 844251476
Unknown 3: 21324
Unknown 4: 14665
Unknown 5: 12600
Unknown 6: 48
Unknown 7: 5
Unknown 8: 0


--- Entry #0 ---
Binary Type: 0 (AP)
Device Type: 8 (Unknown)
Identifier: 80
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 0
Partition Block Count: 1024
File Offset (Obsolete): 1
File Size (Obsolete): 0
Partition Name: BOOTLOADER
Flash Filename: sboot.bin
FOTA Filename: 
----- Edited for breivety ------
--- Entry #31 ---
Binary Type: 0 (AP)
Device Type: 8 (Unknown)
Identifier: 25
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 1697152
Partition Block Count: 0
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: USERDATA
Flash Filename: userdata.img
FOTA Filename: remained

Ending session...
Rebooting device...
Releasing device interface...

And then the phone rebooted. So I shut down the phone again, and again went into download mode by pressing Volume down, the Bixby button, and Power button to power it on. Again, the screen was green with a download icon and lots of text, so I released all of the buttons, and per the on screen instructions, pressed volume up to allow changes.

Now from my computer terminal, I typed:

$ heimdall flash --RECOVERY ./lineage-17.1-20200615-recovery-starlte.img --no-reboot
Heimdall v1.4.1

Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
Releasing device interface...

Now the phone showed a load bar across the screen. It was finished as soon as I saw it, so it was pretty fast. Then, I unplugged the USB cable, and per the instructions on the screen, held Volume Down and the Power button for 7 seconds to get out of download mode. As soon as it switched off, I held the Volume Up button with the Bixby button, and the Power button to go into recovery mode. This is important, because if you let it boot all the way into the stock ROM, it will wipe the recovery you just loaded. After a second or two, I could see the pink LineageOS recovery screen, and I plugged back in the USB cable to the computer.

On the phone, I used the volume keys and power button to select “Apply update” and “ADB sideload”. Then, on the computer terminal, I typed:

$ adb sideload ./lineage-17.1-20200615-nightly-starlte-signed.zip
serving: ‘./lineage-17.1-20200615-nightly-starlte-signed.zip’ (~17%)

To which it proceeded to 47%, and the phone screen had small white text at the bottom with status, eventually stating “script succeeded: result was [1.000000]” and giving me a prompt back on the phone screen and computer terminal.

At this point, I could install Magisk or Gapps, but in this case the owner of the phone wanted to install only LineageOS. So, I pressed the back arrow at the top of the phone screen, and tapped “Reboot System Now”. The phone rebooted and immediately showed me the LineageOS boot logo, and then a pop up asking me to wipe all encrypted data. I said yes, the phone rebooted to wipe the data, then rebooted back to LineageOS. Success!

One final note, when I started this process, the battery was at 100%, but by the time I finished, the battery was down to 67%, so be sure to fully charge the phone before you start this process, if you intend to follow along.

Linux – keep it simple.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s