How to find device-specific information

= Android =

Generic device information

 * LineageOS devices database (hardware specs: architecture, screen resolution, ... and key combinations for flash/recovery mode)
 * Use the "cat /proc/cpuinfo" in terminal to get some CPU information.

Fastboot (boot.img) flash offsets
If you can't find a full ROM image for your device, consider extracting the boot.img file directly from your device with adb.

 Find the download link for a full image on https://download.lineageos.org/  Run the following commands (replace the download link accordingly) pmbootstrap build mkbootimg-osm0sis pmbootstrap chroot apk add mkbootimg-osm0sis su - user mkdir /tmp/bootimg_info cd /tmp/bootimg_info wget &quot;https://mirrorbits.lineageos.org/full/hammerhead/20170530/lineage-14.1-20170530-nightly-hammerhead-signed.zip&quot; unzip *.zip unpackbootimg -i boot.img   Example output: Android magic found at: 0 BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1 androidboot.bootdevice=msm_sdcc.1 buildvariant=userdebug BOARD_KERNEL_BASE 00008000 BOARD_RAMDISK_OFFSET 02900000 BOARD_SECOND_OFFSET 00f00000 BOARD_TAGS_OFFSET 02700000 BOARD_PAGE_SIZE 2048 BOARD_SECOND_SIZE 0 BOARD_DT_SIZE 0 

Translate the variables as follows into your deviceinfo:


 * -&gt;
 * -&gt;
 * -&gt;
 * -&gt;
 * -&gt;
 * -&gt;
 * and  can both be ignored
 * (contents of the extracted  file) -&gt;   (defaults to  )

-

NOTE: Some useful info can be pulled via fastboot too (in case you have the device at hand) by executing 

Kernel version

 * Look at the Makefile inside the kernel repository

Device Architecture

 * You can find the architecture while the device is running another kernel (e.g. original Android or TWRP). Run  to gain access to the console on the device, and type.
 * pmOS supports the,  , and   architectures. If the output is  , for example, you should use   as your device architecture.

Device code name

 * firmware.mobi
 * LineageOS List
 * List for Samsung Galaxy Devices
 * List of supported devices of Android by Google
 * Android library to get device name (json database file replaced with binary db file)
 * You can also find the code name by looking for  or   in   on a running Android system (e.g. through  ) or in an extracted system.img (Android recovery zips work too).

LineageOS kernel source repository

 * Find out the code name of your device (see above)
 * Usually, you can find the kernel source repository by typing in the code name of your device into the LineageOS GitHub page
 * If you can't find it, but you found a repository starting with, open that repository and look into the   file. It lists other LineageOS repositories there - open these repositories, until you finally find the repository with &quot;kernel&quot; in the name. Example: First, Second, Third: Kernel repo!

Other locations for kernel repositories

 * CyanogenMod (same instructions as for LinageOS)
 * legacyxperia project
 * Samsung Opensource Release Center
 * LG Electronics Open Source Distribution system
 * Xiaomi Open Source Kernel Repository
 * TWRP
 * Download a working recovery OS (TWRP/CWM), and extract the Linux version string from the kernel, then search for that kernel on GitHub / on the web
 * Rockchip Linux (Note there are multiple branches for different versions of the Linux Kernel, and  branches might work better than   branches)

Kernel defconfig (default config)

 * line inside the  inside the kernel repository (if available) (example)
 * Official listing
 * If you found the  repository (as shown in LineageOS kernel source repository above), look for a   line in the BoardConfig.mk.
 * If you've got the stock, you can try to extract the config from this kernel, either on your pc using this script or by booting in postmarketOS with a prebuilt kernel and then extracting the config from the running system.

In the case where you have located the kernel source for your device but there is no, have a look at the   directory. E.g. for Moto G 2014 &quot;titan&quot; that uses android_kernel_motorola_msm8226 you have a titan_defconfig file there.

Misc info from BoardConfig.mk
Example, contains the following information:


 * kernel commandline
 * ramdisk offset, tags offset, pagesize, base
 * boot partition size

Firmware files
See Firmware.

Device tree source (dts)
If you can't find the proper dts anywhere, and typical sources like LineageOS or TWRP are just appending a binary blob (dtb, device tree blob), it should be possible to decompile that blob and add it as patch to your linux package. It was done like this in for example. From a license perspective, this should also be fine, because the Linux kernel is released under the GPLv2.