Troubleshooting

= General information =


 * Always look at the log file for a detailed error message:
 * Make sure, that you have the latest version. Your bug may already be fixed.
 * Please report the bugs you have found in the issues, so we can fix them.
 * is enabled, and will log to shared memory once the OS has booted. It can be read with the  tool in BusyBox. The syslog is currently not preserved across reboots.

See also: How to report issues

= Specific troubleshooting pages =
 * Troubleshooting:alsa - Troubleshooting related to sound not working after ALSA upgrades
 * Troubleshooting:boot - Troubleshooting the boot process, figuring out if your device boots
 * Troubleshooting:display - Troubleshooting display issues
 * Troubleshooting:HID buttons - Troubleshooting on-device buttons
 * Troubleshooting:host - Troubleshooting the host system
 * Troubleshooting:kernel - Common kernel building related issues and how to fix them
 * Troubleshooting osk-sdl'''
 * Troubleshooting:Xorg - Troubleshooting problems with Xorg
 * Troubleshooting:QEMU - Debugging problems with
 * Troubleshooting:dependencies - A guide to resolving  errors coming from pmbootstrap, as well as   errors coming from apk.
 * Troubleshooting:grsec (TL;DR: doesn't work)
 * Run pmbootstrap on non-x86_64 arches
 * Access eMMC install from second storage medium
 * Debugging the GNOME stack - also has some information that applies to other interfaces like Phosh

= Table of contents =

= Port/device troubleshooting =

Porting process, preparation and various information
See also: Troubleshooting

My device runs the Linux kernel (e.g. Android), but the vendor does not provide the source

 * 1) Ask kindly via e-mail.
 * 2) If they don't provide the source, team up with gpl-violations.org. You have the legal right to get the source, because the Linux kernel is under the GPLv2!
 * 3) Consider building generic kernel for your device.
 * 4) Another option is using prebuilt kernels

My Android device does not have partition labels, how do I know where to put the boot.img file etc?

 * Search online for the partitions, they are probably documented somewhere.


 * Try to dump all partitions. Run `file` on them, it should roughly tell you the contents. If that does not help, run binwalk.
 * file output: check if it is a kernel (vmlinuz),  file or just "data".
 * In case you have "data", don't flash anything there, we probably can't generate that format yet. Please open an issue in GitHub or ask on the channel.
 * You can also look at recovery zips from other Android ROMs, that were released for your device. Extract it and look at, search for commands starting with  , they are for flashing partitions.


 * In one example, there was, which means that a   file gets flashed to  . That   file is also in the recovery zip - run the   program on it (see above).

Serial Console Debug Cable (early boot debugging)
For some devices it's possible to get early boot output using a debug cable that provides access to the UART. Unfortunately manufacturers do not use to publish the details and it is end users who in some cases have figured it out:


 * Here is one such cable for Nexus 4 and another for Nexus 5.
 * This article goes a step further with Google Nexus devices.
 * This guide explains how to create one for a Samsung devices with a micro usb socket.
 * Sony has published information about how to access the UART port on their Xperia series.
 * The Replicant wiki has useful information on this as well.

On fastboot devices, you may have to enable UART debugging with.

By default, all output from the initramfs get redirected to. If you want the output through the debug cable you need to add  to your kernel command line.

See Serial debugging

Proprietary blobs
Many devices require proprietary blobs for enabling certain peripherals (wifi/bluetooth/cellular/GPS). These repositories appear to contain blobs for a large percentage of devices out there.

Force reboot
On some phones, you can hold down the power button for ten seconds to force a reboot. If that does not work: On other phones, you have to hold the power button down for a full minute (or hold it together with volume down). On some phones, it might take even longer (3 minutes or so).

You can also give from console.

Touch screen device present but not outputting any touch events
For some devices (at least motorola-shamu and motorola-lux), the touch screen I2C device is present but not activated at boot, and must be activated before it produces any output.

For the motorola-lux, this is done in the following way:

The path to the correct touch device depends on the device. This can be added to an initfs hook to activate the touch screen automatically at boot.

CHARGING MODE: error starting charging-sdl
When attaching the power cable while the device is off, Android devices boot into a special "charging mode". postmarketOS's charging-sdl display does not work yet on all devices.

To debug the issue, follow instructions at Inspecting the initramfs including activating the initramfs-extra, then execute  in the shell.

During initramfs generation: "modprobe: WARNING: Module drm not found in directory /lib/modules/..."
This means, that a module can not be put in an initramfs. When you are not using a mainline kernel, it is likely that there are no modules configured, but the code is built directly into the kernel. This means, it is expected and can be ignored.

Phone shows the telnet message, a black screen, or doesn't leave the bootloader or Samsung/Google/... splash screen
See: Troubleshooting:boot

I have ported postmarketOS to my device and the screen doesn't get updated
There is a known bug where if you execute  exactly one frame is drawn, and the screen isn't updated otherwise.

Device reboots

 * If your device always reboots after the same time (e.g. 2 minutes) after booting, you probably need to feed (or disable) a watchdog. Try to search your kernel config for watchdog, and also the internet for watchdog + your phone name.
 * Android: The kernel config option  may cause reboots. Please check if you have disabled it. If this helps you, please let us know, so we can consider checking for this option.
 * Android: it is possible to get the  log from just before the crash after the reboot if you enable some kernel options.

User interface is unresponsive

 * If you have a situation where an application or display manager user interface is unresponsive, you can use TTYescape to kill the offending process, power cycle the device, or otherwise access helpful command line utilities.

SSH / udev / touch screen doesn't work

 * Make sure that  is enabled in your kernel config. Do not enable.

I can't access the framebuffer device

 * returns:
 * This could be caused by a proprietary 3d driver enabled in the kernel config. Try to disable it (the actual config options may be different).

&quot;if running weston from ssh, use --tty to specify a tty&quot;
Specify a tty in weston's commandline. The correct syntax is:.

Weston and fbsplash -s do not work
If Weston returns an error because it could not access, even when you specify it on the command line as above, you may need to enable Virtual Terminals in the kernel config.

You can enable  using   and checking under Device Drivers -&gt; Character devices -&gt; Virtual terminal

Invalid sparse file format at header magic
In some devices (e.g.: bullhead, titan), when flashing the system, it works but fastboot complains of.

$ ./pmbootstrap.py flasher flash_rootfs [23:02:58] (native) install android-tools [23:02:58] (native) flash rootfs image target reported max download size of 536870912 bytes Invalid sparse file format at header magic sending sparse 'system' 1/1 (274101 KB)... OKAY [ 9.452s] writing 'system' 1/1... OKAY [ 12.584s] finished. total time: 22.036s [23:03:20] Done It happens when your device expects a sparse system image. The workaround is as follows:


 * Set  in deviceinfo

To do this, edit the file in ./local/var/pmbootstrap/cache_git/pmaports/device/your_device_name/deviceinfo and add. When finished, run  to rebuild the file system

For more information, see issue #299

Login screen hangs
When switching from an installation on the system-partition to an installation on the userdata-partition, or when switching from a downstream-kernel to a mainline-kernel, it can happen, that the system boots up but hangs before login.

Logread via SSH may print a loop of Jan 1 02:45:10 device-xy daemon.info init: can't open /dev/ttyHSL0: No such file or directory Jan 1 02:45:10 device-xy daemon.info init: process '/sbin/getty -L ttyHSL0 115200 vt100' (pid 9119) exited. Scheduling for restart.

Try to erase the partitions before flashing:

Heimdall: Flashing fails at 7%
You might also be getting the error "ERROR: Failed to confirm end of file transfer sequence"

It might be, that your device only accepts "sparse images". Try setting  in the deviceinfo.

FAILED (remote: Unknown chunk type)
This is a bootloader limitation. Flash with netcat as a workaround, or use this wiki's search feature to come up with more related information. Feel free to organize this in a better way, but this should be a good starting point. See also.

flasher (fastboot) is stuck in
Maybe you need to install udev rules on your host Linux distribution. Arch has the android-udev package for example, which uses the rules from here.

If that does not help, it might be necessary to set the  in your deviceinfo (this was necessary for the Amazon Kindle Fire HDX). Try to search the web for your device name and "fastboot vendor id".

If you were previously able to use fastboot and it stopped working, sometimes  to restart the chroot helps. Also try to reboot the device into fastboot again.

ERROR: Failed to confirm end of file transfer sequence!
This message can mean anything. To get more information you can instead create an android-recovery-zip and install that from recovery. The installation will probably fail now as well, but at least this time you will have logs in.

One possible reason for the error is simply that the image is too large for the partition, in which case you need to decrease the size, or maybe re-partition your device.

The whole error message might look something like [...] Uploading BOOT 100% ERROR: Failed to confirm end of file transfer sequence! ERROR: BOOT upload failed!

Ending session... ERROR: Failed to send end session packet! Releasing device interface...

= pmbootstrap and build related errors =

pmbootstrap is broken! But it worked yesterday!
Sorry! Revert to the last commit, that was known to work (git checkout $commit) and report an issue, if there is not already one. Consult with others in the IRC/matrix channel to find out, which commit was the last one that worked.

ERROR: This device does not exist anymore, check  to see if it was renamed
One case where this might happen is if you remove pmbootstrap's work path, and then run a. As you might notice it is still remembering values and devices from previous executions.

To solve this you need to remove (or rename)  (i.e  ). After doing so  should work fine.

BusyBox does something different than the standard tool for the job, and this breaks building my package!
Example: unzip in BusyBox doesn't extract symlinks like the normal unzip implementation (#82).

Solution: Simply add  to the makedepends in the APKBUILD, and the &quot;real&quot; unzip will be used (or in that case, try to get the sources in another archive format, such as ,  ,  ).

WARNING: No provider for dependency...
Normal behavior. it means, that your &quot;user&quot; repository (the repository with all custom compiled packaged from pmOS, such as your device package and kernel) does not have the dependencies from the official Alpine Linux repositories (such as,  ,  , ...) when indexing it. But these dependencies are in the official repositories, so they will be found when you try to install something. Usually the package indexing is done on all repositories at once in Alpine (then you wouldn't get the error), but pmOS does it only on the &quot;user&quot; repository.

ERROR: busybox-1.27.0-r1.post-install: script exited with error 127
Programs running in (foreign arch) chroots cannot be executed. See.

ERROR: /mnt/pmbootstrap-packages/x86_64/qemu-user-static-repack-2.8-r6.apk: UNTRUSTED signature
You don't have your own package signing key imported, which gets generated when you compile a package for the first time. pmbootstrap should automatically import it, but when you hit  during that, it may go wrong.

Your generated key is in, all imported keys are in.

A quick fix is deleting all packages: ./pmbootstrap zap -p

See issue #270 for more information and don't hesitate to reopen if this didn't work for you.

Installed version newer than the version in the repositories
You have a program installed in one of your chroots with a higher version, than what is available in the binary package repositories (either from upstream or the packages you have built yourself).

Example how this can happen:


 * Git branch switch to one which increased the version of
 * Build
 * Install it in a chroot (e.g. by running )
 * Branch switched to
 * All packages got zapped, but not the chroots
 * Build  again (this time it has a lower version count!)

Solution: Simply zap your chroot! When it gets set up again, it will use the current package version.

It's not installing my changed package
You have changed a package but it's using the one from the repository and not your changed build.

You probably didn't build it or not for the correct architecture. defaults to  architecture, if you need that package on your device, use the   flag.

Newer version in binary package repositories than in aports folder
You have built a package earlier, and the branch you are currently working in has a lower version in the aports folder.

Example how this can happen: Package 'postmarketos-mkinitfs' in your aports folder has version X, but the binary package repositories already have version Y
 * Git branch switch to a feature branch which increased the version of
 * Build
 * Switch to  branch
 * Run just about any  command, it will print this warning:

Solution: Run  to delete the mismatched binary packages.

Note: If that does not help it, you can manually delete that specific packages from your aports folder:  and run   to re-index all packages. See also: #466, #474

If you want to use older package built locally from pmaports:
 * 1) Build the package using   to ignore newer version present in binary repos
 * 2) Enter chroot, e.g. device's rootfs:
 * 3) Install package in specific version, e.g.

The warning will still appear during e.g. , but your package will stay at specified version until chroot is wiped.

mkbootimg: error: argument --dt: can't open '/boot/dt.img'
This happens when you have  enabled (which is correct when pmbootstrap generated it that way), but your kernel does not generate the   file. Please adjust your kernel  as follows:
 * add  to
 * extend your  function like this
 * and your  function like that

See for a plan to automatically generate the linux APKBUILD right.

Permission denied: .../pmbootstrap/work/chroot_native/proc/1/cwd'
It looks like you have created your work folder as:, where   is the folder with the checked out source code. That is not supported. Please run, then delete that folder, then run   again and choose another work folder (e.g.  ).

After that it should work - if this still does not resolve it, please open up an issue in the GitLab issue tracker.

can't create : Permission denied
Make sure that your working directory is mounted correctly. This can happen when working over NFS, or when you mounted the drive your working directory is on trough the file explorer (if that's the case,  it, and   it manually). This can probably happen on every drive mounted with  or similar.

cp: write error: No space left on device (during file transfer from chrooted environment to target image)
This issue is triggered when  determines the wrong size for the target image, as it is unfortunately very hard to calculate the correct size independent of the filesystem on which the chroot resides. Some examples for this: ; where more elaborate information can be found.

While fixing the problem seems impossible for every configuration, there is a workaround available ( and its associated merge request ): Use the /  option of   to specify extra space on the resulting image file in MB. Just play around with the value until it works for you. You can specify the value also through  in its Additional options.

"ERROR: Is $builddir set correctly?" for linux-* package
Check where the kernel sources archive has the kernel-related code stored and change the  value accordingly.

BAD signature errors from apk
If apk throws BAD signature errors, oftentimes the dl-cdn mirror from Alpine didn't cache the package properly. The solution is then to send a PURGE to the complete URL of the package (open dl-cdn.alpinelinux.org/alpine in your browser and find the complete URL). Like this:

curl -X PURGE https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/plasma-dialer-0.2-r0.apk

This also works if bpo is failing with a BAD signature error.

Errors with grsec-based kernel on the host system
See: Troubleshooting:grsec

Errors with ecryptfs
When your &quot;work&quot; folder is inside an ecryptfs mounted folder, may not work inside the chroot and you may have other issues. Try to move your work folder to another location, you can use  to test if this resolves the issue. You can change the location in. See also: #61. (This doesn't seem to be an issue with newer versions of ecryptfs anymore.)

/ fails to build with a 404 error
Run. The reason why this fails from time to time is, that we use Alpine's binary  lib c package for  /  in the native chroot, to get the cross-compiler working. So the download URL inside the  file must be in sync with the upstream version. This pmbootstrap command safely gets the new version, uses  to verify the signature of the package, generates the hash, and updates the   file. To make sure, that  receives the latest   version, delete your HTTP cache right before by executing this command:. Don't bother making a pull-request for this, as the fix is really trivial (see this commit). Just report it as issue, if it happens.

sh: can't create /proc/sys/fs/binfmt_misc/register: nonexistent directory
This issue is known to happen in Alpine Virt hardened and Void Linux. These commands should fix it:

sudo modprobe binfmt_misc sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc If it still does not work, it is probably not supported by your host Linux distribution's kernel. Try to use another kernel.

du: unrecognized option: summarize
Update pmbootstrap.

Packaging for aarch64: ./config.guess: unable to guess system type
This happens in packages built with autoconf (./configure; make; make install), when it ships an outdated config.guess file in the source code. Adjust your APKBUILD's  function like done in.

ERROR: ... BAD archive
If you  shows something similar to the following: (005853) [22:25:47] (native) % apk --no-progress add -u qemu-user-static-repack qemu-user-static-repack-binfmt WARNING: Ignoring /mnt/pmbootstrap-packages/x86_64/APKINDEX.tar.gz: No such file or directory (1/2) Installing qemu-user-static-repack (2.8-r9) ERROR: qemu-user-static-repack-2.8-r9: BAD archive (2/2) Installing qemu-user-static-repack-binfmt (2.8-r9) 1 error; 20 MiB in 36 packages (005853) [22:25:53] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

...then downloading a package (in this case ) failed. Please delete the broken package and try it again:

CROSS_COMPILE_ARM32 not defined or empty, the compat vDSO will not be built
Disable  in kernel config.

../tools/dct/DrvGen: No such file or directory
This error is specific to Mediatek kernels and it occures when DrvGen tries to load libc6.so library it has been linked against but Alpine chroot doesn't support libc. One of the solutions is to copy python3dct.patch to your linux-... directory and activate it in the APKBUILD. This patch replaces precompiled DrvGen with a python3 version.

boot-deploy exits with ERROR: "deviceinfo_header_version is 2, but 'deviceinfo_dtb' is missing. Set 'deviceinfo_dtb'" when compiling downstream kernel
Deviceinfo file is generated with  set to 2 and boot-deploy expects a dtb filel to be appended. This is only the case for mainline kernels, so either set this variable to 0 or delete the line altogether.

Errors while running pmbootstrap on non-x86_64 arches
If you get, see Run pmbootstrap on non-x86_64 arches.

= Troubleshooting steps kept around for historical reference =

pmbootstrap builds packages that it should download from the binary repo/that are already built
Try to disable the "timestamp based rebuilds" feature in "pmbootstrap init" as a workaround and please report this as a bug. We need the following for the bug report:
 * *enable* timestamp based rebuilds
 * (let it run until it starts building the package it should not build)
 * (we need the log from here!)

Invalid pkgver '${_pkgbase}_git${_pkgsnap}'
If you get the following error, your pmbootstrap needs to be upgraded: ERROR: Invalid pkgver '${_pkgbase}_git${_pkgsnap}' in APKBUILD: /home/user/.local/var/pmbootstrap/cache_git/pmaports/cross/gcc-aarch64/APKBUILD