How to add a new device to the wiki
Requirements for adding a device
The LineageOS wiki provides instructions based on the assumption that your device has got its device tree/kernel under the LineageOS GitHub organization, and that it supports building LineageOS 21 or higher. If your device meets both those requirements, follow the instructions below to get your device set up.
Setting up the wiki locally
See contributing using repo for detailed instructions on setting up the wiki locally.
Adding your device
Prepare the required files
There are a few files which need to be there to have a device on the wiki.
In order to get them, navigate to $LINEAGE_SRC/lineage/wiki/
and run:
./scripts/generate_device.sh your_device
Obviously replace your_device
with the codename of your device
Populating the YAML
The sample template has been copied to $LINEAGE_SRC/lineage/wiki/_data/devices/your_device.yml
.
Update the values to match your device. An explanation of some of the options is below.
Some of the properties allow specifying different values for multiple models being covered in the same file. In that case the format stays the same as for a single device, but is used in a Key-Value style like this:
property:
- Model1: Value
- Model2: Value
An example using the battery
property:
Just one device:
battery: {removable: False, capacity: 1000, tech: 'Li-Ion'}
vs. two different models:
battery:
- Model1: {removable: False, capacity: 1000, tech: 'Li-Ion'}
- Model2: {removable: True, capacity: 2000, tech: 'Li-Po'}
The following list will mention Model-Value pairs where applicable.
List of properties
-
architecture
: The CPU architecture of the device, can be one ofarm, arm64, x86, x86_64
If your device has a 64 bit architecture but Android runs on 32 bit, you can use a different format:
{cpu: 'arm64', userspace: 'arm'}
-
battery
: Use the format{removable: False, capacity: <number in mAh>, tech: '<tech>'}
. If your battery is removable, useTrue
instead. Fortech
you can use:Li-Ion, Li-Po
This property supports Model-Value pairs.
-
bluetooth
: The proper format is either{spec: '<version>'}
withversion
being the version of the BT protocol supported, or{spec: '<version>', profiles: '<profiles>'}
when your device supports additional profiles. These are the possible values:For the specification: None, 1.0, 1.0B, 1.1, 1.2, 2.0, 2.0 + EDR, 2.1, 2.1 + EDR, 3.0, 3.0 + HS, 4.0, 4.0 + LE, 4.1, 4.2, 5, 5.1, 5.2, 5.3, 5.4 For the optional profiles: A2DP, A2DP + aptX, A2DP + aptX HD
-
camera
: One entry for each camera in the format- {flash: '<flash>', info: 'x MP'}
with
flash
being one ofDual LED, Dual LED (dual tone), LED, None
and
info
in the formatx MP
orx MP (wide)
(wide, ultrawide, depth, etc. can be used), orx MP (Model1) or x MP (Model2)
if necessary -
cpu
: The CPU type of the device, can be one of the following list:Cortex-A15, Cortex-A15 & Cortex-A7, Cortex-A53, Cortex-A53 & Cortex-A53, Cortex-A53 & Cortex-A57, Cortex-A53 & Cortex-A72, Cortex-A55, Cortex-A57, Cortex-A7, Cortex-A710 & Cortex-A510, Cortex-A72, Cortex-A73 & Cortex-A53, Cortex-A75 & Cortex-A55, Cortex-A76 & Cortex-A55, Cortex-A9, Cortex-X1 & Cortex-A76 & Cortex-A55, Cortex-X1 & Cortex-A78 & Cortex-A55, Cortex-X2 & Cortex-A710 & Cortex-A510, Cortex-X3 & Cortex-A715 & Cortex-A510, Denver, Denver 2 & Cortex-A57, Exynos M1 & Cortex-A53, Exynos M3 & Cortex-A55, Exynos M4 & Cortex-A75 & Cortex-A55, Intel Atom, Krait, Krait 200, Krait 300, Krait 400, Krait 450, Kryo, Kryo 240, Kryo 250, Kryo 260, Kryo 265, Kryo 280, Kryo 360, Kryo 385, Kryo 460, Kryo 465, Kryo 465 Gold & Kryo 465 Silver, Kryo 468, Kryo 470, Kryo 475, Kryo 485, Kryo 490, Kryo 495, Kryo 560, Kryo 570, Kryo 585, Kryo 660, Kryo 670, Kryo 680, Kryo 780
dimensions
: Use the format{width: <w>, height: <h>, depth: <d>}
with each being the dimension in [mm]. This property supports Model-Value pairs.download_boot
: Instructions for booting the device into the mode used to install recovery. On most devices, this is fastboot mode.image
: The image located underimages/devices/
to use for this device. Instructions on adding an image can be found below.-
install_method
: Used to determine the recovery install template to use. Templates can be found in _includes/templates/recovery_install_install_method
.md and must be one of:apx, amlogic_update, dd, edl_custom, fastboot_custom, fastboot_fairphone, fastboot_generic, fastboot_htc, fastboot_huawei, fastboot_lenovo, fastboot_lg, fastboot_motorola, fastboot_nexus, fastboot_nokia, fastboot_nubia, fastboot_oppo, fastboot_sony, fastboot_realme, fastboot_unlocked, fastboot_xiaomi, fastboot_zenfone, heimdall, nintendo, odin, oor
kernel
: Use the format{repo: <repository name>, version: '<major.minor>'}
.network
: The frequencies and channels for the various network technologies. You can look them up here. Keep the non-available technologies empty.-
peripherals
: A list of peripherals available on the device, can be any of the following list:3.5mm jack, A-GPS, Accelerometer, Audio Coprocessor, Barometer, Color spectrum sensor, Compass, DP over USB-C, Depth Sensor, Dock, Dot Projector, Dual SIM, Dual front speakers, Dual speakers, Dual side NFC, Dual-frequency GNSS, Essential Accessories, FM radio, Fingerprint reader, BeiDou, Galileo, GLONASS, GPS, NAVIC, SBAS, QZSS, Gesture sensor, Google Assist Button, Gyroscope, HDMI, Hall effect sensor, Hardware keyboard, Heart rate sensor, Hygrometer, IR blaster, IR camera, IR receiver, Iceview Cases, Joycons, Light sensor, MHL, MHL 2.0, MHL HDMI, Mobility DisplayPort (MyDP), Motion Coprocessor, Moto Mods, NFC, Pedometer, Proximity sensor, Qi wireless charging, Qi reverse wireless charging, Radar, RGB ambient light, RJ45 Ethernet port, SNS integration, Sensor hub, Thermometer, Ultrasound proximity sensor, USB OTG
-
recovery_partition_name
: A partition name recovery image is flashed to, can be one of:boot, recovery, vendor_boot
release
: Allowed formats areyyyy
,yyyy-mm
andyyyy-mm-dd
. This property supports Model-Value pairs.-
screen
: Use{size: '<screen size>', resolution: '<1234x567>', technology: ''}
with number forsize
,1234x567
forresolution
and one of the following values fortechnology
:OLED, P-OLED, AMOLED, Dynamic AMOLED, Fluid AMOLED, Fluid 2.0 LTPO AMOLED, Fluid 3.0 LTPO AMOLED, Optic AMOLED, Super AMOLED, Pentile RGBG AMOLED, Pentile RGBG Super AMOLED, IPS LCD, IPS LTPS LCD, IPS Retinal LCD, IPS+ LCD, Super IPS+ LCD, LCD, Super LCD, PLS LCD, Super PLS LCD, Super clear LCD, TFT LCD
This property supports Model-Value pairs.
tree
: The repo name of the device tree - for example,android_device_oneplus_bacon
.vendor_short
: The vendor name used for the device tree - for example,oneplus
.
List of optional properties
There are some optional properties which you might not need, but in case you do, they are documented below:
before_install
: Sometimes some pre-conditions must be met in order to be able to install LineageOS. See _includes/templates/device_specific/before_install_before_install
.md for possible values.before_lineage_install
: This property can be set to be able to display instructions between recovery and the actual LineageOS installation. Existing (or to be created) values can be found in _includes/templates/device_specific/before_lineage_install_before_lineage_install_
.mdbefore_recovery_install
: Set this property to specify if something has to be done before installing the recovery. Values can be found in _includes/templates/device_specific/before_recovery_install_before_recovery_install_
.mdcarrier
: If the device was released for a specific carrier, the name of that carrier.custom_recovery_link
: A custom recovery link in case no official recovery exists for the specific device or it doesn’t work properly.custom_recovery_codename
: If an official recovery exists for the device, but it uses a different codename, specify the used one here.custom_unlock_cmd
: Used if the command to unlock your device via fastboot is different thanfastboot oem unlock
.format_on_upgrade
: Used if the device needs to wiped on major LineageOS version due to unfixable device specific issues.is_ab_device
: Used if the device has an A/B partition scheme.is_unlockable
: Set to false if there is no official method to unlock the bootloader. A hint will appear on the device’s overview and install page. If this property is not set, it defaults toTrue
quirks
: List of known quirks (make sure they aren’t violating the charter or are exempted!). An array of one or more of the following (if unclear, click the links): ant, atv_remote_mic, aux_cameras, dock, esim, face_unlock, fde, hardware_encryption, ims, nfc, nvidia_remotes, usb-
required_bootloader
: Specify the bootloader versions which are required to install LineageOS. Example:required_bootloader: [Version1, Version2]
sdcard
: Format:{size_max: '<size>'}
or{size_max: '<size>', slot: '<slot>'}
withsize
being a string like32 GB
(checked against a pattern^(\d+ (GB|TB)( \([^)]*\)( or )?)?)+$
) andslot
being one ofdedicated, hybrid, sim
Adding the device’s image
Find a reasonably high-quality image of your device, and add it to images/devices/<image.png>
. You must ensure the following:
- The filename must match the entry
image
in your YAML file - The background of the image is transparent
- The image is cropped to the actual content
- Preferably you remove any cast shadow - if that’s not possible, make sure it doesn’t extend too much beyond the actual device outline
- Optional: If you are already working with the image in an editor, rescale the picture to so the bigger dimension equals 500px (respecting the aspect ratio, keeping the other dimension smaller than that)
Then run
./scripts/prepare_image.sh <image.png>
This will check the image against the maximum size and generate a smaller version of it in images/devices/small/<image.png>
.
The smaller picture also needs to be committed!
Testing it works
Start the wiki on your local Jekyll server, and navigate to the devices list. Your device should be there. Click on it, and check that the info/install/build pages all seem correct.
Now run the validation:
bundle install
ruby ./test/validate.rb
If the script doesn’t give you an output, all the validated fields have a proper format. Otherwise, read the messages carefully to see which fields have to be corrected.
Submitting your device
After verifying the device-specific pages, commit and upload your changes to Gerrit, and add the “Wiki Editors” group as reviewers.