Deviceinfo reference

From postmarketOS
Revision as of 19:32, 13 October 2019 by Ollieparanoid (talk | contribs) (modules_initfs: ext4, usb_f_rndis are always included (
Jump to navigation Jump to search

Most of the variables in deviceinfo have self-explanatory names and are used both when you are building postmarketOS and during runtime (it is available at /etc/deviceinfo).

All variables start with deviceinfo_ in the file - this is omitted here to save space.


Variable Description Possibles values
format_version Used to distinguish between different versions of this file. 0
name Device model e.g. Nokia N900
manufacturer Device manufacturer e.g. Nokia
codename Device codename e.g. nokia-n900
date Release date of the device
keyboard The device has a hardware keyboard. true, false
nonfree Components of the device, that only run with closed source firmware. We have to do more research on this topic and specify a list of possible values, for now all devices have ???? here. ????
dtb Name of the device tree blob file (only used on mainline kernels). See the option append_dtb on how this is used. e.g. allwinner/sun50i-a64-pine64-lts or qcom-msm8974-lge-nexus5-hammerhead
append_dtb Set to true if the dtb should be appended to the Linux kernel image, if set to false the dtb will be copied to the /boot partition instead. (pmaports!387) true, false
modules_initfs Kernel modules to include in the initramfs image. Modules ext4 and usb_f_rndis should not be included in this list, they are always added to the initramfs image if they were built as module (pmaports!673). Note: modules to be loaded after the initramfs can be specified like in a modules-load.conf (example).
external_storage Does the device have an sdcard or other external storage medium? true, false
flash_method Method used to flash the device (more info)
arch Device architecture, must be supported by Alpine Linux armhf, armv7, aarch64, x86, x86_64
dev_touchscreen Path to the touchscreen device (needed for initramfs on-screen-keyboard, more info) e.g. /dev/input/event3
dev_touchscreen_calibration Touchscreen calibration values (only necessary for devices with resistive touchscreen, more info) e.g. 1.094563 -0.020949 -34.586121 0.009427 -1.148506 503.816956
dev_keyboard Path to the keyboard device, if your device has any (needed for initramfs password unlocking) e.g. /dev/input/event1
swap_size_recommended Set recommended swap file size for device. If unset, no swap file will be created for the device. Integer, in MB.
disable_dhcpd Do not set the static ip to the network interface and do not run the DHCP daemon on it. This makes sense for devices with an ethernet port, like the Raspberry Pi (#1580). true, false
no_framebuffer Do not wait up to 10 seconds until a framebuffer device shows up and do not try to configure it (pmaports!44). true, false
initfs_compression Command used to compress initramfs image (see pmaports!334, pmaports#237) default: 'gzip -1'


These are used for flashing and booting the device, and most of them are fastboot specific. Here is a guide on how to get these values for a specific Android device (by extracting the boot.img)

Variable Description Possible values
flash_offset_kernel Kernel offset used for flashing
flash_offset_ramdisk Ramdisk offset used for flashing
flash_offset_second Used for flashing
flash_offset_tags Used for flashing
flash_offset_base Used for flashing default: 0x10000000
flash_pagesize Page size usually 2048
flash_sparse Set this to true if your device expects a sparse system image flashed
flash_fastboot_vendor_id Set this to your vendor id if fastboot requires the -i argument to work on your device
flash_fastboot_max_size Set this if the fastboot required by your device has an upper limit to the size of system images it will flash. Size, in MB
kernel_cmdline Kernel command line
bootimg_blobpack Create a flashable blob for the ASUS TF101 from boot.img using BlobTools true, false
bootimg_mtk_mkimage Prepend a header required for MediaTek MT6589 phones (such as the Fairphone 1, more info) true, false
bootimg_qcdt Append dtb file to boot.img (more info) true, false
generate_bootimg Set this to true for fastboot device, so the mkinitfs command will generate a boot.img file after creating the initfs. Add mkbootimg as dependency to your device's APKBUILD! true, false
generate_legacy_uboot_initfs For the N900, we use a legacy version of the uboot bootloader right now. When setting this variable to true, the initramfs will generate an uboot legacy compatible initramfs file. Modern versions of uboot can load regular initramfs files. true, false
legacy_uboot_load_address Set a custom load address for the legacy uboot initfs (see pmaports!578, only makes sense in combination with generate_legacy_uboot_initfs). default: 80008000
fastboot_partition_kernel Only relevant for fastboot flash methods, the partition where the kernel or boot.img will be stored (!1741). default: "boot"
fastboot_partition_system Only relevant for fastboot flash methods, the partition where the system image will be stored (see also: partition-layout). default: "system"
heimdall_partition_kernel Only relevant for heimdall flash methods, the partition where the kernel or boot.img will be stored. default: "KERNEL"
heimdall_partition_initfs Only relevant for the heimdall-isorec flash method, the partition where the initramfs will be stored. default: "RECOVERY"
heimdall_partition_system Only relevant for heimdall flash methods, the partition where the system image will be stored (see also: partition-layout). default: "SYSTEM"
boot_filesystem Sets the filesystem used for the /boot partition containing initramfs-extra default: "ext4", "fat16", "fat32"
rootfs_image_sector_size Some devices made after 2016 with UFS storage use 4096 byte sectors and therefore need this option to boot. Read !1725 for details. default: 512
sd_embed_firmware A comma-separated list of binary:offset (where binary is under /usr/share) (!1739) e.g. firmware/librem5dev/u-boot.bin:33,firmware/librem5dev/m4.bin:2
sd_embed_firmware_step_size The number of bytes for each increment of the offset specified in the sd_embed_firmware default: 1024
partition_blacklist A comma-separated list of partitions that should not be flashed, because they brick the device. There are only very few devices where it is necessary (e.g. Ouya). !1759 e.g. boot,recovery


Variable Description Possibles values
screen_width The width of the display 800, 720, 1440... anything really
screen_height The height of the display 1280, 2560... other
framebuffer_landscape Rotate framebuffer output by 270° (pmaports!530, pmaports!546) true, false (default)

Obsolete options


  • weston_pixman_type: used to be a Weston specific workaround for the "red screen bug" (#54): we patched Weston to accept a --pixman-type argument to override the framebuffer mode that the kernel driver reports. However, this patch was quickly incompatible with future changes in Weston, and it is not as good as patching the kernel to report the right framebuffer mode, so it was removed (pmaports#136).
  • Various options from weston.ini used to be duplicated, but this was removed in #739. If you need to set weston specific options from your device (such as the output backend or the keymap), please add a weston.ini file to your pmaport (example).

See also