Jump to content

OnePlus 5 (oneplus-cheeseburger): Difference between revisions

From postmarketOS Wiki
Deathmist (talk | contribs)
m NFC read/write confirmed working with neard/nfctool
m packaged = yes
 
(34 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Infobox device
{{Infobox device
| booting = yes
| packaged = yes
| status = Maintained, supported and upstream!
| image = File:OnePlus-5-Phosh-Mainline.jpg
| imagecaption = OnePlus 5T with Phosh on 5.15.0 mainline kernel!
| manufacturer = OnePlus
| manufacturer = OnePlus
| name = 5/5T
| name = 5
| codename = oneplus-cheeseburger, oneplus-dumpling
| codename = oneplus-cheeseburger
| image = File:OnePlus-5-Phosh-Mainline.jpg
| imagecaption =
| releaseyear = 2017
| releaseyear = 2017
| originalsoftware = Android 7.1.1 (up to Android 10) on Linux 4.4
| category = testing
| chipset = Qualcomm MSM8998 Snapdragon 835
| originalsoftware = Android
| cpu = 4x 2.45 GHz Cortex-A73 + 4x 1.90 GHz Cortex-A53
| originalversion = 7.1.1
| extendedversion = 10 (on Linux 4.4)
| pmoskernel = 6.0
<!-- Hardware -->
| chipset = Qualcomm Snapdragon 835 (MSM8998)
| cpu = Octa-core (4x 2.45 GHz Kryo 280 Gold + 4x 1.9 GHz Kryo 280 Silver)
| gpu = Adreno 540
| gpu = Adreno 540
| display = 1080x1920/1080x2160 Optic AMOLED (5/5T)
| display = 1080x1920 Optic AMOLED
| storage = 64 or 128 GB UFS 2.1
| storage = 64/128 GB UFS 2.1
| memory = 6 or 8 GB LPDDR4X RAM
| memory = 6/8 GB LPDDR4X RAM
| architecture = aarch64
| architecture = aarch64
<!-- the following status_* questions should be answered with Y - yes, P - partial, N - no, or left blank (for untested or unknown) -->
| type = handset
| whet_dhry = 3919.7
<!-- Features: the following status_* questions should be answered with Y - yes, P - partial, N - no, or left blank (for untested or unknown) -->
| status_usbnet = Y
| status_usbnet = Y
| status_flashing = Y
| status_flashing = Y
Line 25: Line 35:
| status_battery = Y
| status_battery = Y
| status_3d = Y
| status_3d = Y
| status_accel = N <!-- The sensor that measures proper acceleration works -->
| status_audio = N <!-- Using the device's speakers/headphone jack works -->
| status_audio = N <!-- Using the device's speakers/headphone jack works -->
| status_bluetooth = Y
| status_bluetooth = Y
Line 31: Line 40:
| status_gps = Y
| status_gps = Y
| status_mobiledata = N <!-- Connecting to the Internet via cellular network. -->
| status_mobiledata = N <!-- Connecting to the Internet via cellular network. -->
| status_emmc = Y
| status_sms = N <!-- Sending and receiving short messages works as intended. -->
| status_sms = N <!-- Sending and receiving short messages works as intended. -->
| status_calls = N <!-- Talking to other people over the cellular network. -->
| status_calls = N <!-- Talking to other people over the cellular network. -->
| status_otg = Y
| status_otg = N <!-- Works with downstream kernel, not working on mainline after setting usb3_dwc3 dr_mode = "host" + powered USB hub: {{issue|2762|pmaports}} -->
| status_nfc = Y
| status_nfc = Y
| booting = yes
<!-- Sensors -->
| status_accel = N <!-- The sensor that measures proper acceleration works -->
| status_magnet = N
| status_light = N
| status_proximity = N
| status_hall = Y
<!-- Misc -->
| status_irtx = -
| status_irtx = -
 
| status_trustzone = N
<!-- you can also use these lines if you need to:
see Unixbench page on wiki
| whet_dhry = 0.0
-->
}}
}}
{{Based on SoC|Qualcomm_Snapdragon_835_(MSM8998)|Snapdragon 835}}


== Contributors ==
The OnePlus 5T is very similar to the OnePlus 5; for information specific to the 5T, also read [[OnePlus 5T (oneplus-dumpling)]].
* deathmist
* R0551 (mainlining)
 
== Maintainer(s) ==
deathmist
<!-- Only if this device doesn't run on linux-postmarketos yet! -->
<!-- This person needs to be willing to answer questions from users of this device -->


== Users owning this device ==
== Entering fastboot mode ==
{{Device owners}}
<!--
If you own this device, you can add the text below or something similar under your user profile:
== Owns Devices ==
{{Owns device|OnePlus_5_(oneplus-cheeseburger)|Additional notes by you e.g. Broken touchscreen digitizer}}
{{My devices}}
-->
== Fastboot mode ==
The OnePlus 5/5T uses <code>fastboot</code> as its flashing protocol.
The OnePlus 5/5T uses <code>fastboot</code> as its flashing protocol.


To enter fastboot mode, hold {{button|Volume Up}} while powering on the device. Release the button when <code>FastBoot Mode</code> can be seen on the display.
Unplug from USB, hold {{Button|Power}} and {{Button|Volume Up}} until you see <code>FastBoot Mode</code> text.


== Installation ==
== Installation ==


=== Unlocking the bootloader ===
=== Prerequisites ===
If your bootloader is still locked at this point, you need to unlock it to proceed.


'''WARNING: Doing this WILL delete all your data on the device as a security precaution, so backup all your data before continuing!'''
==== Fastboot ====
Install <code>fastboot</code> on your host, refer to Google for instructions.


There are plenty of guides online describing how to do this, but the run-down should be as follows:
==== Unlocking the bootloader ====
# Enable <code>Developer options</code> by tapping the build number 7 times in <code>Settings</code> > <code>About</code>
<b>WARNING: Doing this will delete ALL your data on the device, so backup all your data before continuing!</b>
# Go back and enter <code>Developer options</code> to enable both <code>USB Debugging</code> and <code>OEM Unlocking</code>
# Install the <code>android-tools-fastboot</code> or <code>android-tools</code> package depending on your machine's distro
# Power down your OnePlus 5 & enter <code>fastboot</code> mode using the [https://wiki.postmarketos.org/wiki/OnePlus_5_(oneplus-cheeseburger)#Fastboot_mode instructions above this section]
# Open a terminal window and verify your phone is displayed under <code>fastboot devices</code> to continue
# Run <code>fastboot oem unlock</code> and follow the instructions on screen. Navigate menus with {{button|Volume Up/Down}} and select an option with the {{button|Power}} button.
# Congrats, you should now have an unlocked bootloader on your device!


=== Setup build env & create flashables ===
Before flashing postmarketOS you have to unlock your bootloader. The following is all that's needed to do this:
Install <code>[https://wiki.postmarketos.org/wiki/Installing_pmbootstrap pmbootstrap]</code> on your build machine and start following the steps below:
 
1. Go to <code>Settings</code>, <code>About</code> and tap on the <code>Build number</code> 7 times until you get a message saying you are now a developer.
 
2. Go back to <code>Settings</code>, <code>System</code> and <code>Developer options</code> to enable <code>OEM unlocking</code>
 
3. Refer to [[OnePlus 5 (oneplus-cheeseburger)#Entering_fastboot_mode|entering fastboot mode]] above and re-attach the USB cable afterwards. Run the following command on your host:
<div style="width: calc(100%-320px); overflow: auto;">
<div style="width: calc(100%-320px); overflow: auto;">
  pmbootstrap init
  fastboot oem unlock
pmbootstrap install
</div>
</div>
'''NOTICE: Downstream kernel should only be used for sanity testing, see mainline for better overall feature progress!'''
4. Read the message displayed on your device screen, once happy confirm the unlock and continue to installing postmarketOS.


=== Flashing the device ===
=== Installing postmarketOS ===
To begin the flashing process, boot your device to <code>fastboot</code> mode (if you haven't already). The standard flashing process goes as follows:
Follow the usual [[Installation guide|flashing guide via pmbootstrap]].
pmbootstrap flasher flash_rootfs
{{note|<b>NOTE:</b> ONLY choose <code>alpine</code> kernel if you accept it will have MUCH less overall working features, otherwise always pick <code>mainline</code>!<br>
pmbootstrap flasher flash_kernel
Downstream kernel port is also still available as <code>cheeseburger-downstream</code> codename, but usage of it is strongly discouraged and it's completely unmaintained!}}
sudo fastboot reboot


If you instead want to install the pmOS root filesystem on <code>userdata</code> partition (around 56 or 120 GB) instead of the <code>system</code> partition (3 GB), run the following instead as the flash_rootfs command:
== Incorrect touchscreen orientation ==
pmbootstrap flasher flash_rootfs --partition userdata
On some user interfaces such as Plasma Mobile you may have the touchscreen incorrectly oriented by 180 degrees (upside down); to fix that run the following in a <code>root</code> shell:
<div style="width: calc(100%-320px); overflow: auto;">
echo 'ACTION=="add|change", KERNEL=="event[0-9]*", ATTRS{name}=="Synaptics s3508", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"' | sudo tee /etc/udev/rules.d/21-oneplus5-ts.rules
</div>
 
After that simply <code>reboot</code> to apply the new calibration matrix. Now the touchscreen should at least match the incorrectly upside-down display output so you can go in <code>Settings</code> > <code>Display Configuration</code> and select the inverted screen rotation option which will rotate the display to match the expected normal display rotation.
 
I've still not added this as a part of the {{Device package|oneplus-cheeseburger}} because it causes the rotation to be broken in other environments, especially so in Xorg-based ones, but if that really remains the only problematic one perhaps it can be added as a subpackage with some <code>install_if</code> directive.
 
See issue: https://invent.kde.org/teams/plasma-mobile/issues/-/issues/160


During e.g. rapid kernel development you can simply boot the new image instead of always flashing to the device <code>boot</code> partition like so:
Recently (2022-11-15) an MR to <code>kwin</code> was merged that should address this issue: https://invent.kde.org/plasma/kwin/-/merge_requests/2081; could possibly be backported to v5.26.4?
  pmbootstrap flasher boot
 
== Modem stability ==
If Wi-Fi disconnects for any reason (including sleep, signal strength loss etc.) the modem remoteproc will crash and may not recover until a reboot.
 
The [https://cateee.net/lkddb/web-lkddb/QCOM_IPA.html <code>ipa</code> kernel module] has been blocked from auto-loading due to [https://gitlab.com/msm8998-mainline/linux/-/issues/5 causing various overall issues with the system]. If you want to test ModemManager already (since <code>mainline</code> kernel v6.0) though you can just load it manually:
 
$ sudo modprobe ipa
  $ sudo rc-service modemmanager restart


== LEDs ==
== LEDs ==
Currently you can control a whole bunch of the LEDs present on the device via <code>sysfs</code> by writing values to their brightness control files as <code>root</code>:
The LEDs present on the device can be controlled via <code>sysfs</code> by writing values to their brightness control files as <code>root</code>. Here are some examples:


Screen brightness (0-255) can be adjusted:
Screen backlight brightness (0-255, 0-1023 on 5T)
<code>echo 255 > /sys/class/leds/lcd-backlight/brightness</code>
<div style="width: calc(100%-320px); overflow: auto;">
echo 255 > /sys/class/backlight/c994000.dsi0/brightness
</div>


The backlight for physical buttons can be enabled (1) or disabled (0):
Notification light brightness (0-255)
<code>echo 1 > /sys/class/leds/button-backlight/brightness</code>
<div style="width: calc(100%-320px); overflow: auto;">
echo 255 > /sys/class/leds/notification-led/brightness
</div>


Notification light color & brightness (0-255) are controllable:
Notification light color (0-255, R G B), e.g. green
* Red: <code>echo 255 > /sys/class/leds/red/brightness</code>
<div style="width: calc(100%-320px); overflow: auto;">
* Green: <code>echo 255 > /sys/class/leds/green/brightness</code>
echo 0 255 0 > /sys/class/leds/notification-led/multi_intensity
* Blue: <code>echo 255 > /sys/class/leds/blue/brightness</code>
</div>


Control of the rear camera flashlight (<code>/sys/class/leds/torch-light*/brightness</code>) seems to be broken via sysfs anyway right now.
The backlight for capacitive buttons can be enabled (1) or disabled (0)
<div style="width: calc(100%-320px); overflow: auto;">
echo 1 > /sys/class/leds/white\:kbd_backlight/brightness
</div>
 
Control of the rear camera flashlight isn't yet possible; it's missing a driver on mainline.


== Partition layout ==
== Partition layout ==
<div class="toccolours mw-collapsible mw-collapsed" style="width: 620px; overflow: auto;">
<div class="toccolours mw-collapsible mw-collapsed" style="width: 650px; overflow: auto;">
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sda</code>
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sda</code>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
Line 146: Line 166:
</div>
</div>
</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed" style="width: 620px; overflow: auto;">
<div class="toccolours mw-collapsible mw-collapsed" style="width: 650px; overflow: auto;">
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdb</code>
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdb</code>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
Line 161: Line 181:
</div>
</div>
</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed" style="width: 620px; overflow: auto;">
<div class="toccolours mw-collapsible mw-collapsed" style="width: 650px; overflow: auto;">
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdc</code>
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdc</code>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
Line 176: Line 196:
</div>
</div>
</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed" style="width: 620px; overflow: auto;">
<div class="toccolours mw-collapsible mw-collapsed" style="width: 650px; overflow: auto;">
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdd</code>
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdd</code>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
Line 194: Line 214:
</div>
</div>
</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed" style="width: 620px; overflow: auto;">
<div class="toccolours mw-collapsible mw-collapsed" style="width: 650px; overflow: auto;">
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sde</code>
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sde</code>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
Line 256: Line 276:
</div>
</div>
</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed" style="width: 620px; overflow: auto;">
<div class="toccolours mw-collapsible mw-collapsed" style="width: 650px; overflow: auto;">
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdf</code>
<code>oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdf</code>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
Line 279: Line 299:
</div>
</div>


<!-- add more sections below as necessary, e.g. Wifi, photos, ... -->
== Community Info ==
 
=== postmarketOS users that own the device ===
{{Device owners}}
<!--
 
If you own this device, you can add the text below or something similar under your user profile:
== Owns Devices ==
{{Owns device|OnePlus_5_(oneplus-cheeseburger)|Additional notes by you e.g. Broken touchscreen digitizer}}
{{My devices}}


== Links ==
-->
=== Maintainers ===
* [[User:Deathmist|Deathmist]]
 
=== Contributors ===
* [[User:Deathmist|Deathmist]]
* R0551 (mainlining)
 
== See also ==
* {{Device package|oneplus-cheeseburger}}
* {{Kernel package|postmarketos-qcom-msm8998}} (<code>mainline</code>) or alternatively {{aport|linux-edge}} (<code>alpine</code>)
* {{Firmware package|oneplus-msm8998}}
* {{MR|3336|pmaports}} Alpine linux-edge enablement merge request
* {{MR|2591|pmaports}} Mainline enablement merge request
* {{MR|908|pmaports}} Initial merge request
* {{MR|908|pmaports}} Initial merge request
* {{MR|1110|pmaports}} OnePlus 5T merge request
* {{MR|2591|pmaports}} Mainline enablement merge request
* [https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/device-oneplus-cheeseburger OnePlus 5 device package]
* [https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/device-oneplus-dumpling OnePlus 5T device package]
* [https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/linux-oneplus-msm8998 Shared kernel package]
* [https://github.com/LineageOS/android_kernel_oneplus_msm8998 LineageOS downstream kernel fork]
* [https://gitlab.com/msm8998-mainline/linux Close to mainline kernel source]
* [https://gitlab.com/msm8998-mainline/linux Close to mainline kernel source]
* [https://github.com/torvalds/linux Linux mainline kernel source (torvalds)]
* [https://github.com/torvalds/linux Linux mainline kernel source (torvalds)]
* [[Qualcomm_Snapdragon_835_(MSM8998)|Qualcomm Snapdragon 835 (MSM8998) SoC mainline page]]
* [https://github.com/LineageOS/android_kernel_oneplus_msm8998 LineageOS downstream kernel fork]
* [https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/master/device/unmaintained/linux-oneplus-msm8998-downstream Unmaintained postmarketOS downstream kernel package]
* {{wikipedia|OnePlus_5|Wiki page for device}}
* [[OnePlus 5T (oneplus-dumpling)]]

Latest revision as of 14:02, 3 April 2025

OnePlus 5
OnePlus 5T with Phosh on 5.15.0 mainline kernel!
OnePlus 5T with Phosh on 5.15.0 mainline kernel!
Manufacturer OnePlus
Name 5
Codename oneplus-cheeseburger
Released 2017
Type handset
Hardware
Chipset Qualcomm Snapdragon 835 (MSM8998)
CPU Octa-core (4x 2.45 GHz Kryo 280 Gold + 4x 1.9 GHz Kryo 280 Silver)
GPU Adreno 540
Display 1080x1920 Optic AMOLED
Storage 64/128 GB UFS 2.1
Memory 6/8 GB LPDDR4X RAM
Architecture aarch64
Software
Original software Android
Original version 7.1.1
Extended version 10 (on Linux 4.4)
postmarketOS
Category testing
Pre-built images no
Mainline yes
postmarketOS kernel 6.0
Unixbench Whet/Dhry score 3919.7
Features
Flashing
Works
USB Networking
Works
Internal storage
Works
SD card
No data
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Broken
Camera
Broken
Camera Flash
No data
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Works
NFC
Works
Modem
Calls
Broken
SMS
Broken
Mobile data
Broken
Miscellaneous
FDE
Works
USB OTG
Broken
HDMI/DP
No data
Sensors
Accelerometer
Broken
Magnetometer
Broken
Ambient Light
Broken
Proximity
Broken
Hall Effect
Works
Haptics
No data
Barometer
No data

The OnePlus 5T is very similar to the OnePlus 5; for information specific to the 5T, also read OnePlus 5T (oneplus-dumpling).

Entering fastboot mode

The OnePlus 5/5T uses fastboot as its flashing protocol.

Unplug from USB, hold Power and Volume Up until you see FastBoot Mode text.

Installation

Prerequisites

Fastboot

Install fastboot on your host, refer to Google for instructions.

Unlocking the bootloader

WARNING: Doing this will delete ALL your data on the device, so backup all your data before continuing!

Before flashing postmarketOS you have to unlock your bootloader. The following is all that's needed to do this:

1. Go to Settings, About and tap on the Build number 7 times until you get a message saying you are now a developer.

2. Go back to Settings, System and Developer options to enable OEM unlocking

3. Refer to entering fastboot mode above and re-attach the USB cable afterwards. Run the following command on your host:

fastboot oem unlock

4. Read the message displayed on your device screen, once happy confirm the unlock and continue to installing postmarketOS.

Installing postmarketOS

Follow the usual flashing guide via pmbootstrap.

Note NOTE: ONLY choose alpine kernel if you accept it will have MUCH less overall working features, otherwise always pick mainline!
Downstream kernel port is also still available as cheeseburger-downstream codename, but usage of it is strongly discouraged and it's completely unmaintained!

Incorrect touchscreen orientation

On some user interfaces such as Plasma Mobile you may have the touchscreen incorrectly oriented by 180 degrees (upside down); to fix that run the following in a root shell:

echo 'ACTION=="add|change", KERNEL=="event[0-9]*", ATTRS{name}=="Synaptics s3508", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"' | sudo tee /etc/udev/rules.d/21-oneplus5-ts.rules

After that simply reboot to apply the new calibration matrix. Now the touchscreen should at least match the incorrectly upside-down display output so you can go in Settings > Display Configuration and select the inverted screen rotation option which will rotate the display to match the expected normal display rotation.

I've still not added this as a part of the Device package because it causes the rotation to be broken in other environments, especially so in Xorg-based ones, but if that really remains the only problematic one perhaps it can be added as a subpackage with some install_if directive.

See issue: https://invent.kde.org/teams/plasma-mobile/issues/-/issues/160

Recently (2022-11-15) an MR to kwin was merged that should address this issue: https://invent.kde.org/plasma/kwin/-/merge_requests/2081; could possibly be backported to v5.26.4?

Modem stability

If Wi-Fi disconnects for any reason (including sleep, signal strength loss etc.) the modem remoteproc will crash and may not recover until a reboot.

The ipa kernel module has been blocked from auto-loading due to causing various overall issues with the system. If you want to test ModemManager already (since mainline kernel v6.0) though you can just load it manually:

$ sudo modprobe ipa
$ sudo rc-service modemmanager restart

LEDs

The LEDs present on the device can be controlled via sysfs by writing values to their brightness control files as root. Here are some examples:

Screen backlight brightness (0-255, 0-1023 on 5T)

echo 255 > /sys/class/backlight/c994000.dsi0/brightness

Notification light brightness (0-255)

echo 255 > /sys/class/leds/notification-led/brightness

Notification light color (0-255, R G B), e.g. green

echo 0 255 0 > /sys/class/leds/notification-led/multi_intensity

The backlight for capacitive buttons can be enabled (1) or disabled (0)

echo 1 > /sys/class/leds/white\:kbd_backlight/brightness

Control of the rear camera flashlight isn't yet possible; it's missing a driver on mainline.

Partition layout

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sda

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdb

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdc

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdd

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sde

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdf

Community Info

postmarketOS users that own the device

Maintainers

Contributors

See also