Jump to content

OnePlus 5 (oneplus-cheeseburger): Difference between revisions

From postmarketOS Wiki
Deathmist (talk | contribs)
m Update with current mainline status
update to gitlab.postmarketos.org
(39 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Infobox device
{{Infobox device
| booting = 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-Sxmo-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 23: Line 32:
| status_fde = Y
| status_fde = Y
| status_mainline = Y
| status_mainline = Y
| status_battery = N <!-- Charging the battery with charging-sdl is possible -->
| 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 39:
| 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 = N <!-- Read/write communication with NFC tags etc. -->
| status_nfc = Y
| booting = yes
<!-- Sensors -->
 
| status_accel = N <!-- The sensor that measures proper acceleration works -->
<!-- you can also use these lines if you need to:
| status_magnet = N
see Unixbench page on wiki
| status_light = N
| whet_dhry = 0.0
| status_proximity = N
-->
| status_hall = Y
<!-- Misc -->
| status_irtx = -
| status_trustzone = N
}}
}}
{{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.
 
==== Fastboot ====
Install <code>fastboot</code> on your host, refer to Google for instructions.
 
==== Unlocking the bootloader ====
<b>WARNING: Doing this will delete ALL your data on the device, so backup all your data before continuing!</b>


'''WARNING: Doing this WILL delete all your data on the device as a security precaution, 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:


There are plenty of guides online describing how to do this, but the run-down should be as follows:
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.
# Enable <code>Developer options</code> by tapping the build number 7 times in <code>Settings</code> > <code>About</code>
# 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 ===
2. Go back to <code>Settings</code>, <code>System</code> and <code>Developer options</code> to enable <code>OEM unlocking</code>
Install <code>[https://wiki.postmarketos.org/wiki/Installing_pmbootstrap pmbootstrap]</code> on your build machine and start following the steps below:
 
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: Both <code>phosh</code> and <code>plasma-mobile</code> are NOT working at all currently; this should be solved later by mainlining and using the <code>freedreno</code> DRM driver for graphics & <code>mesa</code> 3D acceleration.'''
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>


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:
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.
  pmbootstrap flasher boot
 
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
 
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?
 
== 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 backlight brightness (0-255, 0-1023 on 5T)
<div style="width: calc(100%-320px); overflow: auto;">
echo 255 > /sys/class/backlight/c994000.dsi0/brightness
</div>


Screen brightness (0-255) can be adjusted:
Notification light brightness (0-255)
<code>echo 255 > /sys/class/leds/lcd-backlight/brightness</code>
<div style="width: calc(100%-320px); overflow: auto;">
echo 255 > /sys/class/leds/notification-led/brightness
</div>


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


Notification light color & brightness (0-255) are controllable:
The backlight for capacitive buttons can be enabled (1) or disabled (0)
* 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 1 > /sys/class/leds/white\:kbd_backlight/brightness
* 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.
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 145: Line 165:
</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 160: Line 180:
</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 175: Line 195:
</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 193: Line 213:
</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 255: Line 275:
</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 278: Line 298:
</div>
</div>


<!-- add more sections below as necessary, e.g. Wifi, photos, ... -->
== Community Info ==


== Mainline kernel ==
=== postmarketOS users that own the device ===
This is heavily W.I.P currently, but it's coming along quite nicely. [https://imgur.com/a/Tb3LAK7 Here is an imgur gallery with some of the progress showcased]!
{{Device owners}}
<!--


Here's a list of stuff that is currently (Linux 5.11-rc4) known to be working (in at least some capacity):
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}}


* UFS internal storage (<code>CONFIG_PHY_QCOM_UFS=y</code>)
-->
* Display (via [https://github.com/JamiKettunen/linux-mainline-oneplus5/commit/b54a7b03cbeb115ed6b5b7c6220a790c77271506 <code>simplefb</code>] & <code>CONFIG_FB_SIMPLE=y</code>)
=== Maintainers ===
* Xorg & Wayland (tested with [https://i.imgur.com/VgsaOtY.jpg MATE] & [https://i.imgur.com/dLItMIm.jpg Weston] respectively)
* [[User:Deathmist|Deathmist]]
* Bluetooth (requires <code>crbtfw21.tlv</code> and <code>crnv21.bin</code> blobs from [https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/qca linux-firmware] + a <code>rc-update add bluetoothd default</code> in userspace along with the relevant <code>bluez</code> packages)
* Touchscreen (using mainline Synaptics RMI4 I2C driver; [https://github.com/JamiKettunen/linux-mainline-oneplus5/commit/6cfe1d217457ecdf16eb8250f7a7da4acf188ad6 definition in DTS] + [https://github.com/JamiKettunen/linux-mainline-oneplus5/commit/54b1c972561d087851f3bf61dd86e203f87ec8bd relevant defconfig changes])
* Anbox (install <code>postmarketos-anbox</code>; [https://github.com/JamiKettunen/linux-mainline-oneplus5/commit/392d26fea261cc9b7264997d2c1df79b919bee02 defconfig changes I made for LXC stuff])
* Power button ([https://github.com/JamiKettunen/linux-mainline-oneplus5/blob/wiki/arch/arm64/boot/dts/qcom/pm8998.dtsi#L41-L55 in DTS])
* Volume keys ([https://github.com/JamiKettunen/linux-mainline-oneplus5/commit/51d74de3a157ee8861f5961895a3163498c15260 added under MSM8998 PMIC GPIOs])
* Keypad backlight (only applicable to regular OnePlus 5; [https://github.com/JamiKettunen/linux-mainline-oneplus5/commit/518b4fa6d8874815a7652e78cc59560675829884 added under MSM8998 PMIC GPIOs] & controllable with <code>/sys/class/leds/button-backlight/brightness</code>)
* RTC alarms (<code>CONFIG_RTC_DRV_PM8XXX=y</code>)
* Wi-Fi (it's a bit complicated, see the [https://wiki.postmarketos.org/wiki/Qualcomm_Snapdragon_835_(MSM8998)#WLAN MSM8998 SoC wiki about WLAN]; needs most firmware files [https://github.com/JamiKettunen/firmware-mainline-oneplus5 in this repo] to be present under <code>/lib/firmware/</code>)
* USB in peripheral mode (so e.g. SSH to device while plugged to host works; [https://github.com/JamiKettunen/linux-mainline-oneplus5/commit/489b48b2aba961737a3c435c3333780c2f54050a had to up the <code>l24</code> regulator voltage from 1,84V to 3,08V])
* GPS is working via [https://gitlab.com/gpsd/gpsd/-/merge_requests/139 GPSD w/ PDS support], see the [https://wiki.postmarketos.org/wiki/Qualcomm_Snapdragon_835_(MSM8998)#GPS MSM8998 SoC wiki about GPS]


And that's about it for now. [https://github.com/SoMainline/linux/commits/angelo/somainline-msm8998-bringup DSI display along with GPU drivers are being worked on by SoMainline], so hopefully soon these will become usable subsystems on mainline MSM8998! :)
=== Contributors ===
 
* [[User:Deathmist|Deathmist]]
Check the links below for source code.
* R0551 (mainlining)
 
=== Building ===
It's easiest to build mainline (for pmOS anyway) with [https://wiki.postmarketos.org/wiki/Mainlining_Guide#pmbootstrap_setup pmbootstrap], so get that setup and remember the install location (in this guide <code>~/pmOS/pmbootstrap</code> is an example).
 
After you've run through the [https://wiki.postmarketos.org/wiki/OnePlus_5_(oneplus-cheeseburger)#Installation installation steps found on this site at least once] please <code>pmbootstrap extract</code> & save the produced downstream <code>boot.img</code> to a known location as we'll reuse the initramfs found inside later.
 
Next start following the instructions below:
 
  git clone https://github.com/JamiKettunen/linux-mainline-oneplus5
  cd linux-mainline-oneplus5/
  source ~/pmOS/pmbootstrap/helpers/envkernel.sh    # adjust to match where you've cloned PMB yourself
  make defconfig
  make -j`nproc`
 
=== Boot image generation ===
Now that the kernel image and DTBs have been built we can assemble a bootable Android-friendly boot.img (assuming you're still in the root of the cloned kernel dir):
 
  pmbootstrap chroot -- apk add abootimg android-tools mkbootimg dtbtool
  export DEVICE=`pmbootstrap config device | cut -d'-' -f2` WORK=`pmbootstrap config work` PMOS_BOOT_IMG_PATH="~/pmOS/downstream-boot.img"
  export TEMP="$WORK/chroot_native/tmp/mainline/" DTB="$PWD/.output/arch/arm64/boot/dts/qcom/msm8998-$DEVICE.dtb"
  rm -r "$TEMP"; mkdir -p "$TEMP"
  cat .output/arch/arm64/boot/Image.gz "$DTB" > "$TEMP/Image.gz-dtb"
  cp "$PMOS_BOOT_IMG_PATH" "$TEMP/boot.img"          # replace "$PMOS_BOOT_IMG_PATH" with the known location of a pmOS downstream boot.img
  pmbootstrap chroot -- abootimg -u /tmp/mainline/boot.img -k /tmp/mainline/Image.gz-dtb -c "bootsize=67108864"
 
At this point you get to choose whether to <code>boot</code> the new kernel image or more "permanently" <code>flash</code> it on the device's boot partition instead ^^
 
Boot: <code>pmbootstrap chroot -- fastboot boot /tmp/mainline/boot.img</code>
 
Flash: <code>pmbootstrap chroot -- fastboot flash boot /tmp/mainline/boot.img</code>
 
'''NOTE: Sometimes running <code>pmbootstrap flasher list_devices</code> once is needed to get the device detected in fastboot mode!'''


== Links ==
== 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
* [https://gitlab.com/msm8998-mainline/linux Close to mainline kernel source]
* [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/android-linux-stable/op5/tree/lineage-17.1 LineageOS downstream kernel fork]
* [https://github.com/JamiKettunen/linux-mainline-oneplus5 Device mainline kernel W.I.P source (deathmist)]
* [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)]]

Revision as of 08:01, 4 November 2024

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