Jump to content

OnePlus 5 (oneplus-cheeseburger)

From postmarketOS Wiki
Revision as of 16:24, 5 November 2021 by Deathmist (talk | contribs) (NFC read/write confirmed working with neard/nfctool)
OnePlus 5/
5T
Manufacturer OnePlus
Name 5/
5T
Codename oneplus-cheeseburger, oneplus-dumpling
Released 2017
Hardware
Chipset Qualcomm MSM8998 Snapdragon 835
CPU 4x 2.45 GHz Cortex-A73 + 4x 1.90 GHz Cortex-A53
GPU Adreno 540
Display 1080x1920/1080x2160 Optic AMOLED (5/5T)
Storage 64 or 128 GB UFS 2.1
Memory 6 or 8 GB LPDDR4X RAM
Architecture aarch64
Software
Original software Android 7.1.1 (up to Android 10) on Linux 4.4
postmarketOS
Category testing
Pre-built images no
Mainline yes
Features
Flashing
Works
USB Networking
Works
Internal storage
No data
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
Works
HDMI/DP
No data
Sensors
Accelerometer
Broken
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data


Contributors

  • deathmist
  • R0551 (mainlining)

Maintainer(s)

deathmist

Users owning this device

Fastboot mode

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

To enter fastboot mode, hold Volume Up while powering on the device. Release the button when FastBoot Mode can be seen on the display.

Installation

Unlocking the bootloader

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!

There are plenty of guides online describing how to do this, but the run-down should be as follows:

  1. Enable Developer options by tapping the build number 7 times in Settings > About
  2. Go back and enter Developer options to enable both USB Debugging and OEM Unlocking
  3. Install the android-tools-fastboot or android-tools package depending on your machine's distro
  4. Power down your OnePlus 5 & enter fastboot mode using the instructions above this section
  5. Open a terminal window and verify your phone is displayed under fastboot devices to continue
  6. Run fastboot oem unlock and follow the instructions on screen. Navigate menus with Volume Up/Down and select an option with the Power button.
  7. Congrats, you should now have an unlocked bootloader on your device!

Setup build env & create flashables

Install pmbootstrap on your build machine and start following the steps below:

pmbootstrap init
pmbootstrap install

NOTICE: Downstream kernel should only be used for sanity testing, see mainline for better overall feature progress!

Flashing the device

To begin the flashing process, boot your device to fastboot mode (if you haven't already). The standard flashing process goes as follows:

pmbootstrap flasher flash_rootfs
pmbootstrap flasher flash_kernel
sudo fastboot reboot

If you instead want to install the pmOS root filesystem on userdata partition (around 56 or 120 GB) instead of the system partition (3 GB), run the following instead as the flash_rootfs command:

pmbootstrap flasher flash_rootfs --partition userdata

During e.g. rapid kernel development you can simply boot the new image instead of always flashing to the device boot partition like so:

pmbootstrap flasher boot

LEDs

Currently you can control a whole bunch of the LEDs present on the device via sysfs by writing values to their brightness control files as root:

Screen brightness (0-255) can be adjusted: echo 255 > /sys/class/leds/lcd-backlight/brightness

The backlight for physical buttons can be enabled (1) or disabled (0): echo 1 > /sys/class/leds/button-backlight/brightness

Notification light color & brightness (0-255) are controllable:

  • Red: echo 255 > /sys/class/leds/red/brightness
  • Green: echo 255 > /sys/class/leds/green/brightness
  • Blue: echo 255 > /sys/class/leds/blue/brightness

Control of the rear camera flashlight (/sys/class/leds/torch-light*/brightness) seems to be broken via sysfs anyway right now.

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


Links