nyuuzyou/wikis huggingface dataset:
Analyzing Coredumps

This article is about analyzing coredumps in postmarketOS. It's a stub, the part with analyzing doesn't seem to return an useful stack in most cases, expanding this and removing this sentence is most welcome.
=== Enabling Coredumps ===
Unlike your typical systemd based distribution, we don't use coredumpctl and coredumps are not enabled by default, so you need to do the following steps first.
1. Write to /etc/security/limits.conf:
# <domain> <type> <item> <value>
* soft core unlimited
* hard core unlimited
2. Set a pattern for writing the core dumps, e.g.:
$ echo '/tmp/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
If you use a different directory, make sure all users can write to it by using chmod a+w.
3. Set ulimit before running the application that you want to debug. It is valid for the current shell session. If you want everything that runs in tinydm to create coredumps, put this in ~/.profile:
ulimit -c unlimited
==== Verifying that it works ====
If you are unsure whether this works, e.g. because the app you expect to crash doesn't create a coredump for some reason, build a simple C program that crashes:
$ echo '#include <stdlib.h>\nint main() { abort(); return 0; }' > /tmp/crash.c
$ gcc -o /tmp/crash /tmp/crash.c
$ /tmp/crash 
[1] 28898 abort /tmp/crash
=== Analyzing Coredumps ===
Install gdb (apk add gdb)
Open the coredump in gdb and run "bt" to get a backtrace. This part here of the article is a stub, let's put the full output here etc.
$ gdb /tmp/crash /path/to/coredump
Install debug symbols to get function names and line numbers for all libraries in the trace, e.g. musl-dbg and glib-dbg. Alpine doesn't have these for all libraries due to the size they consume, but they can be enabled on demand in edge to debug issues.
== See also ==
* Debugging the GNOME stack
* Cogitri's blog: Introducing corecollector
Category:Guide
Android DTB/DTBO Format

On modern Android devices, there is a 64-byte DTB header which can make porting slightly painful at first since the kernel does not generate it automatically.
To work around this, use mkdtboimg to generate a proper Android DTB image using the DTB that the kernel source tree generates.
For example, here are the commands used in the APKBUILD for the Samsung Galaxy Tab A7 Lite:
‎
# We also need to convert the kernel DTB into a proper android dtb image with the 64-byte header
	
mv "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb.bak
mkdtboimg create "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb.bak
rm "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb.bak
== Data Structure ==
Length (bytes)	Details
4 	Magic bytes. Always 0xd7b7ab1e.
4 	Total size. Combination of the header size itself and all of the table entries. Device-specific.
4 	Header size. Always 0x00000020 in this case.
4 	Entry size. Always 0x00000020 in this case.
4 	The number of table entries. Always 0x00000001 in this case.
4 	Offset to the first table entry. Always 0x00000020 in this case.
4 	Page size. Always 0x00000800 in this case.
4 	DTBO image version. Always null bytes in this case - the current version is 0. This is where the table header ends, and the next bytes are for the table entry in the DTB header.
4 	DTB size. Device-specific.
4 	DTB offset. Always 0x00000040 in this case.
4 	Device ID. Unused.
4 	Device revision. Unused.
16 	Unused.
== See also ==
The data structure information on the AOSP documentation website
Android Recovery

Android devices usually have a recovery partition, where another boot.img file can be flashed. It contains another kernel, and an extra initramfs, which is basically the whole recovery system. TWRP is the most popular recovery system, and before that CWM was most popular.
== Starting postmarketOS initramfs via adb ==
$ adb push ~/.local/var/pmbootstrap/chroot_rootfs_samsung-klte/boot/initramfs-samsung-klte /tmp/initramfs.cpio.gz
$ adb shell
$ cd /tmp
$ gzip -d initramfs.cpio.gz
$ cpio -i < initramfs.cpio
$ umount /data
$ umount /system
$ chroot /tmp/ /bin/sh
$ . ./init_functions.sh
$ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
$ /bin/busybox --install -s
$ /bin/busybox-extras --install -s
$ mount_proc_sys_dev
$ setup_mdev
$ mount_subpartitions
$ mount_boot_partition
$ extract_initramfs_extra /boot/initramfs-samsung-klte-extra
== See also ==
* Android Recovery Zip Installation
Category:Technical Reference
Android Translation Layer

Android Translation Layer is lightweight translation layer for running Android apps on Linux. It works similar to Wine and therefore does not require an Android container in the background unlike Waydroid. The project is quite new and the list of working applications is currently quite short. It is available in Alpine edge and therefore also in postmarketOS edge.
== Installation ==
$ sudo apk add android-translation-layer
== Usage ==
Run an Android application from APK file. Please do not confuse android APK files with Alpine APK files.
$ android-translation-layer application.apk
Install a desktop launcher for an Android application.
$ android-translation-layer --install application.apk
== Known working applications ==
A list of known working open source applications is available under Android Translation Layer/known working open source applications
A list of known working proprietary apps is available under https://gitlab.com/android_translation_layer/android_translation_layer/-/wikis/known-working-proprietary-apps
Android Translation Layer/known working open source applications

Following open source Android applications are known to work in Android Translation Layer
id 	name 	version	notes 	screenshot
org.schabi.newpipe 	NewPipe 	0.27.3 	Flatpak version available 	
org.happysanta.gd 	Gravity Defied 	1.1.1 	multi touch not yet supported 	
com.gh4a 	OctoDroid 	4.6.12 	oauth sign in works when the desktop launcher is installed	
de.schildbach.oeffi 	Öffi 	13.0.6 	Preferences Activity does not work 	
com.bnyro.wallpaper 	Wall You 	9.1 	 	
com.justdeax.composeStopwatch	Compose Stopwatch	1.8.2
Answering Machine

Most modems are closed source and therefore it is not possible to set up a local voicemail within a device as long as the firmware is not open to public observation and scrutiny.
However, it is possible to set an external voicemail, using an external computer or even an external portable device (e.g. postmarketOS).
== Computer as voice mail ==
=== Prepare your phone ===
==== postmarketOS ====
Instructions to autoanswer.
==== Android ====
* Android 8.0 or newer
** Install Coma Phone
** Mark "Answer at any angle".
* Android 2.0.1 or newer
** Install AutoAnswer
** Mark "Enabled?".
=== Prepare your computer ===
Install Listener.
Instructions:
* Set your telephone device to auto-answer mode.
* Connect your phone to PC.
* Set Listener to
* Play audio file: "Hello, I'm out of town. Please leave a message after the tone." (Ding!).
* Send audio via Email or XMPP.
* Phone auto-answer
* Listener detects sound.
* Listener begin recording.
* Listener stops recording after N seconds (e.g. 90 seconds).
* Listener sends audio via email.
on_event_start
selects the script/program to execute before the sample was recorded.
Best format for voice recordings is Speex.
== Telephone as voice mail ==
As of version 0.7.1 of Pinephone Modem SDK, it is potentially possible to establish a local voicemail in PinePhone and EG25-G devices.
== See also ==
* Tracking brewing using Audio Event Detection with Machine Learning
* Sound Event Detection using Machine Learning (EuroPython 2021)
Category:Guide
AppArmor

will be used in postmarketOS to sandbox applications, so they don't have more rights than necessary. Integration is in development, eventually it will be enabled by default.
As of writing, profiles are stored in the postmarketos-apparmor-profiles repository. Right now this contains all AppArmor profiles in postmarketOS, there is not yet a place to store Alpine specific AppArmor profiles (this is being discussed here).
== Installation ==
Make sure your kernel has apparmor support enabled (pmbootstrap kconfig check --apparmor). Then install apparmor and the profiles:
$ sudo apk add postmarketos-apparmor-profiles apparmor apparmor-utils
$ sudo rc-update add apparmor boot
Reboot and verify that it runs:
$ sudo aa-status
apparmor module is loaded.
2 profiles are loaded.
2 profiles are in enforce mode.
 /usr/bin/gnome-calculator
 /usr/bin/postmarketos-welcome
0 profiles are in complain mode.
0 profiles are in kill mode.
0 profiles are in unconfined mode.
2 processes have profiles defined.
2 processes are in enforce mode.
 /usr/bin/gnome-calculator (6138) 
 /usr/bin/postmarketos-welcome (6183) 
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
0 processes are in mixed mode.
0 processes are in kill mode.
== Modifying profiles ==
Profiles are stored in /etc/apparmor.d. See the quick guide to get an idea of how the profile language works.
After modifying a profile, reload it with:
$ sudo apparmor_parser -r /etc/apparmor.d/postmarketos-welcome-gtk3
Violations are logged to dmesg. Rules with deny cause violations not to be logged (meaning you will only find the unexpected violations in the log).
== See also ==
* : Get AppArmor support into postmarketOS
* AppArmor wiki
* Guide: profiling by hand
* Guide: profiling with tools
* Why AppArmor?
Apple A7

Apple A7 is the world's first aarch64 SoC for consumer devices. The ARMv8 specification is announced in 2011 and silicon design especially on a new architecture takes way longer than 2 years, so it comes with its own fair share of errata.
== Development ==
=== CPU ===
==== Caches ====
dc cvac does nothing. dc civac can work if the following dance is performed.
# Set bit 11 in s3_0_c15_c4_0 on boot.
# Before executing dc civac, unset bit 11 in s3_0_c15_c4_0
# dc civac
# Set bit 11 in s3_0_c15_c4_0 again.
=== Bootloader ===
Non-free checkra1n 1337 or openra1n (which still have non-free blobs) needed to boot pongoOS.
From pongoOS, pongoterm can be used to boot m1n1, which can boot Linux appended to it.
=== Graphics ===
A7 uses a PowerVR G6430 GPU. Right now graphics in linux is just a simplefb.
=== I2C ===
I2C in A7 is compatible with the I2C in M1 which is supported upstream. However, little work has been put in towards i2c enablement in device tree files.
=== SPI ===
SPI is similar to the SPI found on M1, it seems to be a subset and support needs to be added. However, none of the devices connected via SPI in all devices with A7 has a Linux driver. Notably, the multitouch sensor is connected via SPI.
=== WiFi ===
A7 doesn't have built-in WiFi module. Devices use a broadcom module connected over internal USB.
=== Bluetooth ===
A7 doesn't have built-in bluetooth module. Every device uses it's own bluetooth module typically of broadcom origin 
=== Modem ===
=== USB ===
A7 uses synopsys dwc2 version 2.72a. Role switching seems to be non-standard. There is also no support for the PHY in Linux. Hotplug appears to be broken.
=== GPS ===
A7 doesn't have built-in GPS module.
== Devices with a Apple A7 Chipset ==
Apple M1

== Development ==
=== Bootloader ===
Currently requires chainloading m1n1 after iboot,.</br>
Its bootrom version is 5540.0.0.400.2
=== Graphics ===
Please check 
=== WiFi ===
M1 doesn't have built-in WiFi module. Every device uses it's own WiFi module typically of broadcom origin.
=== Bluetooth ===
M1 doesn't have built-in bluetooth module. Every device uses it's own bluetooth module typically of broadcom origin.
=== Modem ===
=== GPS ===
M1 doesn't have built-in GPS module.
=== Audio ===
Audio is working on every devices now.
=== Codename references ===
According to The Apple Wiki there are 4 codenames for every M1 variants (M1, M1 Pro, M1 Max and M1 Ultra): 
SoC name	Codename 	Platform name
M1 	Tonga 	H13G
M1 Pro 	Jade Chop	H13S
M1 Max 	Jade 1C 	H13C
M1 Ultra	Jade 2C 	H13D
== Devices with a Apple M1 Chipset ==
Apple M1 Generic Port

A generic port for Apple Tonga(M1)-based devices.
== Contributors ==
# Asahi Linux Project
== Users owning this device ==
== How to enter flash mode ==
for DFU mode: https://support.apple.com/en-gb/guide/apple-configurator-2/apdd5f3c75ad/mac
== Bootloader ==
According to Asahi Linux's Wiki, m1n1 is the bootloader for Linux kernel booting.
m1n1 is the bootloader developed by the Asahi Linux project to bridge the Apple (XNU) boot ecosystem to the Linux boot ecosystem.
= What it does(from their wiki) =
*Initializes hardware
*Puts up a pretty logo
*Loads embedded (appended) payloads, which can be:
*Device Trees (FDTs), with automatic selection based on the platform
*Initramfs images (compressed CPIO archives)
*Kernel images in Linux ARM64 boot format (optionally compressed)
*Configuration statements
*Chainloads another version of itself from a FAT32 partition (if configured to do so)
Proxy mode enables a huge toolset of developer features, from reducing your Linux kernel test cycle to 7 seconds, to live hardware probing and experimentation, to a hypervisor capable of running macOS or Linux and tracing hardware accesses in real time while providing a virtual UART over USB. 
m1n1 can load U-Boot as a payload.
=== U-Boot ===
U-Boot is the default payload for m1n1 stage 2, and is used to provide a standard preboot environment familiar to AArch64 developers. External boot is not supported with the native Apple Silicon boot tooling, making U-Boot a hard necessity for providing a PC-like boot environment.
It is able to boot from any external media (USB drive, network, etc.) and users an execute any EFI binaries.
==== U-Boot Status ====
Feature 	Status
USB-A Ports	Not working due to their controller requiring firmware which we cannot redistribute.
USB devices	Certain USB devices which expose multiple functions (hubs with NICs, fancy gaming keyboards, etc.) do not work.
USB Hubs 	Hubs with SD Card slots may cause U-Boot crash.
== Installation ==
This device now have a WIP port in postmarketOS, contributions are welcomed!
to install the m1n1 bootloader, which is needed to be able to boot linux, including a potential postmarketOS port, Use this script: curl https://alx.sh | sh
(this script can also be used to install asahi linux, but also provides the functionality needed to install just the m1n1 bootloader)
== See also ==
This device does currently boot and works to a degree, it has a actively developed Linux port (https://asahilinux.org/).
Apple Mac mini 2020 M1 (apple-j274ap)

Yes, the Apple Mac mini itself has the same infomation like MacBook Air based on M1 chip!
== Contributors ==
# Asahi Linux Project
== Users owning this device ==
== How to enter flash mode ==
for DFU mode: https://support.apple.com/en-gb/guide/apple-configurator-2/apdd5f3c75ad/mac
== Bootloader ==
According to Asahi Linux's Wiki, m1n1 is the bootloader for Linux kernel booting.
m1n1 is the bootloader developed by the Asahi Linux project to bridge the Apple (XNU) boot ecosystem to the Linux boot ecosystem.
= What it does(from their wiki) =
*Initializes hardware
*Puts up a pretty logo
*Loads embedded (appended) payloads, which can be:
*Device Trees (FDTs), with automatic selection based on the platform
*Initramfs images (compressed CPIO archives)
*Kernel images in Linux ARM64 boot format (optionally compressed)
*Configuration statements
*Chainloads another version of itself from a FAT32 partition (if configured to do so)
Proxy mode enables a huge toolset of developer features, from reducing your Linux kernel test cycle to 7 seconds, to live hardware probing and experimentation, to a hypervisor capable of running macOS or Linux and tracing hardware accesses in real time while providing a virtual UART over USB. 
m1n1 can load U-Boot as a payload.
=== U-Boot ===
U-Boot is the default payload for m1n1 stage 2, and is used to provide a standard preboot environment familiar to AArch64 developers. External boot is not supported with the native Apple Silicon boot tooling, making U-Boot a hard necessity for providing a PC-like boot environment.
It is able to boot from any external media (USB drive, network, etc.) and users an execute any EFI binaries.
==== U-Boot Status ====
Feature 	Status
USB-A Ports	Not working due to their controller requiring firmware which we cannot redistribute.
USB devices	Certain USB devices which expose multiple functions (hubs with NICs, fancy gaming keyboards, etc.) do not work.
USB Hubs 	Hubs with SD Card slots may cause U-Boot crash.
== Installation ==
== See also ==
This device does currently boot and works to a degree, it has a actively developed Linux port (https://asahilinux.org/), as well as a somewhat working port by corellium that is claimed to be "completely usable" yet lacks any optimisation (https://www.corellium.com/blog/linux-m1)
== Notes ==
Now you can install other Linux like Debian from this website:Other.
To use Asahi's graphics driver, Update your kernel to their develop branch.
Apple iBridge T2 (apple-ibridgeT2)

== Contributors ==
* Asdfugil
== Users owning this device ==
== Memory ==
The amount of memory is either 1 GB or 2 GB depends on the storage configuration of the host Mac, so the information must be filled by loader. Memory interface power domains unused by the 1 GB memory model should be disabled by loader. When iBoot jumps into the m1n1 bootloader, the bottom of the memory all the way to a bit less than 512 MiB is usable. Then there are the framebuffer, tz0, and other firmware stuff. Memory after 512 MiB all the way to the top of DRAM is intended to be SSD cache for x86, however it can also be used for normal memory.
== How to enter flash mode ==
No proper flash mode, but kernel can be booted via checkra1n/PongoOS.
First you have to enter DFU mode.
To enter PongoOS, from where we can load the Linux kernel, run follwoing command on the host machine:
$ ./checkra1n -cpE
PongoOS will start booting and printing messages on the screen.
== Installation ==
== See also ==
Image in infobox is based on a m1n1 port and a close-to-mainline kernel port.
Corellium's work on A10 which may be able to be reused, see https://github.com/corellium/linux-sandcastle
Apple iPad 1G (apple-ipad1g)

== Contributors ==
* scintill
== Device Owners ==
== Booting ==
# Install syringe package in chroot: pmbootstrap chroot --add syringe
# Enter DFU mode (hold and with USB connected to computer)
# load openiboot
$ loadibec openiboot-ipad1g.bin
expect script for automating booting with oibc:
#!/usr/bin/expect
spawn oibc
send "!/path/to/vmlinuz\r"
sleep 0.1
send "\r"
expect "Received file"
send "kernel \"console=tty0\"\r"
expect "Done: kernel"
send "!/path/to/initramfs\r"
sleep 0.1
send "\r"
expect "Received file"
send "initrd\r"
expect "Done: initrd"
send "wait_boot 15000\r"
expect "Done: boot"
* Set console=ttySAC0 for UART console instead of framebuffer
* earlycon=s3c2410,0x82500000 and keep_bootcon may be useful too.
== Links ==
* openiboot (Great info on wiki)
* iDroid-kernel (older iDroid kernel with ipad support)
* Another fork of the iDroid kernel with more complete A4 support
* scintill/pmaports#1 (tracking issue)
* iPad Linux This page is a little collection of Linux on the iPad
* Project Sandcastle those awesome guys brought some little support for Android on iPhone 7/7+ and iPod touch 7G.
* prebuilt binaries for openiboot
Apple iPad 3 (apple-ipad3)

== Contributors ==
* NBon
* Haui2
== Users owning this device ==
== How to enter flash mode ==
To enter DFU mode, you disconnect USB, turn off the ipad and hold home and power for 10 seconds, release power and keep home pressed for another 8 seconds. Release home and connect the device to your computer.
If you use dmesg -w or journalctl -kf, you can watch the device connecting and see if it is in DFU mode.
Once DFU Mode is entered, you need to build a checkm8-arduino setup. For older iPad 3 OS versions (9.3.5 and previous), you can use other methods but I have not tested them yet.
You can download the A5X Version of Checkm8 here
https://github.com/a1exdandy/checkm8-a5?tab=readme-ov-file
It still needs to be combined with the arduino host shield library 2.0 and modified for the A5X. You can download the modified version here
https://forge.giftedmc.com/haui/ipad3_checkm8/src/branch/master
After successfully pwning the device, you need to upload and boot a kernel. For this, I tried ipwndfu but without success. Download here
https://github.com/axi0mX/ipwndfu
== Installation ==
Use pmbootstrap to build your own installation image.
== Current Status ==
The device is jailbreakable (tested) using K0k3shi9
Device secured vulnerable (tested) for A5X version of checkm8.
Device so far not responding to ipwdfu since the CPID seems to be wrong/incompatible.
Output:
CPID:8945 CPRV:00 CPFM:03 SCEP:10 BDID:04 ECID:00000368F00AED8A IBFL:00 SRTG:[iBoot-1062.2] PWND:[checkm8]
ERROR: No matching usbexec.platform found for this device.
== GPU-Capabilities ==
Video formats supported: H.264 video up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
== See also ==
https://theapplewiki.com/wiki/S5L8945
https://theapplewiki.com/wiki/IPad_(3rd_generation)
https://en.wikipedia.org/wiki/Apple_A5X
https://github.com/a1exdandy/checkm8-a5
Apple iPad 6th gen (apple-ipad7,5)

A mainline fork for this device is available here with further instructions here. Still needs to be tested and ported to postmarketOS.
== Contributors ==
== Users owning this device ==
== How to enter flash mode ==
Plug in the cable, hold Power and Home key for 2-4 seconds for device to power off completely, so the backlight is dimmed, then release the Power key and continue holding the Home key for 8 seconds until you get a new DFU device.
== Installation ==
== See also ==
This device does not currently boot or work, it doesn't have any Linux port, however there's Corellium's work on A10 which may be able to be reused, see https://github.com/corellium/linux-sandcastle
https://github.com/konradybcio/linux-apple is a more active repository for Linux kernel on Apple devices. Corellium has since abandoned all work on the Linux kernel running on iOS, instead choosing to work on their accurate paid iOS and Android device emulators.
Apple iPad Air 2 (apple-ipad5,3)

A mainline fork for this device is available here with further instructions here. Still needs to be tested and ported to postmarketOS.
== Contributors ==
* nergzd723
== Users owning this device ==
== How to enter flash mode ==
Plug in the cable, hold Power and Home key for 2-4 seconds for device to power off completely, so the backlight is dimmed, then release the Power key and continue holding the Home key for 8 seconds until you get a new DFU device. Run checkra1n.
== Installation ==
Apple iPad mini (apple-ipad2,5)

== Contributors ==
* User:Choc
== Maintainer(s) ==
== Users owning this device ==
== Installation ==
TODO
=== Jailbreaking ===
Get the .ipa file from Blizzard jailbreak.
Connect your device via usb and install the .ipa using Sideloadly.
Blizzard should now be installed on the device. To trust the developer certificate, go to Settings > General > Device Management.
Launch Blizzard and enable Patch tfp0 (kloader), then hit jailbreak.
If the device reboots but jailbreak fails (no Cydia), try again.
Install OpenSSH with Cydia, find your device's ip address by going into Settings > Wi-Fi > [network], then get kloader and scp it in (default root password: alpine)
...
TODO
== Additional notes ==
pongoOS doesn't work on 32-bit devices like this one.
kloader only loads one image into memory. I think ramdisk can either be packed with the linux executable or loaded alongside via multi_kloader.
== See also ==
https://www.theiphonewiki.com/wiki/IPad_mini