Jump to content

Troubleshooting: Difference between revisions

From postmarketOS Wiki
Specific troubleshooting pages: Add HID buttons troubleshooting page
Knuxify (talk | contribs)
move to category (https://gitlab.postmarketos.org/postmarketOS/wiki/-/issues/133)
Tag: New redirect
 
(108 intermediate revisions by 45 users not shown)
Line 1: Line 1:
= General information =
#REDIRECT [[:Category:Troubleshooting]]
 
* Always look at the log file for a detailed error message: <code>~/.local/var/pmbootstrap/log.txt</code>
* Make sure, that you have the latest version. Your bug may already be fixed.
* Please report the bugs you have found in the [https://github.com/postmarketOS/pmbootstrap/issues issues], so we can fix them.
* {{alpine|Syslog}} is enabled, and will log to shared memory once the OS has booted. It can be read with the <code>logread</code> tool in BusyBox. The syslog is currently not preserved across reboots.
 
= Specific troubleshooting pages =
* [[Troubleshooting:boot]]
* [[Troubleshooting:display]]
* [[Troubleshooting:grsec]] (TL;DR: doesn't work)
* [[Troubleshooting:kernel]]
* [[Troubleshooting:Xorg]]
* [[Troubleshooting:HID buttons]]
 
= Uncategorized errors =
 
=== <code>musl-*</code>/<code>busybox-static-*</code> fails to build with a 404 error ===
 
Run <code>pmbootstrap aportgen musl-armhf musl-aarch64</code>. The reason why this fails from time to time is, that we use Alpine's binary <code>musl</code> lib c package for <code>armhf</code>/<code>aarch64</code> in the native chroot, to get the cross-compiler working. So the download URL inside the <code>aports/cross/musl-*/APKBUILD</code> file must be in sync with the upstream version. This pmbootstrap command safely gets the new version, uses <code>apk</code> to verify the signature of the package, generates the hash, and updates the <code>APKBUILD</code> file. To make sure, that <code>pmbootstrap aportgen</code> receives the latest <code>musl</code> version, delete your HTTP cache right before by executing this command: <code>pmbootstrap zap -hc</code>. Don't bother making a pull-request for this, as the fix is really trivial (see [https://github.com/postmarketOS/pmbootstrap/commit/0f3b2ea4277679056079000eac581d1b9d05afc8 this commit]). Just report it as issue, if it happens.
 
=== 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.
 
=== Permission denied: .../pmbootstrap/work/chroot_native/proc/1/cwd' ===
It looks like you have created your work folder as: <code>pmbootstrap/work</code>, where <code>pmbootstrap</code> is the folder with the checked out source code. That is not supported. Please run <code>pmbootstrap shutdown</code>, then delete that folder, then run <code>pmbootstrap init</code> again and choose another work folder (e.g. <code>~/.local/var/pmbootstrap</code>).
 
After that it should work - if this still does not resolve it, please open up an issue in the GitHub tracker.
 
=== can't create <code>/dev/null</code>: 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, <code>umount</code> it, and <code>mount</code> it manually). This can probably happen on every drive mounted with <code>nosuid</code> or similar.
 
=== Problems with installing <code>gcc-armhf</code> or <code>gcc-aarch64</code> ===
The cross-compiler version of gcc needs to be in sync with Alpine's official version of gcc (otherwise there will be dependency errors regarding libc++.so or something like that). Please pull the latest pmbootstrap code, zap your chroots and try again. If it still does not work, run <code>pmbootstrap aportgen gcc-armhf</code>. It should give you the newest version.
 
Please make an issue about this, if there is none in the tracker.
 
=== Figuring out booting problems ===
 
Add <code>rc_logging=YES</code> to <code>/etc/rc.conf</code> to have openrc log all its steps to <code>/var/log/rc.log</code>. If you managed to get the system to boot far enough to have telnet access, add [[Inspecting-the-initramfs|the port 24 telnet listener]] and you can mount the root device to view said log.
 
=== SSH / udev / touch screen do not work ===
 
* Make sure, that <code>DEVTMPFS</code> is enabled in your kernel config. Do not enable <code>DEVTMPFS_MOUNT</code>.
 
=== I can't access the framebuffer device ===
 
* <code>cat /dev/random &gt; /dev/fb0</code> returns: <code>cat: write error: No such device</code>
* This could be caused by a proprietary 3d driver enabled in the kernel config. [https://github.com/postmarketOS/pmbootstrap/pull/66/ Try to disable it (the actual config options may be different).]
 
=== 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 ([https://github.com/postmarketOS/pmbootstrap/issues/82 #82]).
 
'''Solution:''' Simply add <code>unzip</code> 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 <code>.tar.bz2</code>, <code>.tar.xz</code>, <code>.tar.gz</code>).
 
=== Errors with ecryptfs ===
 
When your &quot;work&quot; folder is inside an ecryptfs mounted folder, [https://github.com/postmarketOS/pmbootstrap/issues/53 <code>/dev/random</code> may not work inside the chroot] and you may have other issues. Try to move your ''work'' folder to another location, you can use <code>/tmp</code> to test if this resolves the issue. You can change the location in <code>pmbootstrap init</code>. See also: [https://github.com/postmarketOS/pmbootstrap/issues/61 #61]. (This doesn't seem to be an issue with newer versions of ecryptfs anymore.)
 
=== ERROR: unsatisfiable constraints ===
Unsatisfiable constraints means, that Alpine's package manager can't resolve packages properly. Most likely this is because Alpine updated a package and the postmarketOS repository has not been adjusted yet. Here are instructions on how you can fix this locally - but make sure that the postmarketOS community is informed as well, so the pmOS binary repos can be upgraded, too.
 
This is how it looks like, when GCC got upgraded:
<pre>
ERROR: unsatisfiable constraints:
libstdc++-6.4.0-r6:
breaks:
g++-armhf-6.4.0-r5[libstdc++=6.4.0-r5]
satisfies: world[libstdc++]
g++-6.4.0-r6[libstdc++=6.4.0-r6]
g++-6.4.0-r6[libstdc++=6.4.0-r6]
gcc-6.4.0-r6[so:libstdc++.so.6]
lzip-1.19-r1[so:libstdc++.so.6]
gcc-6.4.0-r6:
breaks: g++-armhf-6.4.0-r5[gcc=6.4.0-r5]
satisfies: world[gcc]
g++-6.4.0-r6[gcc=6.4.0-r6]
build-base-0.5-r0[gcc]
</pre>
 
So we need to update our GCC cross-compilers, too:
<syntaxhighlight lang="shell-session">
$ pmbootstrap aportgen gcc-armhf
$ pmbootstrap zap
$ pmbootstrap build --ignore-depends gcc-armhf
</syntaxhighlight>
 
This compiles a new armhf cross-compiler, that is compatible with the one from Alpine. We need the <code>--ignore-depends</code> switch, because <code>abuild</code> will try to install a <code>build-base-armhf</code> package otherwise, that we don't have (it probably gets generated if you use Alpine's official bootstrap scripts). Replace <code>armhf</code> with <code>aarch64</code> as necessary.
 
==== upstream repo broken ====
(This is very unlikely and has only happened once.) postmarketOS is based on Alpine Linux ''testing''. Maybe they have triggered a rebuild and it failed, so now the package is not available. You ''could'' try to install the latest stable package, as a workaround (although that may introduce other bugs!). [https://github.com/postmarketOS/pmbootstrap/issues/4#issuecomment-304508729 Here's an example.]
 
=== 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 don't use to publish the details and it is endusers who in some cases have figured it out:
 
* Here's one such cable for [https://www.optiv.com/blog/building-a-nexus-4-uart-debug-cable Nexus 4] and another for [https://www.abclinuxu.cz/blog/Lorris/2013/12/serial-console-on-google-nexus-5 Nexus 5].
* [http://www.pabr.org/consolejack/consolejack.en.html This article] goes a step further with Google Nexus devices.
* Sony has published information about how to access the UART port on their [https://developer.sonymobile.com/open-devices/how-to-access-uart-ports-on-xperia-devices/ Xperia series]
* The [https://redmine.replicant.us/projects/replicant/wiki/SamsungSerial Replicant wiki] has useful information on this as well.
 
On fastboot devices, you may have to enable UART debugging with <code>fastboot oem uart-on</code>.
 
By default, all output from the initramfs get redirected to <code>/pmOS_init.log</code>. If you want the output through the debug cable you need to add <code>PMOS_NO_OUTPUT_REDIRECT</code> to your [https://github.com/postmarketOS/pmbootstrap/wiki/Troubleshooting:kernel#how-can-i-boot-the-kernel-with-some-specific-arguments kernel command line].
 
See [https://github.com/postmarketOS/pmbootstrap/wiki/Serial-debugging Serial debugging].
 
=== Proprietary Blobs ===
 
Many devices require proprietary blobs for enabling certain peripherals (wifi/bluetooth/cellular/GPS). [https://github.com/TheMuppets 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).
 
=== Phone shows the telnet message, a black screen, or doesn't leave the bootloader or Samsung/Google/... splash screen ===
 
See: [[Troubleshooting:boot]]
 
=== My device runs the Linux kernel (e.g. Android), but the vendor does not provide the source ===
 
# Ask kindly via e-mail.
# If they don't provide the source, team up with [http://gpl-violations.org/faq/violation-faq/ gpl-violations.org]. You have the legal right to get the source, because the Linux kernel is under the GPLv2!
# Another option is [[using prebuilt kernels]]
 
=== I have ported postmarketOS to my device and the screen doesn't get updated ===
 
There is a [https://github.com/postmarketOS/pmbootstrap/pull/66#issuecomment-306343779 known bug] where if you execute <code>cat /sys/class/graphics/fb0/modes &gt; /sys/class/graphics/fb0/mode</code> exactly one frame is drawn, and the screen isn't updated otherwise.
 
=== &quot;if running weston from ssh, use --tty to specify a tty&quot; ===
 
Specify a tty in weston's commandline. The correct syntax is: <code>weston --tty=1</code>.
 
=== Weston and fbsplash -s <image> do not work ===
 
If Weston returns an error because it could not access <code>/dev/tty1</code>, even when you specify it on the command line as above, you may need to enable Virtual Terminals in the kernel config.<br />
You can enable <code>CONFIG_VT</code> using <code>pmbootstrap menuconfig</code> and checking under Device Drivers -&gt; Character devices -&gt; Virtual terminal
 
=== My screen is red! ===
 
There are some buggy framebuffer drivers (e.g. in LG Nexus 5) that report incorrect data. You can override it with:
 
<pre>weston --pixman-type=2</pre>
More information on [https://github.com/postmarketOS/pmbootstrap/issues/54 issue #54]
 
=== Errors with grsec-based kernel on the host system ===
 
See: [[Troubleshooting:grsec]]
 
=== 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 <code>cryptsetup</code>, <code>iw</code>, <code>htop</code>, ...) 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 ===
 
'''Normal behavior.''' We use a x86_64 version of <code>apk</code> to set up the chroots. When setting up the armhf chroot, the armhf post-installation code can't be executed, and that's where the errors come from. But we run &quot;apk fix&quot; right afterwards - with the armhf architecture, because we have an armhf version of apk installed inside the chroot now - and this runs the installation scripts again.
 
=== sh: can't create /proc/sys/fs/binfmt_misc/register: nonexistent directory ===
 
This issue is known to happen in Alpine Virthardened. These commands should fix it:
 
<pre class="shell">sudo modprobe binfmt_misc
sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc</pre>
If it still does not work, it is probably not supported by your host Linux distribution's kernel (<code>CONFIG_BINFMT_MISC</code>). Try to use another kernel.
 
=== 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 <code>^C</code> during that, it may go wrong.
 
Your generated key is in <code>~/.local/var/pmbootstrap/config_abuild</code>, all imported keys are in <code>~/.local/var/pmbootstrap/config_apk_keys</code>.
 
A quick fix is deleting all packages:
<pre>./pmbootstrap zap -p</pre>
 
See issue [https://github.com/postmarketOS/pmbootstrap/issues/270 #270] for more information and don't hesitate to reopen if this didn't work for you.
 
=== Fastboot does not detect my device! ===
 
Maybe you need to install udev rules on your host Linux distribution. Arch has the [https://www.archlinux.org/packages/community/any/android-udev/ android-udev] package for example, which uses the rules from [https://github.com/M0Rf30/android-udev-rules here].
 
If that does not help, it might be necessary to set the <code>flash_fastboot_vendor_id</code> 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".
 
=== Invalid sparse file format at header magi ===
 
In some devices (e.g.: bullhead, titan), when flashing the system (<code>pmbootstrap flasher flash_system</code>), it works but fastboot complains of <code>Invalid sparse file format at header magi</code>.
 
<pre>$ ./pmbootstrap.py flasher flash_system
[23:02:58] (native) install android-tools
[23:02:58] (native) flash system image
target reported max download size of 536870912 bytes
Invalid sparse file format at header magi
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</pre>
It happens when your device expects a sparse system image. The workaround is as follows:
 
* Set <code>deviceinfo_flash_sparse=true</code> in deviceinfo
* Add <code>libsparse</code> to <code>depends=</code>.
 
For more information, see issue [https://github.com/postmarketOS/pmbootstrap/issues/299 #299]
 
=== 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 <code>postmarketos-mkinitfs</code>
* Build <code>postmarketos-mkinitfs</code>
* Install it in a chroot (e.g. by running <code>pmbootstrap install</code>)
* Branch switched to <code>master</code>
* All packages got zapped, but not the chroots
* Build <code>postmarketos-mkinitfs</code> 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.
 
=== 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:'''
* Git branch switch to a feature branch which increased the version of <code>postmarketos-mkinitfs</code>
* Build <code>postmarketos-mkinitfs</code>
* Switch to <code>master</code> branch
* Run just about any <code>pmbootstrap</code> command, it will print this warning:
  Package 'postmarketos-mkinitfs' in your aports folder has version X, but the binary package repositories already have version Y
 
'''Solution:''' Run <code>pmbootstrap zap -m</code> to delete the mismatched binary packages.
 
'''Note:''' If that does not help it, you can manually delete that specific packages from your aports folder: <code>sudo rm ~/.local/var/pmbootstrap/packages/*/postmarketos-mkinitfs*.apk</code> and run <code>pmbootstrap index</code> to re-index all packages. See also: [https://github.com/postmarketOS/pmbootstrap/issues/466 #466], [https://github.com/postmarketOS/pmbootstrap/pull/474 #474]
 
=== Screen output flicker and inactivity ===
 
If you notice a very brief flicker upon boot, but immediately disappears and screen turns black, you might have a buggy framebuffer Qualcomm MDSS MDP3 driver.
 
You can try patching the source code by removing the function assigned to the <code>mdp3_interface->off_fnc</code> in the <code>mdp3_ctrl.c</code> file.
 
See example patch: [https://github.com/postmarketOS/pmbootstrap/blob/master/aports/device/linux-huawei-y530/05_fix_mdp3_ctrl_off.patch 05_fix_mdp3_ctrl_off.patch]
 
=== Screen output messed up ===
 
If the output on the screen is not aligned correctly ([https://user-images.githubusercontent.com/315080/30261765-c28df28e-96d6-11e7-971a-fd031704a810.jpg see picture]) it's probably because you have a wrong value in <code>/sys/class/graphics/fb0/bits_per_pixel</code>.
 
You can try patching the source code by setting a different video mode (RGB/ARGB/RGBA/YCRYCB/...).
 
See example patch: [https://github.com/postmarketOS/pmbootstrap/blob/master/aports/device/linux-huawei-y530/06_fix_mdss_fb_rgb_mode.patch 06_fix_mdss_fb_rgb_mode.patch]
 
=== 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 <code>prepare()</code> function like done in {{github|698}}.
 
=== 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 <code>CONFIG_ANDROID_LOW_MEMORY_KILLER</code> 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 <code>dmesg</code> log from just before the crash after the reboot [https://stackoverflow.com/questions/9682306/android-how-to-get-kernel-logs-after-kernel-panic if you enable some kernel options].
 
=== ERROR: ... BAD archive ===
If you <code>pmbootstrap log</code> shows something similar to the following:
<pre>
(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] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</pre>
 
...then downloading a package (in this case <code>qemu-user-static-repack</code>) failed. Please delete the broken package and try it again:
 
<syntaxhighlight lang="shell-session">
$ cd ~/.local/var/pmbootstrap/ # go into your work folder, as specified in 'pmbootstrap init'
$ sudo rm -v cache_apk_*/qemu-user-static-repack-* # adjust the failing package name accordingly
</syntaxhighlight>
 
=== 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 [https://github.com/ReFirmLabs/binwalk binwalk].
** file output: check if it is a kernel (vmlinuz), <code>boot.img</code> 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 <code>META-INF/com/google/android/updater-script</code>, search for commands starting with <code>run_program("/sbin/busybox", "dd"</code>, they are for flashing partitions.
 
** In one example, there was <code>run_program("/sbin/busybox", "dd", "if=/tmp/boot.blob", "of=/dev/block/mmcblk0p4");</code>, which means that a <code>boot.blob</code> file gets flashed to <code>/dev/block/mmcblk0p4</code>. That <code>boot.blob</code> file is also in the recovery zip - run the <code>file</code> program on it (see above).
 
=== mkbootimg: error: argument --dt: can't open '/boot/dt.img' ===
This happens when you have <code>deviceinfo_bootimg_qcdt</code> enabled (which is correct when pmbootstrap generated it that way), but your kernel does not generate the <code>/boot/dt.img</code> file.
Please adjust your kernel <code>APKBUILD</code> as follows:
* add <code>dtbtool</code> to <code>makedepends</code>
* extend your <code>build()</code> function [https://github.com/postmarketOS/pmbootstrap/blob/bc2784ece7dbbb5b9fbc8e1855566d3e9e770e59/aports/device/linux-huawei-y530/APKBUILD#L74-L75 like this]
* and your <code>package()</code> function [https://github.com/postmarketOS/pmbootstrap/blob/bc2784ece7dbbb5b9fbc8e1855566d3e9e770e59/aports/device/linux-huawei-y530/APKBUILD#L97-L99 like that]
 
See {{github|688}} for a plan to automatically generate the linux APKBUILD right.
 
=== pmbootstrap builds packages that it should download from the binary repo/that are already built ===
{{note|Most likely, this is issue {{github|1023}}!}}
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
* <code>pmbootstrap -v install</code> (let it run until it starts building the package it should not build)
* <code>pmbootstrap log</code> (we need the log from here!)
 
=== 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.
 
=== du: unrecognized option: summarize ===
If you are using Alpine Linux and you encounter this issue, you will need to install the <code>coreutils</code> package.
 
<code>sudo apk add coreutils</code>

Latest revision as of 20:28, 16 December 2024