From 0c1370b5f1b3e8abc934ea913a4377f05f32e4a9 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 7 Aug 2017 22:05:24 +0300 Subject: Initial static build --- .gitignore | 1 - docs/blog/2017/05/26/intro/index.html | 177 +++ docs/blog/index.html | 47 + docs/index.html | 56 + docs/static/css/main.css | 34 + docs/static/css/tachyons.min.css | 3 + docs/static/img/banner.jpg | Bin 0 -> 129992 bytes docs/static/img/favicon.png | Bin 0 -> 295 bytes docs/static/img/recycle.png | Bin 0 -> 3502 bytes docs/wiki/Battery-replacement/index.html | 52 + .../BlackBerry-Bold-Touch-9900-(Dakota)/index.html | 73 ++ docs/wiki/Boot-process/index.html | 106 ++ docs/wiki/Build-internals/index.html | 69 ++ docs/wiki/Coolpad-Sky-3-E502-(Modena-2)/index.html | 71 ++ docs/wiki/Creating-a-package/index.html | 65 ++ docs/wiki/Development-guide/index.html | 77 ++ docs/wiki/Device-Wishlist/index.html | 58 + docs/wiki/Devices/index.html | 248 ++++ docs/wiki/External-resources/index.html | 63 ++ docs/wiki/Fairphone-2/index.html | 64 ++ docs/wiki/Firmware/index.html | 59 + docs/wiki/Glossary/index.html | 71 ++ docs/wiki/HTC-Ace-(HTC-Desire-HD)/index.html | 67 ++ docs/wiki/HTC-Bravo-(HTC-Desire)/index.html | 89 ++ docs/wiki/Home/index.html | 73 ++ .../index.html | 129 +++ docs/wiki/Initramfs-development/index.html | 86 ++ docs/wiki/Inspecting-the-initramfs/index.html | 52 + docs/wiki/Installation-Guide/index.html | 82 ++ .../index.html | 62 + docs/wiki/LG-G3-Global/index.html | 133 +++ docs/wiki/Matrix-and-IRC/index.html | 53 + .../wiki/Migration-to-aports-subfolders/index.html | 87 ++ docs/wiki/Milestones/index.html | 144 +++ docs/wiki/Mozilla-Flame/index.html | 181 +++ docs/wiki/Package-naming-convention/index.html | 54 + docs/wiki/Packaging-Plasma-Mobile/index.html | 1193 ++++++++++++++++++++ docs/wiki/Partition-layout/index.html | 74 ++ docs/wiki/Plasma-Mobile/index.html | 120 ++ docs/wiki/Porting-to-a-new-device/index.html | 146 +++ docs/wiki/Related-Projects/index.html | 50 + .../Samsung-N7100-(Galaxy-Note-II-GSM)/index.html | 96 ++ .../index.html | 116 ++ .../index.html | 63 ++ docs/wiki/Screen-Calibration/index.html | 60 + docs/wiki/Serial-debugging/index.html | 72 ++ docs/wiki/The-mainline-kernel/index.html | 68 ++ docs/wiki/Tips-and-tricks/index.html | 47 + docs/wiki/Troubleshooting/index.html | 179 +++ docs/wiki/Troubleshooting:grsec/index.html | 59 + docs/wiki/Troubleshooting:kernel/index.html | 144 +++ docs/wiki/Tuning-sysfs/index.html | 99 ++ docs/wiki/Upstreaming/index.html | 59 + docs/wiki/Using-prebuilt-kernels/index.html | 79 ++ docs/wiki/Wifi/index.html | 55 + docs/wiki/Xperia-E-Dual/index.html | 82 ++ docs/wiki/Xperia-Z2-Tablet/index.html | 63 ++ docs/wiki/Xperia-Z2/index.html | 64 ++ docs/wiki/_Sidebar/index.html | 85 ++ .../asus-grouper-(Google-Nexus-7-2012)/index.html | 83 ++ docs/wiki/deviceinfo-reference/index.html | 243 ++++ docs/wiki/deviceinfo_flash_methods/index.html | 89 ++ docs/wiki/htc-monarudo-(HTC-Droid-DNA)/index.html | 131 +++ docs/wiki/index.html | 181 +++ docs/wiki/jolla-sbj-(Jolla-phone)/index.html | 64 ++ docs/wiki/landrover-a9/index.html | 88 ++ .../wiki/lg-hammerhead-(Google-Nexus-5)/index.html | 154 +++ docs/wiki/lg-mako-(Google-Nexus-4)/index.html | 78 ++ docs/wiki/motorola-titan-(Moto-G-2014)/index.html | 188 +++ docs/wiki/nokia-rx51-(Nokia-N900)/index.html | 146 +++ docs/wiki/qemu-amd64-(QEMU-for-x86_64)/index.html | 66 ++ .../index.html | 83 ++ docs/wiki/samsung-S7562/index.html | 65 ++ .../index.html | 76 ++ .../samsung-i9100-(Samsung-Galaxy-SII)/index.html | 86 ++ .../index.html | 69 ++ .../wiki/sony-amami-(Xperia-Z1-Compact)/index.html | 95 ++ freeze.py | 1 + 78 files changed, 7744 insertions(+), 1 deletion(-) create mode 100644 docs/blog/2017/05/26/intro/index.html create mode 100644 docs/blog/index.html create mode 100644 docs/index.html create mode 100644 docs/static/css/main.css create mode 100644 docs/static/css/tachyons.min.css create mode 100644 docs/static/img/banner.jpg create mode 100644 docs/static/img/favicon.png create mode 100644 docs/static/img/recycle.png create mode 100644 docs/wiki/Battery-replacement/index.html create mode 100644 docs/wiki/BlackBerry-Bold-Touch-9900-(Dakota)/index.html create mode 100644 docs/wiki/Boot-process/index.html create mode 100644 docs/wiki/Build-internals/index.html create mode 100644 docs/wiki/Coolpad-Sky-3-E502-(Modena-2)/index.html create mode 100644 docs/wiki/Creating-a-package/index.html create mode 100644 docs/wiki/Development-guide/index.html create mode 100644 docs/wiki/Device-Wishlist/index.html create mode 100644 docs/wiki/Devices/index.html create mode 100644 docs/wiki/External-resources/index.html create mode 100644 docs/wiki/Fairphone-2/index.html create mode 100644 docs/wiki/Firmware/index.html create mode 100644 docs/wiki/Glossary/index.html create mode 100644 docs/wiki/HTC-Ace-(HTC-Desire-HD)/index.html create mode 100644 docs/wiki/HTC-Bravo-(HTC-Desire)/index.html create mode 100644 docs/wiki/Home/index.html create mode 100644 docs/wiki/How-to-find-device-specific-information/index.html create mode 100644 docs/wiki/Initramfs-development/index.html create mode 100644 docs/wiki/Inspecting-the-initramfs/index.html create mode 100644 docs/wiki/Installation-Guide/index.html create mode 100644 docs/wiki/Installing-packages-on-a-running-phone/index.html create mode 100644 docs/wiki/LG-G3-Global/index.html create mode 100644 docs/wiki/Matrix-and-IRC/index.html create mode 100644 docs/wiki/Migration-to-aports-subfolders/index.html create mode 100644 docs/wiki/Milestones/index.html create mode 100644 docs/wiki/Mozilla-Flame/index.html create mode 100644 docs/wiki/Package-naming-convention/index.html create mode 100644 docs/wiki/Packaging-Plasma-Mobile/index.html create mode 100644 docs/wiki/Partition-layout/index.html create mode 100644 docs/wiki/Plasma-Mobile/index.html create mode 100644 docs/wiki/Porting-to-a-new-device/index.html create mode 100644 docs/wiki/Related-Projects/index.html create mode 100644 docs/wiki/Samsung-N7100-(Galaxy-Note-II-GSM)/index.html create mode 100644 docs/wiki/Samsung-i9070-(Samsung-Galaxy-S-Advance)/index.html create mode 100644 docs/wiki/Samsung-n7100-(Samsung-Galaxy-Note-2)/index.html create mode 100644 docs/wiki/Screen-Calibration/index.html create mode 100644 docs/wiki/Serial-debugging/index.html create mode 100644 docs/wiki/The-mainline-kernel/index.html create mode 100644 docs/wiki/Tips-and-tricks/index.html create mode 100644 docs/wiki/Troubleshooting/index.html create mode 100644 docs/wiki/Troubleshooting:grsec/index.html create mode 100644 docs/wiki/Troubleshooting:kernel/index.html create mode 100644 docs/wiki/Tuning-sysfs/index.html create mode 100644 docs/wiki/Upstreaming/index.html create mode 100644 docs/wiki/Using-prebuilt-kernels/index.html create mode 100644 docs/wiki/Wifi/index.html create mode 100644 docs/wiki/Xperia-E-Dual/index.html create mode 100644 docs/wiki/Xperia-Z2-Tablet/index.html create mode 100644 docs/wiki/Xperia-Z2/index.html create mode 100644 docs/wiki/_Sidebar/index.html create mode 100644 docs/wiki/asus-grouper-(Google-Nexus-7-2012)/index.html create mode 100644 docs/wiki/deviceinfo-reference/index.html create mode 100644 docs/wiki/deviceinfo_flash_methods/index.html create mode 100644 docs/wiki/htc-monarudo-(HTC-Droid-DNA)/index.html create mode 100644 docs/wiki/index.html create mode 100644 docs/wiki/jolla-sbj-(Jolla-phone)/index.html create mode 100644 docs/wiki/landrover-a9/index.html create mode 100644 docs/wiki/lg-hammerhead-(Google-Nexus-5)/index.html create mode 100644 docs/wiki/lg-mako-(Google-Nexus-4)/index.html create mode 100644 docs/wiki/motorola-titan-(Moto-G-2014)/index.html create mode 100644 docs/wiki/nokia-rx51-(Nokia-N900)/index.html create mode 100644 docs/wiki/qemu-amd64-(QEMU-for-x86_64)/index.html create mode 100644 docs/wiki/qemu-vexpress-(Qemu-with-vexpress-soc)/index.html create mode 100644 docs/wiki/samsung-S7562/index.html create mode 100644 docs/wiki/samsung-g800f-(Samsung-Galaxy-S5-mini)/index.html create mode 100644 docs/wiki/samsung-i9100-(Samsung-Galaxy-SII)/index.html create mode 100644 docs/wiki/samsung-maguro-(Google-Galaxy-Nexus-GSM)/index.html create mode 100644 docs/wiki/sony-amami-(Xperia-Z1-Compact)/index.html diff --git a/.gitignore b/.gitignore index d575763..a295864 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ *.pyc __pycache__ -build/ \ No newline at end of file diff --git a/docs/blog/2017/05/26/intro/index.html b/docs/blog/2017/05/26/intro/index.html new file mode 100644 index 0000000..c0b8a6d --- /dev/null +++ b/docs/blog/2017/05/26/intro/index.html @@ -0,0 +1,177 @@ + + +
+ + +
+ postmarketOS
+ Introduction post to postmarketOS, a touch-optimized, pre-configured Alpine Linux with own packages, that can be installed on smartphones. (Not usable for most people yet!)
+ +Update: Alpine Linux developers do not see their distribution as "GNU/Linux", so I won't be using this term for Alpine or pmOS anymore. One of these developers, ^7heo, helped me to reword this article and other pages on this blog accordingly, thank you!
+ +Minimalistic Linux distributions run fine on ten year old PCs.
+It is 2017. Pick an average PC from 2007 and install a minimal Linux based operating system. You will be able to do basic computing tasks (eg. surfing the web, reading E-Mails, listening to music, chatting) just like on an expensive modern PC. You will even get security updates, so your old computer is protected, just like as a new one.
+Why are Android/Linux phones different?
+Androids architecture is based on forking (one might as well say copy-pasting) the entire code-base for each and every device and Android version. And then working on that independent, basically instantly incompatible version. Especially adding device-specific drivers plays an important role.
+This workflow makes it next to impossible to patch all Android devices with security updates in time or at all (Stagefright vulnerabilities for example rendered one billion devices vulnerable). And even if the vendor provides updates, it will only be for a limited time and then you must buy a new device to get security updates or the latest Android version. How convenient!
+Alright, so there is the LineageOS community, which provides weekly updates for an impressive number of smartphones. They provide a practical solution today, and I am very grateful for that. However, such Android based projects will always run behind Google and the phone industry, fixing only symptoms but never the root-cause.
+This is just the tip of the iceberg. Android has way more problems, read Cascardo's GNU on Smartphones (part II) for more nightmares.
+We can fix this as a community.
+Here is the solution: Bend an existing Linux distribution to run on smartphones. Apply all necessary changes as small patches and upstream them, where it makes sense.
+Of course I am not the only one, that came to this conclusion - especially in the last few weeks with the Halium project rising (greetings!). I am all-in for working together — sharing udev rules, merging Android kernels together, whatever makes sense!
+ + +I'm working on an Alpine Linux based distribution called postmarketOS where each phone will have only one unique package — all other packages are shared among all devices.
+These device-$vendor-$name packages contain a so-called /etc/deviceinfo file, which describes what makes the device special: SD card availability, which flash software to use and other information. The file format is not stable yet, and once we have common kernels for multiple devices, I'd like to include the required modules and dtb name.
And just to make it clear, postmarketOS does not fit the Halium model, as it avoids the Android build system entirely and does not run any part of the Android userspace next to its more or less typical Linux userspace. (At least not in the regular install, but it could come at some point in the future as optional compatibility layer for Android applications if someone wants to work on it. Personally, I'd rather have native Linux applications (in the case of Alpine: linked against musl, dynamically or statically) than Android apps on my phone.)
+ +So much for the theory. Practically I can show you a sophisticated chroot/build/flash tool called pmbootstrap which should allow fast and clean development progress, both in porting to new phones and in implementing hardware support for the existing ports (more on pmbootstrap below). That is also where most of the time went during development so far, so don't expect too much of postmarketOS. Most drivers don't work so you can't make phone calls or use the WiFi. Nevertheless, here is the current state of postmarketOS.
+Devices:
+Features:
+Generally speaking, the samsung-i9100 port works better than the lg-mako port. The latter has some strange driver bugs. The boot splash images only appear for a second, XWayland does not work there and the colors in Weston are all red. I even had to patch Weston before it worked at all. Without the patch it assumes it should draw with 0 Hz — in other words: Never ;)
+It should be noted, that the Replicant, the free software clone of Android, also targets the samsung-i9100 and has open source user-space drivers for the modem, which I plan to package for postmarketOS/Alpine Linux.
+ +Technical details incoming! If you're not into that, skip this section.
+Alpine Linux is really small. A base installation is only about 6 MB in size and takes not more than a few seconds to extract! Thanks to this characteristic, I was able to write a bootstrap program that abstracts everything in chroots and therefore basically runs on top of any Linux distribution (GNU-based or not), which has Python 3 and the openssl command line program available.
Consequently, the host system does not get touched when installing the required programs (fastboot etc.) and your distribution doesn't even need to have them packaged.
Quick feature rundown:
+x86_64* (building, flashing, ...)armhf* (building)armhf* (target rootfs)umount) and zappingabuild, the "light version of makepkg"APKBUILDs are very similar to Arch Linux' PKGBUILDsarmhf-packages:x86_64 chrootarmhf chroot, use cross-compiler with distcc from x86_64 chroot (alarm-style)gcc, no pre-built Android toolchainccache (also works with distcc/cross-compiler)openssl against keys shipped with pmbootstrapinstall action asks for the user's and for the root partition password.* x86_64/armhf: Example architectures for host/target. The code is generic, so it should work with any architectures supported by Alpine Linux.
Future goals and where you could help
+Rough direction of where I'd like postmarketOS to head to. In case you're a hacker who wants to help, feel free to do so. But please write into the tracker before starting serious work. This way we can make sure, that we do not have redundant work.
+Pick an old Android device, that you don't need anymore and start porting postmarketOS for it. It should be pretty straight forward. One device-* package, one for the kernel, calibrate the touchscreen, and the demos should more or less work already!
If you're feeling adventurous, try a non-Android device. How about iPhones? I'll probably be working on a port for at least one non-Android device myself for demonstration purposes.
+Fix the lg-mako screen colors and/or make the following peripherals work:
+In most cases, the drivers are already provided by the Android/LineageOS kernels, that we currently use and only need to be configured in the userspace (for example with udev rules).
+The long time goal is using the mainline kernel.
+Package a Linux-based phone interface. Plasma mobile seems to be the most complete one right now (although still not stable). But I'd also be interested in ubports (fork of the discontinued Ubuntu Touch) once it matures. Or maybe writing a minimal Android-like interface based on libweston.
+From what I understand, the SailfishOS interface is closed source, so that will not be an option.
+postmarketOS is developed in the spirit of regular Linux distributions, so there's no problem in having multiple phone interfaces (just like KDE/Gnome/XFCE/...) and let the user choose.
+Great care has been taken to make pmbootstrap safe, as it will run on productive systems of postmarketOS developers. This is not the case for postmarketOS in its current proof-of-concept state (Weston runs as root, ...) so we must work on that before it can be used in real life. Even better would be privilege separation throughout the entire OS.
+ +...but the blog post is long enough as it is, so I'll wrap it up. Thanks for reading, thanks to my friends who reviewed earlier versions of this blog post. Thanks to Replicant, LineageOS, Halium. Together, we can make the vision of long-lasting, open source smartphone operating systems a reality!
+Tell your friends!
+ +
+ postmarketOS
+
+ postmarketOS
+
+postmarketOS (pmOS), is a touch-optimized, pre-configured Alpine Linux that can be installed on smartphones and other mobile devices. The project is at very early stages of development and is not yet usable for most users.
+For further details read our introductory blog post.
+Find us on:
+
+ postmarketOS
+ Add replacement guides and experiences you've made with with batteries bought online here. Be careful, some batteries do not work as good as advertised or might even explode. Do your research on the vendor, before buying.
+TODO
+
+ postmarketOS
+
+ postmarketOS
+ Have you already flashed your device with pmOS? Now it's time to run it.
+Power on your device and connect it to your USB port. pmOS uses the USB interface as a network interface and runs a DHCP server on it and dmesg will show something like
[ 6284.442088] usb 1-1: new high-speed USB device number 36 using xhci_hcd
+[ 6284.627106] usb 1-1: New USB device found, idVendor=18d1, idProduct=d001
+[ 6284.627123] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
+[ 6284.627134] usb 1-1: Product: Android
+[ 6284.627143] usb 1-1: Manufacturer: Android
+[ 6284.627151] usb 1-1: SerialNumber: 0123456789ABCDEF
+[ 6284.632322] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-1, RNDIS device, b2:c4:1e:03:64:b9
+[ 6285.239048] rndis_host 1-1:1.0 enp0s20f0u1: renamed from usb0
+[ 6285.287058] IPv6: ADDRCONF(NETDEV_UP): enp0s20f0u1: link is not ready
+
+
+And you'll have a new interface with IP in the range 172.16.42.0/24
+$ ifconfig enp0s20f0u1
+enp0s20f0u1 Link encap:Ethernet HWaddr b2:c4:1e:03:64:b9
+ inet addr:172.16.42.107 Bcast:172.16.42.255 Mask:255.255.255.0
+ inet6 addr: fe80::dbd2:4531:89f2:d2/64 Scope:Link
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ RX packets:12 errors:0 dropped:0 overruns:0 frame:0
+ TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
+ collisions:0 txqueuelen:1000
+ RX bytes:1226 (1.2 KB) TX bytes:8375 (8.3 KB)
+
+
+It the interface doesn't automatically get an IP address on your system (for example on systems without NetworkManager) you need to start a dhcp client to get one.
+# Replace the interface name with the one on your machine
+$ dhclient -v enp0s20f0u1
+
+
+If this fails, you may need to first assign an ethernet address to it:
+# ip l set enp0s20f0u1 address 12:12:12:12:12:12
+
+
+Then you can try the above dhclient command.
+At this point, your device will show a logo and will be waiting for you to connect using telnet and enter the password to decrypt the filesystem (Make sure the last segment of the IP address is a "1" and not what is shown in the output of ifconfig!).
telnet 172.16.42.1
+Trying 172.16.42.1...
+Connected to 172.16.42.1.
+Escape character is '^]'.
+
+Enter passphrase for /dev/mapper/mmcblk0p25p2:
+Connection closed by foreign host.
+
+
+After entering the password, you'll get disconnected and the graphic interface will show up in your device.
+Congratulations, you are now running postmarketOS!
+From now on you can also login to your device using ssh and the password you set during the install phase
$ ssh user@172.16.42.1
+user@172.16.42.1's password:
+Welcome to postmarketOS!
+
+This distribution is based on Alpine Linux.
+Read both our wikis to find a large amount of how-to guides and
+general information about administrating and development.
+See <https://postmarketos.org/wiki> and <https://wiki.alpinelinux.org>.
+
+You may change this message by editing /etc/motd.
+
+localhost:~$
+
+
+Use sudo to run commands as root, it is configured.
+ postmarketOS
+ To build a package with pmbootstrap, you will only need the command pmbootstrap build hello-world. Optionally with --force to build even if the package was already built, and with --arch=armhf to build for another architecture, replace armhf accordingly. This wiki page lists some more information about what is going on in the background.
The initramfs shows the boot splash images, and allows the root partition to be unlocked (currently via telnet). You can add a hook to inspect the initramfs running on the device, as described in [[Inspecting the initramfs]].
+To rebuild the initramfs, run mkinitfs inside the chroot with the right parameters (or - much easier - pmbootstrap initfs build). This gets done automatically, whenever a new kernel gets installed, or when the postmarketos-mkinitfs package gets installed the first time.
pmbootstrap wraps around abuild (Alpine's official program to build [[apks|Glossary#apk]]), but it does a few things different than abuild (which internally often calls apk):
+ pmbootstrap can cross-compile out of the box, utilizing different chroots as needed (see below for details)
+ pmbootstrap does dependency parsing on its own (so it works across the aports folder and the binary repository, also with timestamp based rebuilds and can detect across chroots when a package is outdated and explicitly install them).
+ pmbootstrap does not honor operators in dependencies, such as: <, >, =, !. These simply get ignored (! packages don't count as dependencies). This may lead to errors, if it does please report them. However, since we're calling apk to install the packages, it does the real dependency checking and so far it's working well enough.
+ pmbootstrap parses APKINDEX and APKBUILD files on its own.
+ APKINDEX parsing is considered to be pretty good (because the format is dead simple!)
+ APKBUILD parsing would require a shell to be done perfectly (which would in turn kill performance). The way it is implemented right now, is that the variables we care about are hardcoded inside the pbm/config/__config.py or if not possible otherwise directly in pmb/parse/apkbuild.py. That is really fast and works for all packages we care about. If it breaks somewhere, it should be easy to patch.
+ pmbootstrap does not remove build dependencies after a build is done. This is for performance reasons - if you want a clean stat, run pmbootstrap zap.
+ pmbootstrap has a hack right now, that gzip always uses weak compression (also for speed)
There are two cross-compile types supported. pmb.build.autodetect.crosscompile() figures out, which one is the right one for each build.
+ None: The package does not have any binaries (noarch), it ends in -repack (such as qemu-user-static-repack) or the target architecture is the same as the "native" architecture (e.g. compiling heimdall for x86_64 on an x86_64 system).
+ "native": the build system of the package understands cross-compiling, like all kernel packages. We can use the native chroot with the cross-compiler inside that chroot for maximum speed.
+ "distcc": the build system of the package does not* understand cross-compiling, so we run the whole compiling process inside a chroot with the target architecture (with qemu user mode emulation, this is slow). We avoid using qemu emulation for the compiler though, because we use the cross-compiler inside the native chroot through distcc (which was originally meant to share compiling efforts across the network, but it works for this case. Arch Linux ARM also does this and has a detailed description of how to set this up manually.)
pmbootstrap uses various caches. They can all be found inside the work folder, and start with cache_. All cache folders get mounted to the appropriate chroots, depending on $ARCH. They are shared among the chroots, when it makes sense (e.g. cache_distfiles).
+ cache_apk_$ARCH: APK files from binary repositories (see also: Local APK cache)
+ cache_ccache_$ARCH: ccache: Whenever you compile something with pmbootstrap, the output gets cached in this folder (depending on the architecture). When you compile the same code for the second time, the cached output gets used, thus saving you a lot of time (think of re-compiling kernels, because you want to test another kernel config option etc.)
+ cache_distfiles: Whenever you build a package, abuild (which pmbootstrap wraps) will download the source files to the distfiles cache (and skip these downloads, when they already exist). The exact file name can be controlled inside the APKBUILD (more info).
+ cache_git: pmbootstrap can download git repositories. This gets used in pmbootstrap aportgen, which copies a package (aka. aport) from Alpine Linux and customizes it (for example: gcc-armhf), so we inherit all patches and changes automatically, without much maintenance work. The git repos get stored inside this folder.
+* cache_http: This stores files, that get downloaded with pmb.helpers.http.download(), so they don't need to be downloaded again every time. Currently, this gets used for the initial download of Alpine Linux' main repositories APKINDEX.tar.gz and apk-tools-static (which is a static build of the apk package manager, used to set up the chroot).
+ postmarketOS
+ Flashing a custom kernel is not possible yet, but McBitter is working on replacing the bootloader with a custom fork of LK (a proprietary fork of LK is already present on the device, but it does not allow flashing a custom kernel). When that works, porting pmOS can begin.
+
+ postmarketOS
+ Here is a practical approach on how to port packages from other Linux distributions to pmOS (because that is usually the fastest way). Feel free to extend this information, and to add other distributions.
+musl as libc, not glibc. Never add glibc as dependency.sh for building packages. Do not use bash specific features.subpackages="$pkgname-doc" (more info)Search here, click the package name, click on "Source Files" on the top right. A git repo with the PKGBUILD and all other files (such as patches appears).
APKBUILDs do not have the arrays from bash, use flat strings insteadoptdepends-doc subpackages (see above)APKBUILD has different options (!makeflags won't work, but it has !strip and !check)
+ postmarketOS
+ If happens often that we commit changes and then we realize that we forgot to regenerate APKBUILD checksums. This is noticed by Travis (example) but you might want to avoid it.
+You can install the following git hook that is run every time before you commit.
+Copy the following code to .git/hooks/pre-commit inside your pmbootstrap repository:
#!/bin/bash
+#
+# PostmarketOS pre-commit hook
+# Checks for bad checksums
+
+./test/check_checksums.py
+
+
+Now this is what happens when you forgot to regenerate checksums for some aport and try to commit
+$ git commit -a
+Checking device-qemu-aarch64 for correct checksums
+[13:45:23] (native) generate checksums for device-qemu-aarch64
+[13:45:23] Done
+MM aports/device/device-qemu-aarch64/APKBUILD
+
+diff --git a/aports/device/device-qemu-aarch64/APKBUILD b/aports/device/device-qemu-aarch64/APKBUILD
+index 99b811b..c4cee6c 100644
+--- a/aports/device/device-qemu-aarch64/APKBUILD
++++ b/aports/device/device-qemu-aarch64/APKBUILD
+@@ -21,4 +21,4 @@ package() {
+ "$pkgdir"/etc/deviceinfo
+ }
+
+-sha512sums="a18ab789c19d8802be6a9e9c842f4c304f267bd78f46b096b4ba6609430d1544e0a9eca9bc22db67a0728efae3aad6c2def9f7e64157d31aeb31b4bb839076d5 deviceinfo"
++sha512sums="8df46383685a40a96b7c604c29d413ecdd4b4a9b92cb61f452283042f189b1ca01cb70632fec0711dd67229e0501729762c6841359ac7ea455f516b512abce9c deviceinfo"
+
+** The checksums are not correct
+
+
+After that, simply do git commit -a --amend -n (-n is necessary so that this time the hook is not triggered).
+ postmarketOS
+ We have been asked, which devices we would like to see pmOS running on - by people who might specifically buy them (with broken screens etc, to get them cheaper) to help the project. Please list devices here, that you would like to see pmOS running on. Do not list devices, that we already have a port for, or specify a reason why you do.
+Devices that might have working mainline linux support:
+
+ postmarketOS
+ Please add devices you're porting here, and write your porting progress in the wiki page. Devices are sorted alphabetically.
+Devices will be officially supported in pmbootstrap when the encrypted root partition can be unlocked and graphical output works.
| Device | +Code | +Status | +
|---|---|---|
| [[Google Galaxy Nexus (GSM) | +samsung-maguro (Google Galaxy Nexus GSM)]] | +samsung-maguro | +
| [[Google Nexus 4 | +lg-mako (Google Nexus 4)]] | +lg-mako | +
| [[Google Nexus 5 (GSM) | +lg-hammerhead (Google Nexus 5)]] | +lg-hammerhead | +
| [[Google Nexus 7 (2012) | +asus-grouper (Google Nexus 7 2012)]] | +asus-grouper | +
| [[HTC Desire | +HTC-Bravo-(HTC-Desire)]] | +htc-bravo | +
| [[HTC Desire HD | +HTC-Ace-(HTC-Desire-HD)]] | +htc-ace | +
| [[LG G3 Global]] | +lg-d855 | +fSTU | +
| [[Moto G 2014 | +motorola-titan (Moto G 2014)]] | +motorola-titan | +
| [[Nokia N900 | +nokia-rx51 (Nokia N900)]] | +nokia-rx51 | +
| [[QEMU (arm) | +qemu-vexpress (Qemu with vexpress soc)]] | +qemu-vexpress | +
| [[QEMU (x86_64) | +qemu-amd64 (QEMU for x86_64)]] | +qemu-amd64 | +
| [[Samsung Galaxy Note 2 | +Samsung-N7100-(Galaxy-Note-II-GSM)]] | +samsung-n7100 | +
| [[Samsung Galaxy S Advance | +Samsung-i9070-(Samsung-Galaxy-S-Advance)]] | +samsung-i9070 | +
| [[Samsung Galaxy SII | +samsung-i9100 (Samsung Galaxy SII)]] | +samsung-i9100 | +
| Device | +Code | +Status | +
|---|---|---|
| [[BlackBerry Bold Touch 9900 | +BlackBerry-Bold-Touch-9900-(Dakota)]] | +blackberry-dakota | +
| [[Coolpad Sky 3 E502 (Modena 2)]] | ++ | + |
| [[Fairphone 2 | +fairphone-2]] | +fairphone-fp2 | +
| [[HTC Droid DNA | +htc-monarudo-(HTC-Droid-DNA)]] | +htc-monarudo | +
| [[Jolla phone | +jolla-sbj (Jolla phone)]] | +jolla-sbj | +
| [[Landrover A9 | +landrover-a9]] | +landrover-a9 | +
| [[Mozilla Flame | +mozilla-flame]] | +mozilla-flame | +
| [[Samsung Galaxy S5 mini | +samsung-g800f (Samsung Galaxy S5 mini)]] | +samsung-g800f | +
| [[Samsung Galaxy S Duos S7562 | +samsung-S7562]] | +samsung-s7562 | +
| [[Xperia Z1 Compact | +sony-amami-(Xperia-Z1-Compact)]] | +sony-amami | +
| [[Xperia Z2 Tablet | +Xperia Z2 Tablet]] | +sony-castor-windy | +
| [[Xperia Z2 | +Xperia Z2]] | +sony-sirius | +
| [[Xperia E Dual | +Xperia E Dual]] | +sony-nanhu | +
| Letter | +Meaning | +
|---|---|
| A | +Audio | +
| F | +Flash to device | +
| M | +Mainline kernel | +
| S | +Screen | +
| T | +Touch | +
| U | +USB Networking | +
| W | +Wifi | +
| X | +XWayland | +
A lowercase letter indicates partial or incomplete progress in a category.
+ +
+ postmarketOS
+ This list is a collection of presentations, talks and other resources that are somehow related to postmarketOS and can help you to dive in some specific topics.
+
+ postmarketOS
+ This is what I did: +Use the efidroid lk.img (have to compile yourself right now) for working around an fastboot/lk issue in the stock Fairphone bootloader.
+fastboot boot lk.img
+fastboot flash system pmOS_system.img
+
+
+Booting the boot.img doesn't work currently because of dt problems. Probably a similar issue as on the Mozilla Flame.
+pmOS branch: https://github.com/postmarketOS/pmbootstrap/tree/device-fairphone-fp2 +z3ntu's branch (maybe more up-to-date): https://github.com/z3ntu/pmbootstrap
+lk = Little Kernel (that's what the bootloader which includes fastboot is based on for most newer devices)
+dt = Device Tree (method of describing hardware, see https://www.devicetree.org/)
+ +
+ postmarketOS
+ There are closed source firmware components in every phone, and they are dangerous. It seems next to impossible to replace them with open source components, and it won't be feasible any time soon for postmarketOS. Yet, this is an interesting topic, so this page provides links for deeper insight into the topic.
+
+ postmarketOS
+ If you found a technical term related to this project, that you had to research to understand, please add it here (alphabetically sorted).
+See also: +* Alpine Linux:Glossary
+The minimal Linux distribution, that postmarketOS is based on. Actually, pmOS only adds a few packages on top of it, and provides the installer and development environment - that is the plan, to keep following upstream as close as possible. Alpine developers do not see their distribution as "GNU/Linux". That being said, it works a lot like a typical Desktop Linux distribution. You have your package manager, the typical shell commands, you can install typical Linux software, and so on.
+The Google provided 3.4 kernel as base for all Qualcomm devices.
+One of the following:
+ Android app format
+ Alpine Linux package (also ends in .apk, but totally incompatible!), which are actually gzipped tar files
+* Alpine Linux package manager (apk)
The binary device tree, this is a file containing a description of the hardware in the device since phones don't have discoverable busses like x86 platforms. These are created from dts files in the kernel repository and produce a file called zImage-dtb for some Android kernels (older Android kernels do not generate a dtb file at all and have hardcoded the information directly in the kernel source). In mainline kernels, dtb files for all supported boards are created at once.
Direct Rendering Infrastructure, the modern Linux kernel API for drawing to the screen.
+Linux framebuffer a (more or less?) deprecated API from the Linux kernel, that allows drawing to the screen. Newer drivers use the DRI API instead (see above). Android devices usually have drivers for framebuffer, instead of DRI.
+lk is the kernel where fastboot runs on - at least all new-ish qualcomm devices is using lk and new-ish mediatek devices too
OpenRC is a dependency-based init for Unix-like systems. It is the default init system of Alpine Linux.
+Weston is the reference implementation of a Wayland compositor. It has various backends that lets it run on Linux kernel modesetting and evdev input as well as under X11.
+We have chosen Weston as demo because we didn't want to use X11, as this is slowly dying. Also there's libweston, which might come in handy later (you can write your own desktop environment and inherit the hardware compatibility from weston). Weston is nice as demo useful at this moment of the development, but not usable as phone interface, so we'll need different desktop environments packaged sooner or later. See issue #62
+Full Disk Encryption, by default the rootfs created by pmbootstrap is fully encrypted with luks, preventing the phone data to be retrieved without password if the device is turned off. This can optionally be disabled with --no-fde for debugging purposes.
+ postmarketOS
+
+ postmarketOS
+ dev: size erasesize name
+mtd0: 000a0000 00020000 "misc"
+mtd1: 00480000 00020000 "recovery"
+mtd2: 00300000 00020000 "boot"
+mtd3: 0fa00000 00020000 "system"
+mtd4: 02800000 00020000 "cache"
+mtd5: 093a0000 00020000 "userdata"
+
+
+pmbootstrap installpmbootstrap flasher boot
+ postmarketOS
+ postmarketOS is a touch-optimized and pre-configured Alpine Linux. It can be installed on smartphones and other devices. It is in a very early, experimental state and not usable for most people yet. pmbootstrap allows installation and development of pmOS. As of now, its repository contains all of the projects code, pmbootstrap itself and all package build recipes (aports). Therefore this wiki contains all information about pmOS, not only about pmbootstrap. Here are the most important links:
+
+ postmarketOS
+ If you can't find a full ROM image for your device, consider extracting the boot.img file directly from your device with adb. +1. Find the download link for a full image on https://download.lineageos.org/ +2. Run the following commands (replace the download link accordingly)
+pmbootstrap build unpackbootimg
+pmbootstrap chroot
+apk add unpackbootimg
+su - user
+mkdir /tmp/bootimg_info
+cd /tmp/bootimg_info
+wget "https://mirrorbits.lineageos.org/full/hammerhead/20170530/lineage-14.1-20170530-nightly-hammerhead-signed.zip"
+unzip *.zip
+unpackbootimg -i boot.img
+
+
+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:
+ BOARD_KERNEL_BASE -> deviceinfo_flash_offset_kernel
+ BOARD_RAMDISK_OFFSET -> deviceinfo_flash_offset_ramdisk
+ BOARD_SECOND_OFFSET -> deviceinfo_flash_offset_second
+ BOARD_TAGS_OFFSET -> deviceinfo_flash_offset_tags
+ BOARD_PAGE_SIZE -> deviceinfo_flash_pagesize
+ BOARD_SECOND_SIZE -> deviceinfo_flash_offset_second
+* (contents of the extracted boot.img-base file) -> deviceinfo_flash_offset_base (defaults to 0x10000000)
NOTE: Some useful info can be pulled via fastboot too (in case you have the device at hand) by executing fastboot getvar all
adb shell to gain access to the console on the device, and type uname -m.armhf and aarch64 architectures. If the output is armv7l, for example, you should use armhf as your device architecture.android_device_, open that repository and look into the lineage.dependencies file. It lists other LineageOS repositories there - open these repositories, until you finally find the repository with "kernel" in the name. Example: First, Second, Third: Kernel repo!DEFCONFIG= line inside the build.config inside the kernel repository (if available) (example)android_device_ repository (as shown in LineageOS kernel source repository above), look for a TARGET_KERNEL_CONFIG line in the BoardConfig.mk.In the case where you have located the kernel source for your device but there is no build.config, have a look at the arch/arm/configs/ directory. E.g. for Moto G 2014 "titan" that uses android_kernel_motorola_msm8226 you have a titan_defconfig file there.
Example, contains the following information: + kernel commandline + ramdisk offset, tags offset, pagesize, base +* boot partition size
+Find the LineageOS repository for your device by using the repository filter function here and typing in your device's code name. You need the repository starting with android_device_. Inside that repository, there should be a proprietary_components.txt or proprietary-files.txt, which has among lots of files, that we do not need, the paths to the firmware files - starting with /vendor/firmware. Combined with some additional research, you should be able to find the files needed for the hardware, that you want to get running (e.g. wifi). Now you have the names of the firmware files. First look if they are provided by linux-firmware, and if not, find them elsewhere and package them yourself (as in samsung-i9070).
See also: Wifi
+ +
+ postmarketOS
+ After the installation, you will have two initramfs files in your device's /boot folder.
% ls ~/.local/var/pmbootstrap/chroot_rootfs_samsung-i9100/boot
+initramfs-samsung-i9100 initramfs-samsung-i9100-extra vmlinuz-samsung-i9100
+
+
+Regular Linux distributions only have one initramfs file. We have split it into two to work around the size limitations, that some devices have. The regular initramfs is relatively small (~1.5 mb, and we could make it smaller if necessary!) and loads the contents of the initramfs-extra from the pmOS boot partition during the boot process.
+The pmOS boot partition is a subpartition of the system partition (SD cards: simply a real partition on the SD card), so we can make it almost as big as we want.
+pmbootstrap initfs, pmbootstrap flasher flash_kernel)When you change too much, it will simply not work and you most likely will have no idea why it does not work. Go back to the last working version and do smaller changes at a time.
+pmbootstrap initfs can do more than rebuilding the initramfs:% pmbootstrap initfs --help
+usage: pmbootstrap initfs [-h]
+ {hook_ls,hook_add,hook_del,ls,build,extract} ...
+
+positional arguments:
+ {hook_ls,hook_add,hook_del,ls,build,extract}
+ hook_ls list available and installed hook packages
+ hook_add add a hook package
+ hook_del uninstall a hook package
+ ls list initramfs contents
+ build (re)build the initramfs
+ extract extract the initramfs to a temporary folder
+
+optional arguments:
+ -h, --help show this help message and exit
+
+
+This is probably caused by a syntax error. Use shellcheck to check your scripts for syntax errors. You could also loop forever or spawn a shell (if you have a hardware keyboard or serial cable connected) at some point for debugging (while true; do sleep 1; done) and use the telnet shell to test the commands, that are failing, interactively.
By default, all output from the initramfs get redirected to /pmOS_init.log. If you want the output through the debug cable you need to add PMOS_NO_OUTPUT_REDIRECT to your kernel command line.
+ postmarketOS
+ This page explains how to connect to your device when it has booted to the [[initramfs|Initramfs-development]] by installing the so-called usb-shell hook. This is useful if you want to know more about the [[boot process]], simply inspect the initramfs or you want to debug why something doesn't work.
+NOTE: This is considered a security hole. Only use it for debugging, and uninstall the usb-shell hook afterwards
+By default, initramfs launchs a telnet daemon listening on :23 waiting for your partition password.
It is possible to enable a second telnet daemon on :24 that gives you a shell this way:
./pmbootstrap.py initfs hook_add usb-shell
+./pmbootstrap.py install
+
+
+After reflashing the kernel or booting with the new initramfs image, you should be able to connect to the new telnet instance.
+ +
+ postmarketOS
+ This page is a work in progress, and is not complete enough at this point to be useful.
+If you own a device which has been ported to postmarketOS, then this page will help you to obtain, build, and install postmarketOS to this device.
+Any commands that are expected to be entered into a terminal are prefixed with $. You should not enter the $ character, it is merely to designate that the following commands are intented to be input/executed within a termina. For example, the following command to list contents of the current working directory, ls, will be mentioned on this page as:
$ ls
The following applications should be installed:
+python 3
+git
+At this point in the project, it is recommended to build postmarketOS from the latest available source code. It can be obtained by running the following:
+$ git pull https://github.com/postmarketOS/pmbootstrap.git
First, initialize the work directory. Replace $WORKDIR with the desired location for placing the output from the build process. It is recommended to have at least 10GB of available space in this location.
When initializing pmbootstrap, you'll need to select the device you are building for, the location for the work directory, the number of parallel jobs to run when compiling, and whether or not file timestamps should be accounted for when determining if a rebuild is necessary. User input is bolded below, replace with your desired options.
++$ cd pmbootstrap +$ ./pmbootstrap.py init +[20:20:33] Target device (either an existing one, or a new one for porting). +[20:20:33] Available (9): lg-d855, lg-hammerhead, lg-mako, motorola-titan, nokia-rx51, samsung-i9070, samsung-i9100, samsung-maguro, sony-amami +[20:20:33] Device []: nokia-rx51 +[20:20:45] Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there. +[20:20:45] Work path []: ~/work +[20:20:47] How many jobs should run parallel on this machine, when compiling? +[20:20:47] Jobs []: 4 +[20:20:48] Rebuild packages, when the last modified timestamp changed, even if the version did not change? This makes pmbootstrap behave more like 'make'. +[20:20:48] Timestamp based rebuilds (y/n) [y]: y +[20:20:49] WARNING: The applications in the chroots do not get updated automatically. +[20:20:49] Run 'pmbootstrap zap' to delete all chroots once a day before working with pmbootstrap! +[20:20:49] It only takes a few seconds, and all packages are cached. +[20:20:49] Done! ++ +
+ postmarketOS
+ ~/.local/var/pmbootstrap/packages)python3 -m http.server/etc/apk/repositories:# You can remove this line
+/home/user/packages/user
+
+# Add your dev machine, change the ip-address for your network
+http://192.168.2.42:8000
+
+https://nl.alpinelinux.org/alpine/edge/main
+https://nl.alpinelinux.org/alpine/edge/community
+https://nl.alpinelinux.org/alpine/edge/testing
+
+
+apk upgrade [package name]
+ postmarketOS
+ There is also a bug where the screen is not updated. Workaround: login using ssh and run the following command:
+ssh user@172.16.42.1
+sudo su
+while [ ! ]; do cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode; done
+
+
+As this devices' screen is 1440x2560px, small elements in weston are extremely hard to click and the on-screen keyboard is pretty much unusable, so DPI scaling is needed in weston. However, right now the fbdev backend doesn't support scaling.
+Before you can use fastboot on this device you need to remove LGs Download mode, which hides the standard fastboot mode. You can do this by zeroing out a partition called 'laf':
+adb shell
+su
+dd if=/dev/block/platform/msm_sdcc.1/by-name/laf of=/sdcard/laf.img #backup LGs Download mode to the internal SD just in case
+dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/laf #Overwrite laf with zeroes, enabling fastboot
+exit
+adb reboot bootloader #reboot directly to fastboot
+
+
+More detailed instructions for this can be found here
+Afterwards, you can boot into fastboot by following these steps:
+1. Turn of phone completely
+2. Hold Volume Up.
+3. Plug in USB-cable while still holding Vol. Up until fastboot pops up
+
+
+pmbootstrap will successfully flash system and kernel, however the device will only boot if you use the
+pmbootstrap flasher boot command, as it will otherwise show this error:
ERROR : boot certification verify
+[630]_________________________________________
+[640]
+[640] Secure booting Error!
+[640] Cause : boot certification verify
+[640]
+[640]_________________________________________
+
+
+The message is shown for 3 seconds, then the screen blacks out and the LED will blink red and blue indefinitely.
+This happens because the bootloader on the d855 variant of the LG G3 can not be unlocked and you have to trick the bootloader into thinking your boot image is legitimate.
+To do this, you need to first export your boot.img-lg-d855:
mkdir -p /tmp/pmOS_export
+pmbootstrap flasher export /tmp/pmOS_export
+
+
+Then we need a tool called Open_Bump, which can sign boot images for our device. (Requires Python 2. Also works for older LG devices?):
+git clone https://github.com/CyboLabs/Open_Bump
+cd Open_Bump
+python2 open_bump.py "/tmp/pmOS_export/boot.img-lg-d855"
+
+
+This will create a signed image called boot_bumped.img-lg-d855 in /tmp/pmOS_export/.
+Now first flash System and kernel images using pmbootstrap and then manually flash the signed image over these:
pmbootstrap flasher flash_system
+pmbootstrap flasher flash_kernel
+fastboot flash boot /tmp/pmOS_export/boot_bumped.img-lg-d855
+
+
+
+ postmarketOS
+ If you want to talk to other people working on/with postmarketOS you can do so either:
+Join Matrix group
+ +Or IRC:
+#postmarketos on freenode
+Matrix & IRC are bridged.
+If you don't know which one to use, use the Matrix group, because it doesn't require a bouncer to receive all messages all the time.
+++ +Please use the reddit page for general discussions, as the matrix & IRC are primarily focused on porting / development help & discussions.
+
+ postmarketOS
+ In #194 we decided to split up the aports folder (the one that holds all package build recipes) into subfolders. Here are the instructions to migrate your locally checked out code, on which you possibly have worked on already. As always, you can ask in the channel or create an issue in the tracker, if you need any help.
Please extend these instructions, if you need additinal steps to migrate your aports folder or something is unclear!
Instructions:
+ Make a backup of your pmbootstrap folder, just to be sure
+ Run git pull to get the latest source
+* move the aports, that you have created in the appropriate folders
+ * cross: everything cross-compiler related
+ * device: device specific packages and kernels
+ * kde: everything plasma-mobile related
+ * main: the rest
+ * unmaintained: packages, that we don't really need anymore, but we don't want to remove them yet
In case you need it, here is a migration script. It will convert the old folder structure to the new one.
+#!/bin/sh -e
+if [ ! -d "aports" ]; then
+ echo "Please execute this script in your pmbootstrap folder."
+ exit 1
+fi
+
+for i in cross device kde main unmaintained; do
+ mkdir -p aports_new/"$i"
+done
+
+cd aports
+mv *-armhf *-aarch64 qemu-user-static-repack ../aports_new/cross
+mv device-* linux-* ../aports_new/device
+mv acpid ../aports_new/unmaintained
+mv * ../aports_new/main
+
+cd ..
+rm -d aports
+mv aports_new aports
+
+
+And here is a revert script, that converts the new folder structure into the old one (usually you should not need this!):
+#!/bin/sh -e
+if [ ! -d "aports" ]; then
+ echo "Please execute this script in your pmbootstrap folder."
+ exit 1
+fi
+
+mkdir aports_new
+mv aports/*/* aports_new/
+rm -r aports
+mv aports_new aports
+
+
+ postmarketOS
+ postmarketOS aims to be like a typical Linux distribution - with lots of possibilities to choose from. And with a default selection of components, that are most useful to casual users. +This means, that there is no concrete plan, that everyone must follow for it to succeed. Instead, everyone is encouraged to work on what they enjoy most!
+In consequence, pmOS does not use a regular milestone plan with versions (at least right now). Here is a list with what individuals are working on. Feel free to add yourself here and what you are interested in (optionally with priorities and estimated finish date), but you don't have to! If you do, please keep your section of this list updated, and remove finished tasks.
+These are all estimations and the community is expected to understand when something does not work out as planned here. This is a free time project after all, so be grateful, that the individuals step up and share their plans at all.
+Right now, my primary focus is recruiting more developers by keeping the development enjoyable. Apart from fixing bugs as highest priority, I focus on the following list. Feel free to discuss the importance of these items with me in Matrix/IRC or on /r/postmarketOS (for longer discussions).
+2017-08-14 - but expect delays due to how fast everything is moving, as said above: helping the others is a higher priority!)README.md (with a link to details: which files are not covered by testcases etc.)shellcheck for more shell scripts in the repo (maybe for all APKBUILDs?), automatically format shell scriptspmbootstraplg-mako (#91, #12)pmboostrap/pmOSMake the greatest device ever, a Nokia N900, the best device to use with postmarketOS.
+Assist with documentation.
+Do what I can to help with packaging a GUI.
+pmbootstrap flasher export --odin)In general, get postmarketOS to a ready for daily usage state, in my case getting packages and UI packaged for the end user to install. Right now focus is on:
+Packaging Phone UI: Plasma Mobile
+Packaging Phone UI: UBports/Yunit
+Getting postmarketOS working on my device locally
+Helping to make Plasma Mobile working on postmarketOS
+Get bootloader for Coolpad Modena 2 opensourced and unlocked. Requires lots of reverse engineering work.
+Eventually start porting device to pmOS.
+Write open source replacement for SP flashtool (very low priority).
+
+ postmarketOS
+ Build and install to SD card:
+$ ./pmbootstrap.py build device-mozilla-flame
+$ ./pmbootstrap.py build linux-mozilla-flame --arch=armhf
+$ ./pmbootstrap.py install --sdcard /dev/mmcblkX
+$ ./pmbootstrap.py flasher export $SOMEDIR
+
+
+Now we can one-time flash the boot image:
+$ flashboot boot $SOMEDIR/boot.img
+
+
+mozilla-flame.img cannot be flashed to either the system/userdata partitions due to bootloader limitations (probably because the system image is larger than the max download size and it forces the download into sparse mode, which is handled badly.)
$ fastboot flash userdata flame/mozilla-flame.img
+target reported max download size of 301989888 bytes
+erasing 'userdata'...
+OKAY [ 1.254s]
+sending sparse 'userdata' 1/2 (288781 KB)...
+OKAY [ 10.018s]
+writing 'userdata' 1/2...
+FAILED (remote: Unknown chunk type)
+finished. total time: 11.275s
+
+
+Workaround is to install to SD card.
+device-mozilla-flame branchTaken off a clean v18D_nightly_v5.zip B2G base image
shell@flame:/ $ df
+Filesystem Size Used Free Blksize
+/dev 451.7M 132.0K 451.6M 4096
+/sys/fs/cgroup 451.7M 0.0K 451.7M 4096
+/sys/fs/cgroup/memory: Permission denied
+/mnt/asec 451.7M 0.0K 451.7M 4096
+/mnt/obb 451.7M 0.0K 451.7M 4096
+/system 412.5M 283.5M 129.0M 4096
+/data 2.0G 40.4M 2.0G 4096
+/cache 70.8M 4.1M 66.8M 4096
+/persist 4.9M 4.0M 852.0K 4096
+/firmware 64.0M 31.7M 32.2M 16384
+/storage/sdcard 3.8G 8.0K 3.8G 4096
+/mnt/media_rw/sdcard: Permission denied
+
+shell@flame:/ $ cat /proc/partitions
+major minor #blocks name
+
+ 253 0 196608 zram0
+ 179 0 7634944 mmcblk0
+ 179 1 65536 mmcblk0p1
+ 179 2 512 mmcblk0p2
+ 179 3 128 mmcblk0p3
+ 179 4 32 mmcblk0p4
+ 179 5 512 mmcblk0p5
+ 179 6 500 mmcblk0p6
+ 179 7 15360 mmcblk0p7
+ 179 8 500 mmcblk0p8
+ 179 9 1024 mmcblk0p9
+ 179 10 1536 mmcblk0p10
+ 179 11 1536 mmcblk0p11
+ 179 12 429580 mmcblk0p12
+ 179 13 32768 mmcblk0p13
+ 179 14 73728 mmcblk0p14
+ 179 15 15360 mmcblk0p15
+ 179 16 1024 mmcblk0p16
+ 179 17 1536 mmcblk0p17
+ 179 18 1 mmcblk0p18
+ 179 19 8 mmcblk0p19
+ 179 20 10240 mmcblk0p20
+ 179 21 1024 mmcblk0p21
+ 179 22 1024 mmcblk0p22
+ 179 23 256 mmcblk0p23
+ 179 24 10 mmcblk0p24
+ 179 25 512 mmcblk0p25
+ 179 26 500 mmcblk0p26
+ 179 27 500 mmcblk0p27
+ 179 28 204800 mmcblk0p28
+ 179 29 2162688 mmcblk0p29
+ 179 30 4095983 mmcblk0p30
+ 179 32 512 mmcblk0rpmb
+
+shell@flame:/ $ ls -la /dev/block/platform/msm_sdcc.1/by-name/
+lrwxrwxrwx root root 1969-12-31 19:10 DDR -> /dev/block/mmcblk0p4
+lrwxrwxrwx root root 1969-12-31 19:10 aboot -> /dev/block/mmcblk0p5
+lrwxrwxrwx root root 1969-12-31 19:10 abootbk -> /dev/block/mmcblk0p25
+lrwxrwxrwx root root 1969-12-31 19:10 boot -> /dev/block/mmcblk0p7
+lrwxrwxrwx root root 1969-12-31 19:10 cache -> /dev/block/mmcblk0p14
+lrwxrwxrwx root root 1969-12-31 19:10 custpack -> /dev/block/mmcblk0p28
+lrwxrwxrwx root root 1969-12-31 19:10 fota -> /dev/block/mmcblk0p24
+lrwxrwxrwx root root 1969-12-31 19:10 fsc -> /dev/block/mmcblk0p18
+lrwxrwxrwx root root 1969-12-31 19:10 fsg -> /dev/block/mmcblk0p17
+lrwxrwxrwx root root 1969-12-31 19:10 misc -> /dev/block/mmcblk0p16
+lrwxrwxrwx root root 1969-12-31 19:10 modem -> /dev/block/mmcblk0p1
+lrwxrwxrwx root root 1969-12-31 19:10 modemst1 -> /dev/block/mmcblk0p10
+lrwxrwxrwx root root 1969-12-31 19:10 modemst2 -> /dev/block/mmcblk0p11
+lrwxrwxrwx root root 1969-12-31 19:10 pad -> /dev/block/mmcblk0p9
+lrwxrwxrwx root root 1969-12-31 19:10 persist -> /dev/block/mmcblk0p13
+lrwxrwxrwx root root 1969-12-31 19:10 recovery -> /dev/block/mmcblk0p15
+lrwxrwxrwx root root 1969-12-31 19:10 rpm -> /dev/block/mmcblk0p6
+lrwxrwxrwx root root 1969-12-31 19:10 rpmbk -> /dev/block/mmcblk0p26
+lrwxrwxrwx root root 1969-12-31 19:10 sbl1 -> /dev/block/mmcblk0p2
+lrwxrwxrwx root root 1969-12-31 19:10 sdi -> /dev/block/mmcblk0p3
+lrwxrwxrwx root root 1969-12-31 19:10 secro -> /dev/block/mmcblk0p23
+lrwxrwxrwx root root 1969-12-31 19:10 splash -> /dev/block/mmcblk0p20
+lrwxrwxrwx root root 1969-12-31 19:10 ssd -> /dev/block/mmcblk0p19
+lrwxrwxrwx root root 1969-12-31 19:10 system -> /dev/block/mmcblk0p12
+lrwxrwxrwx root root 1969-12-31 19:10 traceability -> /dev/block/mmcblk0p21
+lrwxrwxrwx root root 1969-12-31 19:10 tuningpara -> /dev/block/mmcblk0p22
+lrwxrwxrwx root root 1969-12-31 19:10 tz -> /dev/block/mmcblk0p8
+lrwxrwxrwx root root 1969-12-31 19:10 tzbk -> /dev/block/mmcblk0p27
+lrwxrwxrwx root root 1969-12-31 19:10 usbmsc -> /dev/block/mmcblk0p30
+lrwxrwxrwx root root 1969-12-31 19:10 userdata -> /dev/block/mmcblk0p29
+
+
+ postmarketOS
+ -) only, no underscores (_).device-{vendor}-{device code name/model number}
linux-{vendor}-{device code name/model number}
+ postmarketOS
+ This page keeps track of what needs to be packaged to get Plasma Mobile working (#161). The minimal set of programs is already packaged (thanks to PureTryOut!). See [[Plasma Mobile]] for further documentation on getting it running.
+The dependencies listed are dependencies of packages not packaged by Alpine. This list is subject to change. The list is based on this Arch repository.
+| Required packages | +Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| qt5-qttools-dev | +baloo, kfilemetadata, ki18n, karchive, kpty, kdelibs4support, threadweaver, plasma-framework, kwayland, plasma-workspace, kpeople, kcoreaddons, kunitconversion, kitemmodels, kemoticons, kparts, kdesignerplugin, kactivities, kdeclarative, kjsembed, knotifyconfig, ktexteditor, kholidays, kwin, krunner, kxmlrpcclient, networkmanager-qt, kdesignerplugin, kservice, kwidgetsaddons, kitemviews, kplotting, kconfig, kwindowsystem, kpackage, kdesu, kcmutils, kcrash, kdbusaddons, kcodecs, kauth, kguiaddons, knewstuff, ki18n, kdoctools, kjsembed, kservice, kcontacts, kpackage | +yes | ++ |
| lmdb-dev | +baloo | +yes | ++ |
| docbook-xsl | +kdoctools, appstream-qt, libaccounts-glib | +yes | ++ |
| taglib-dev | +kfilemetadata | +yes | ++ |
| qt5-qtdeclarative | +kpeople, kactivities, qt5-qtwebchannel, qt5-qtlocation | +yes | ++ |
| qt5-qtdeclarative-dev | +ki18n, plasma-maliit-framework, plasma-maliit-plugin | +yes | ++ |
| py3-qt5 | +ki18n, kcoreaddons, kitemmodels, kwidgetsaddons, kitemviews, kconfig, kdbusaddons, kcodecs, kauth, kguiaddons, kconfigwidgets | +yes | ++ |
| qt5-qtbase | +karchive, threadweaver, kwayland, kcoreaddons, kitemmodels, kjs, kholidays, appstream-qt, networkmanager-qt, kwidgetsaddons, kitemviews, kplotting, kconfig, kcodecs, kdecoration, qt5-qtpolkit, qt5-qtpackagekit | +yes | ++ |
| qt5-qtsvg | +kjsembed | +yes | ++ |
| qt5-qtgraphicaleffects | +plasma-phone-components | +yes | ++ |
| networkmanager | +networkmanager-qt, packagekit | +yes | ++ |
| networkmanager-dev | +kdelibs4support | +yes | ++ |
| mesa-dev | +threadweaver, kservice, kplotting, kcrash, kguiaddons, kconfigwidgets | +yes | ++ |
| giflib | +khtml | +yes | ++ |
| gperf-dev | +khtml, kcodecs | +yes | ++ |
| qt5-qtquickcontrols | +plasma-framework | +yes | ++ |
| libgit2 | +ktexteditor | +yes | ++ |
| libxml2 | +libqalculate, appstream-qt, libaccounts-glib | +yes | ++ |
| wayland | +kwayland | +yes | ++ |
| gpsd-dev | +plasma-workspace | +yes | ++ |
| libepoxy | +kdeclarative | +yes | ++ |
| gconf-dev | +qt5-qtlocation | +yes | ++ |
| util-macros | +xmessage | +yes | ++ |
| glib | +libqalculate, appstream-qt | +yes | ++ |
| perl-xml-parser | +libqalculate | +yes | ++ |
| intltool | +libqalculate, packagekit | +yes | ++ |
| libxaw | +xmessage | +yes | ++ |
| font-noto | +plasma-integration | +yes | ++ |
| gobject-introspection | +appstream-qt, packagekit | +yes | ++ |
| itstool | +appstream-qt | +yes | ++ |
| vala | +appstream-qt, packagekit | +yes | ++ |
| gtk-doc | +libaccounts-glib, packagekit | +yes | ++ |
| libical | +kcalcore | +yes | ++ |
| dbus-glib | +libaccounts-glib, packagekit | +yes | ++ |
| sqlite | +libaccounts-glib, packagekit | +yes | ++ |
| py-gobject | +libaccounts-glib | +yes | ++ |
| libxfixes | +kwindowsystem | +yes | ++ |
| automoc4 | +breeze, kdelibs. qt5-qtpolkit | +yes | ++ |
| polkit | +packagekit | +yes | ++ |
| polkit-dev | +qt5-qtpolkit | +yes | ++ |
| shared-mime-info | +packagekit | +yes | ++ |
| snowball | +appstream-qt | +yes | ++ |
| dbus-glib | +telepathy-glib | +yes | ++ |
| gtk-doc | +telepathy-farstream | +yes | ++ |
| glib-doc | +telepathy-farstream | +yes | ++ |
| vala | +telepathy-glib | +yes | ++ |
| gobject-introspection | +telepathy-farstream, telepathy-glib | +yes | ++ |
| Required packages | +Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| extra-cmake-modules | +all KDE packages | +no, only an outdated version (5.31.x rather than 5.36.x) | +compiles | +
| karchive | +kdoctools, kfilemetadata, kemoticons, kpackage | +no | +compiles | +
| qt5-qtscript-dev | +ki18n | +yes for all architectures, except armhf due to a build failure. It however compiles fine now | +upstreamed | +
| kdecoration | +breeze | +no | +compiles | +
| autoconf-archive | +packagekit | +no | +compiles | +
| libyaml | +appstream-qt | +no | +compiles | +
| kwindowsystem | +kactivities, kcrash | +no | +compiles | +
| kwidgetsaddons | +kpeople, kconfigwidgets | +no | +compiles | +
| kitemviews | +kpeople | +no | +compiles | +
| kcoreaddons | +kpty, kactivities, kcontacts, kpackage, kcrash, kauth | +no | +compiles | +
| kunitconversion | +kdelibs4support | +no | +compiles | +
| kitemmodels | +kdelibs4support | +no | +compiles | +
| libutempter | +kpty | +no | +doesn't compile, glibc is required | +
| kwayland | +plasma-maliit-framework, plasma-framework, plasma-integration, kscreenlocker | +no | +compiles | +
| poppler-qt5 | +kfilemetadata | +no, only a qt4 version | +compiles | +
| kdoctools | +plasma-mobile, kdelibs4support, plasma-framework, plasma-workspace, kded, kdesignerplugin, kjs, kjsembed, kde-cli-tools, milou, kwin, krunner, kdesignerplugin, kservice, kcalcore, kinit, kpackage, kscreenlocker | +no | +compiles | +
| kfilemetadata | +baloo | +no | +compiles | +
| kidletime | +baloo, kscreenlocker | +no | +compiles | +
| polkit-qt5 | +kauth | +no | +compiles | +
| kcrash | +kservice | +no | +compiles | +
| kdbusaddons | +kservice, kio | +no | +compiles | +
| kcodecs | +kcontacts, kconfigwidgets | +no | +compiles | +
| kconfig | +kactivities, kservice, kcontacts, kio, kconfigwidgets | +no | +compiles | +
| kpackage | +kdeclarative, frameworkintegration | +no | +compiles | +
| networkmanager-qt | +plasma-workspace | +no | +compiles | +
| kservice | +kpeople, kemoticons, kdesu, kinit, kio | +no | +compiles | +
| solid | +kio | +no | +compiles | +
| media-player-info | +kio | +no | +compiles | +
| kauth | +kconfigwidgets | +no | +compiles | +
| kguiaddons | +kconfigwidgets | +no | +compiles | +
| kconfigwidgets | +libksysguard, kbookmarks | +no | +compiles | +
| kiconthemes | +kbookmarks | +no | +compiles | +
| kcompletion | +ktextwidgets | +no | +compiles | +
| sonnet | +ktextwidgets | +no | +compiles | +
| ktextwidgets | +kxmlgui | +no | +compiles | +
| kglobalaccel | +kxmlgui | +no | +compiles | +
| kxmlgui | +kbookmarks | +no | +compiles | +
| kbookmarks | +kio | +no | +compiles | +
| kjobwidgets | +kio | +no | +compiles | +
| kio | +baloo, kparts, kdesignerplugin, kdeclarative, knotifyconfig, kactivitymanagerd, plasma-integration, kxmlrpcclient, kdesignerplugin, kinit, knewstuff | +no | +compiles | +
| kactivitymanagerd | +plasma-workspace | +no | +compiles | +
| knotifyconfig | +plasma-workspace | +no | +compiles | +
| kjs | +khtml, kjsembed | +no | +compiles | +
| kactivities | +plasma-framework | +no | +compiles | +
| kdeclarative | +plasma-framework, kcmutils, kscreenlocker | +no | +compiles | +
| knotifications | +plasma-framework | +no | +compiles | +
| plasma-framework | +plasma-samegame, plasma-settings, kwin | +no | +compiles | +
| cln | +libqalculate | +no | +compiles | +
| kemoticons | +kdelibs4support | +no | +compiles | +
| kinit | +kded | +no | +compiles | +
| kded | +kdelibs4support | +no | +compiles | +
| kparts | +kdelibs4support, khtml, ktexteditor | +no | +compiles | +
| kpeople | +plasma-phone-components | +no | +compiles | +
| kjsembed | +plasma-workspace | +no | +compiles | +
| kdesignerplugin | +plasma-workspace, kdelibs4support, kcalcore | +no | +compiles | +
| kdelibs4support | +plasma-settings, plasma-workspace, kcalcore | +no | +compiles | +
| frameworkintegration | +breeze | +no | +compiles | +
| kpty | +kdesu | +no | +compiles | +
| kdesu | +kde-cli-tools | +no | +compiles | +
| kcmutils | +kde-cli-tools, kwin, kscreenlocker, breeze | +no | +compiles | +
| ktexteditor | +plasma-workspace | +no | +compiles | +
| threadweaver | +krunner | +no | +compiles | +
| krunner | +breeze, plasma-workspace, milou | +no | +compiles | +
| kscreenlocker | +kwin | +no | +compiles | +
| breeze | +kwin, plasma-integration | +no | +compiles | +
| kwin | +plasma-workspace | +no | +compiles | +
| milou | +plasma-workspace | +no | +compiles | +
| baloo | +plasma-mobile, plasma-workspace | +no | +compiles | +
| plasma-workspace | +plasma-phone-components, plasma-mobile | +no | +compiles | +
| plasma-mobile | ++ | no | +compiles | +
| farstream | +telepathy-farstream | +yes, but upstream APKBUILD has wrong dependency and fails | +upstreamed | +
| telepathy-glib | +telepathy-farstream | +no | +compiles | +
| telepathy-farstream | +telepathy-qt5 | +no | +compiles | +
| telepathy-qt5 | +plasma-phone-components | +no | +compiles | +
| plasma-phone-components | ++ | no | +compiles | +
| Required packages | +(Optional) Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| qt5-qtdeclarative-dev | +libqofono-qt5 | +yes | ++ |
| libqofono-qt5 | ++ | no | +? | +
| bluez | +gypsy | +yes | ++ |
| bluez-libs | +gypsy | +yes | ++ |
| libgudev | +gypsy | +yes | ++ |
| dbus-glib | +gypsy | +yes | ++ |
| libxslt | +gypsy | +yes | ++ |
| libxslt | +qt5-qtwebengine | +yes | ++ |
| libxdamage | +qt5-qtwebengine | +yes | ++ |
| minizip | +qt5-qtwebengine | +yes | ++ |
| ffmpeg | +qt5-qtwebengine | +yes | ++ |
| jsoncpp-dev | +qt5-qtwebengine | +yes | ++ |
| ninja | +qt5-qtwebengine | +yes | ++ |
| libvpx | +qt5-qtwebengine | +yes | ++ |
| libevent | +qt5-qtwebengine | +yes | ++ |
| libsrtp | +qt5-qtwebengine | +yes | ++ |
| snappy | +qt5-qtwebengine | +yes | ++ |
| nss | +qt5-qtwebengine | +yes | ++ |
| protobuf | +qt5-qtwebengine | +yes | ++ |
| libxcomposite | +qt5-qtwebengine | +yes | ++ |
| libxrandr | +qt5-qtwebengine | +yes | ++ |
| pciutils | +qt5-qtwebengine | +yes | ++ |
| gperf-dev | +khtml, qt5-qtwebengine, kcodecs | +yes | ++ |
| gypsy | +qt5-qtlocation | +no | +compiles | +
| qt5-qtwebchannel | +qt5-qtwebengine | +no | +? | +
| qt5-qtlocation | +qt5-qtwebengine | +no | +? | +
| kdoctools | +kconfigwidgets | +no | +compiles | +
| qt5-qtwebengine | +plasma-angelfish | +no | +? | +
| knewstuff | +frameworkintegration | +no | +compiles | +
| kcontacts | +libkgapi | +no | +? | +
| kcalcore | +libkgapi | +no | +? | +
| libkgapi | +plasma-settings | +no | +? | +
| kplotting | +kdesignerplugin | +no | +compiles | +
| plasma-integration | +plasma-workspace | +no | +? | +
| plasma-maliit-framework | +plasma-maliit-plugin | +no | +? | +
| plasma-maliit-plugin | ++ | no | +? | +
| plasma-settings | ++ | no | +? | +
| libqalculate | +plasma-workspace | +no | +? | +
| kde-cli-tools | +plasma-workspace | +no | +? | +
| plasma-samegame | ++ | no | +? | +
| Required packages | +Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| plasma-angelfish | ++ | no | +? | +
| Required packages | +Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| kholidays | +plasma-workspace | +no | +? | +
| Required packages | +Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| plasma-framework | +plasma-camera | +no | +compiles | +
| plasma-camera | ++ | no | +? | +
| Required packages | +Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| kdelibs4support | +okular-frameworks | +no | +compiles | +
| khtml | +okular-frameworks | +no | +? | +
| chmlib | +okular-frameworks | +no | +? | +
| threadweaver | +okular-frameworks | +no | +compiles | +
| kactivities-frameworks | +okular-frameworks | +no | +? | +
| kpty | +okular-frameworks | +no | +? | +
| okular-frameworks | ++ | no | +? | +
| Required packages | +Dependency of | +Packaged by Alpine | +Status | +
|---|---|---|---|
| koko | ++ | no | +? | +
+ postmarketOS
+ /dev/installp1 # pmOS boot (contains kernel, initramfs, initramfs-extra)
+/dev/installp2 # pmOS root (encrypted, unless --no-fde is specified)
+
+
+This is the least awkward layout - both partitions from above get directly created on the SD card. If your device has a sdcard slot, it is recommended to use it. Because then you don't wear down the internal flash storage of the device and don't need to worry about the phone's internal storage partition layout.
+Usage:
+$ ./pmbootstrap.py install --sdcard /dev/mmcblkX
+
+
+We don't want to modify the partition layout on the internal storage of Android systems. Because this seems somewhat risky, and then users couldn't simply install another ROM such as LineageOS anymore. So we came up with the following:
+The Android internal storage is already partitioned - the layout seems to be different for every device, as well as the numbers they have assigned. But most notably the devices have the following partitions:
+boot
+system
+userdata
+
+
+We usually flash a boot.img file (which is the kernel + initramfs) to Android's boot partition (see also: [[deviceinfo_flash_methods]]) - because that is what works and what all other ROMs do.
Now the interesting part is the system partition, where we flash our installation image. But the installation image already has a partition layout and own partitions! So you will have subpartitions. In the end, it will look like this:
+systemp1 # pmOS boot partition, only initramfs-extra gets used from there
+systemp2 # pmOS (un)encrypted root filesystem
+
+
+The initramfs (in the boot.img file!) will automatically find and mound the pmOS boot and root partition, load the initramfs-extra (which contains additional files, it was split to save space) and take care of booting through until OpenRC takes over.
The userdata partition is not used yet (proposal to do that is in #60). But as we are pretty flexible, you can also flash pmOS to the userdata partition, if it has more space and you can't fit it on the system partition. The initramfs will detect it anyway. Just make sure, that you don't have it flashed to both partitions!
+To flash to the userdata partition instead of the system partition, you currently need to change the config here.
There might be scenarios, in which the partition type of the system partition can not be changed through the flasher, because it only allows yaffs2 or simg with ext4 support (during research for the mozilla flame, we found that to be the case - however, it also has an SD slot, so we did not continue this way).
A proposal we have for that case, is to have one big ext4/yaffs partition, and include the whole system image file inside that. Then we would adjust the initramfs code to find the boot and root partitions inside that, and teach it how to resize the whole thing to the maximum partition size. We already did some experiments, and so far everything worked (talk to drebrez or ollieparanoid).
+ +
+ postmarketOS
+ The basic minimum shell has been ported to postmarketOS, and can now be tested. So far no one has gotten it working yet, so don't expect anything but errors.
+To install it on your device run ./pmbootstrap.py install --add plasma-mobile,plasma-phone-components,dbus-x11. You can also tell pmbootstrap to always add Plasma Mobile by adding plasma-mobile, plasma-phone-components and dbus-x11 to the list of "Extra packages" when running ./pmbootstrap.py init.
For instructions on running Plasma Mobile you can use the KDE website: https://community.kde.org/Plasma/Mobile/RunningApps
+Packaging efforts have been documented [[here|Packaging Plasma Mobile]].
+Create ~/.config/QtProject/qtlogging.ini with the following content:
[Rules]
+org.kde.kwindowsystem.info=true
+org.kde.kwindowsystem.warning=true
+org.kde.kwindowsystem.critical=true
+org.kde.kwindowsystem.debug=true
+kwin_core.info=true
+kwin_core.warning=true
+kwin_core.critical=true
+kwin_core.debug=true
+kwineffects.info=true
+kwineffects.warning=true
+kwineffects.critical=true
+kwineffects.debug=true
+libkwineffects.info=true
+libkwineffects.warning=true
+libkwineffects.critical=true
+libkwineffects.debug=true
+libkwinglutils.info=true
+libkwinglutils.warning=true
+libkwinglutils.critical=true
+libkwinglutils.debug=true
+libkwinxrenderutils.info=true
+libkwinxrenderutils.warning=true
+libkwinxrenderutils.critical=true
+libkwinxrenderutils.debug=true
+kwin_wayland_drm.info=true
+kwin_wayland_drm.warning=true
+kwin_wayland_drm.critical=true
+kwin_wayland_drm.debug=true
+kwin_wayland_framebuffer.info=true
+kwin_wayland_framebuffer.warning=true
+kwin_wayland_framebuffer.critical=true
+kwin_wayland_framebuffer.debug=true
+kwin_wayland_hwcomposer.debug=true
+kwin_wayland_backend.info=true
+kwin_wayland_backend.warning=true
+kwin_wayland_backend.critical=true
+kwin_wayland_backend.debug=true
+kwin_wayland_x11windowed.info=true
+kwin_wayland_x11windowed.warning=true
+kwin_wayland_x11windowed.critical=true
+kwin_wayland_x11windowed.debug=true
+kwin_platform_x11_standalone.info=true
+kwin_platform_x11_standalone.warning=true
+kwin_platform_x11_standalone.critical=true
+kwin_platform_x11_standalone.debug=true
+kwin_libinput.info=true
+kwin_libinput.warning=true
+kwin_libinput.critical=true
+kwin_libinput.debug=true
+kwin_tabbox.info=true
+kwin_tabbox.warning=true
+kwin_tabbox.critical=true
+kwin_tabbox.debug=true
+kwin_decorations.info=true
+kwin_decorations.warning=true
+kwin_decorations.critical=true
+kwin_decorations.debug=true
+kwin_scripting.info=true
+kwin_scripting.warning=true
+kwin_scripting.critical=true
+kwin_scripting.debug=true
+kwin_xkbcommon.info=true
+kwin_xkbcommon.warning=true
+kwin_xkbcommon.critical=true
+kwin_xkbcommon.debug=true
+kwin_qpa_plugin.info=true
+kwin_qpa_plugin.warning=true
+kwin_qpa_plugin.critical=true
+kwin_qpa_plugin.debug=true
+
+
+ postmarketOS
+ If you have any questions, feel free to ask in the matrix/irc channel or bug tracker! This is a wiki, so please adjust everything that isn't detailed enough or would have helped you with porting.
+Please write your porting progress to the devices page, even if you didn't get very far. This helps to determine what can be improved to make porting easier.
+Please use a spare device for experimenting with postmarketOS! You won't be able to use typical phone features right now, such as making calls, writing SMS, using Wi-Fi, using Bluetooth. Although everything has been tested, there is no guarantee that you won't break your device.
+git clone https://github.com/postmarketOS/pmbootstrap./pmbootstrap.py init and configure for a new device./pmbootstrap.py log to get detailed output from the following pmbootstrap commandsCreate an appropriate device-$vendor-$name package in the aports/device folder:
cp -r aports/device/device-samsung-i9100 aports/device/device-vendor-name
+
+
+The important files are APKBUILD (build recipe, [[apk is an Alpine Linux term|Glossary#apk]]) and [[deviceinfo|deviceinfo reference]]. Please adjust them as necessary. Note that if your device uses fastboot, you will need to add mkbootimg to the depends= list in the APKBUILD, and the following variables at the end of deviceinfo (guide, example):
# Fastboot related
+deviceinfo_generate_bootimg="true"
+deviceinfo_flash_offset_kernel=""
+deviceinfo_flash_offset_ramdisk=""
+deviceinfo_flash_offset_second=""
+deviceinfo_flash_offset_tags=""
+deviceinfo_flash_pagesize=""
+
+
+A post-install script can be created to append device-specific partitions to /etc/fstab. See the post-install script for device-nokia-rx51 for an example.
Once the device package is configured, you will need to update checksums in the APKBUILD to match the new configuration files. You can do that by running:
+./pmbootstrap.py checksum device-$vendor-$name
+
+
+Now, you can build your device package with:
+./pmbootstrap.py build device-$vendor-$name
+
+
+While the goal is to use a mainline kernel for all devices in the long run, this certainly can not be done in one step when porting to a new device. Create a new package for the kernel by copying the kernel package of the most similar device with an existing port. For example:
+cp -r aports/device/linux-lg-mako aports/device/linux-vendor-name
+
+
+Now edit the APKBUILD. Replace the kernel source with a kernel suitable for your device. For Android devices we usually use the kernels from LineageOS. Copy the right defconfig from your kernel's source folder into your new linux-... folder and adjust its file name. Please adjust the comments in the APKBUILD file about which defconfig you have used, and which modifications you have made. Please also adjust the pkgver/pkgrel to match the kernel version.
Next, generate the checksum for the kernel package files using:
+./pmbootstrap.py checksum linux-$vendor-$name
+
+
+Now, before building the kernel itself, it is required to run the kernel's menuconfig with:
+./pmbootstrap.py menuconfig linux-$vendor-$name
+
+
+The first time, you run the menuconfig command, you will get prompted about new config options, that the default config does not address (in Android's build process, these options get ignored, but in pmOS they must be specified). Please accept the defaults it presents. After that, you will be shown a menu, in which the DEVTMPFS kconfig flag should be enabled, to get udev working, which is needed for touchscreen support in Weston. It should be located under Device Drivers ---> Generic Driver Options.
Once you have configured the kernel, build it (the arch specification is necessary here, because we're really compiling code - the device package just contains text/scripts and no native code, therefore it is architecture independent):
+./pmbootstrap.py build linux-$vendor-$name --arch=armhf
+
+
+NOTE: The linux-lg-mako package has a patch called gpu-msm-fix-gcc5-compile.patch, to fix compiler errors with GCC6. If your kernel doesn't need that specific patch (if it does not apply correctly, as in this report), just remove the file, and remove it from the source= line in the APKBUILD.
If your manufacturer has not released the source code of your kernel and you don't want to give up on porting your device, you can try the prebuilt kernels approach.
+Some devices need an appended device tree to boot. In LineageOS kernels this will mean that beside the generated zImage there is also a zImage-dtb file. To use this you have to enable in your kernel appending the dtb as in lg-hammerhead and change the package step in the build script to use the dtb file:
# Change zImage to zImage-dtb on this command:
+install -Dm644 "$srcdir/build/arch/arm/boot/zImage-dtb" \
+ "$pkgdir/boot/vmlinuz-$_flavor"
+
+
+In Android kernels, you usually enable BUILD_ARM_APPENDED_DTB_IMAGE and get an image with dtb appended and the filename will be zImage-dtb.
In the mainline kernel instead, you enable ARM_APPENDED_DTB (without trialing _IMAGE) and will get a bunch of .dtb files for the boards that are selected in the kernel config. In this case you need to manually append the correct .dtb file to the compiled kernel image zImage. An example of this is in the kernel package for the nokia n900:
cd "$srcdir/build/arch/arm/boot"
+cat zImage dts/omap3-n900.dtb > zImage-dtb
+
+
+If you are unsure, whether your device has an appended dtb file, use extract-dtb on an existing kernel image (e.g. from LineageOS). extract-dtb is packaged for postmarketOS, you can build it with pmbootstrap build extract-dtb.
If you want to install to the system partition of an image file, run the following:
+./pmbootstrap.py install
+
+
+If you want to install to a SD card, insert it and run the following. Replace mmcblk0 with the actual device name (lsblk is handy to find out the correct device name).
./pmbootstrap.py install --sdcard=/dev/mmcblk0
+
+
+Before you can run any flash command, you must put your device in the flashing mode. It is usually done holding Volume Down & Power simultaneously when the device is switched off but it may vary depending on the device. For more information see the specific page for your device in the LineageOS Wiki.
+If you want to install to the system partition, run the following (not for the SD card installation!):
+./pmbootstrap.py flasher flash_system
+
+
+If the system partition for your device is less than 850MB, you should find the size and change the value of install_size_system in the file pmb/config/__init__.py
If you have a device, that works with fastboot, you can boot the kernel now without flashing it:
+./pmbootstrap.py flasher boot
+
+
+Otherwise, you will need to flash the kernel to the device boot partition:
+./pmbootstrap.py flasher flash_kernel
+
+
+If the flashing method does not work, it is also possible to export all generated image files to a specific directory (with symlinks), so you can flash it manually with your host Linux system (or even on Windows with proprietary flashers such as Odin, if this is the only way it works for you):
+./pmbootstrap flasher export
+
+
+If you are lucky, your screen may give some clues that you are booted into pmOS. If not, do not get discouraged, the graphics on your device may not yet be setup correctly. The next steps are to see if you can connect to the device through telnet over USB. See the [[Inspecting the initramfs]] page for more details.
+Don't forget to create a specific wiki page for your device, and add it to the [[devices]] page. If you noticed anything that was unclear or discovered something useful, please help to improve the wiki!
+++ +Feel free to ask / help on IRC or Matrix group
+
+ postmarketOS
+ This is a stub, please expand with more projects, links and descriptions, and a nice intro - then remove this message.
+
+ postmarketOS
+ Device: Samsung Galaxy Note II (N7100 GSM)
+ARM Cortex A9 Samsung Exynos 4 Quad 4412 (32bit), quad core 1.6GHz; 2GB RAM, 16GB storage.
+ +Press and hold "volume down + home + power" simultaneously. Then click volume up to confirm.
+First build the device package:
+./pmbootstrap.py build device-samsung-n7100
+
+
+Then you need to configure the kernel before building with menuconfig like so:
./pmbootstrap.py menuconfig linux-samsung-n7100
+
+
+You can hold down the enter key while it asks you the y/n questions until you get to the menu, then you want to enable the DEVTMPFS kconfig flag located in Device Drivers ---> Generic Driver Options.
Now you want to compile the kernel itself:
+./pmbootstrap.py build linux-samsung-n7100 --arch=armhf
+
+
+Once you've successfully compiled the kernel you can install the OS to an SD card or your system partition. I've only tried an SD card:
+./pmbootstrap.py install --sdcard=/dev/sdb
+
+
+You will need a 1GB SD card in order for this to work, also keep in mind that this will format the sd card.
+Next you want to put your phone in download mode by holding power + vol down + home all together until you enter download mode, press volume up again to continue past the warning.
Now you can flash the boot image:
+./pmbootstrap.py flasher flash_kernel
+
+
+We're using flash_kernel because the N7100 packages its kernel and initfs file into one boot image, where as some other phones have separate partitions for each unlike the N7100.
If everything checks out OK, your N7100 should reboot and you should see the Samsung logo. Dont worry if the screen is flashing on and off and its taking a while, after a minute or 2 it should show up the pmOS splash!
+ +
+ postmarketOS
+ Unlike most other Android devices, the i9070 can not boot a boot.img (which consists of kernel + initramfs). Instead, the boot.img file is just a regular kernel.
However, it is possible to directly integrate a initramfs into the kernel at kernel compile time (this is totally different from the boot.img approach, if this is unclear to you, please ask in the channel), and this is what the Android ROMs do on the i9070. While it is not a big deal in the Android compilation process, it is a problem for postmarketOS, because we want to be able to build the initramfs independently from the kernel.
The following workaround is currently implemented: + We flash the real initramfs to the kernel2 partition (this partition usually contains a backup of the stock kernel) + The initramfs init script built into the kernel checks if the kernel2 partition contains a compressed initramfs, and if it does, it extracts it and passes execution to the real initramfs init script. +* This idea is based on something called "isorec".
+The following partitions are used for the postmarketOS:
+Possible partitions for the postmarketOS system image: + SYSTEM => /dev/mmcblk0p3 (600MB) + DATAFS => /dev/mmcblk0p5 (2GB)
+In order to flash the kernel and the initramfs using heimdall you simply have to call pmbootstrap flasher flash_kernel
This will write in the partitions specified in the deviceinfo file.
+At the moment is not possible to write the system image file (samsung-i9070.img) using heimdall. A temporary solution is to use the TWRP shell to perform a command like this:
+dd if=samsung-i9070.img of=/dev/mmcblk0p5
insmod dhd.ko firmware_path=/etc/wifi/bcmdhd_sta.bin nvram_path=/etc/wifi/nvram_net.txt
+* set a mac address
ifconfig wlan0 hw ether 01:02:03:04:05:06
+* bring the interface up
ifconfig wlan0 up
+* scan to find out what WiFi networks are detected
iw dev wlan0 scan
+* connect to WPA/WPA2 WiFi network
wpa_passphrase wifi_ssid wifi_key >> /etc/wpa_supplicant.conf
+* start wpa_supplicant to connect to the network
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf
+* verify that you are indeed connected to the SSID
iw wlan0 link
+* start udhcpc to get an ip address
udhcpc -b -i wlan0
+ postmarketOS
+
+ postmarketOS
+ On most Android devices, a somewhat working framebuffer is required to get Weston and other Wayland compositors running. The alternative to framebuffer would be [[DRI|Glossary#dri]].
+If your framebuffer does not work out of the box, try the following:
+ Run this to set the framebuffer resolution: cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode
+ Boot TWRP/Android and read out the correct framebuffer configurations from the /sys... paths and try to set them in pmOS
+* If you made it work, create an initfs hook, that instantly sets the framebuffer right. Example
/tmp/weston.log (via SSH) for the touch device name. For lg-mako, the name is touch_dev, but it may be different for your device.device-lg-mako to your device's aport. Replace touch_dev with your touch device name. Adjust the APKBUILD, so it gets installed properly (Example)hammerhead). If it does, you are done here. Otherwise continue for the calibration.sudo su - (Because right now, Weston runs as root)weston-calibrator as rootweston-calibrator
+ postmarketOS
+ Some phones have a serial port accessible from the outside, this makes debugging boot problems way easier since you can see the boot messages from the bootloader and the early kernel stuff. For example the whole nexus range has serial debugging through the headphone jack.
+The nexus phones multiplexed the serial debug lines with the headphone audio lines. To switch it into serial mode you have to supply -3V to the mic port. The uart lines themselves are 1.8V. If you use a 3.3V usb-to-uart adapter the signal from the phone will probably work, for the TX side you have to add a resistor divider to lover the voltage for the phone. Here's the schematic for a nexus debug cable:
+
This cable has been tested with:
+It should work fine with:
+The Nexus 7 grouper might also work but that one has another pinout for the headset connection, it has the sleeve as mic and ring 2 as ground (This is the difference between the OMTP and the CTIA pinout). It might work with the sleeve and ring 2 reversed but this has not been tested by us, so do it under your own responsibility.
+The nexus S and galaxy nexus have the serial port multiplexed with the USB connector instead of the headphone connector. This is the schematic for those devices, For this cable too it's important to have a 3.3V usb-to-uart adapter.
+
It should work with:
+The Flame has open UART pads that are accessible underneath the outer and inner covers.
+Pull-ups/downs are unneccesary, hook straight up to any FTDI/USB-to-serial.
+
+ postmarketOS
+ One of the major goals of the postmarketOS project is getting as many devices as possible working on the mainline upstream Linux kernel. The majority of the current devices run some form of Android kernel tree like AOSP, LineageOS or CyanogenMOD.
+The current progress of the mainlining effort is in the linux-postmarketos package, which can be used by multiple devices. The only pmOS-supported device that is usable with Linux 4.12 is the [[Nokia N900|nokia-rx51-(Nokia-N900)]]. The [[Qemu|qemu-vexpress-(Qemu-with-vexpress-soc)]] packages also use the linux-postmarketos package.
To make the kernel work with multiple devices, it no longer appends the dtb file to the kernel image. It generate a vmlinuz-postmarketos file in the boot partition and puts all dtb files for the current architecture in /usr/share/dtb. The postmarketos-mkinitfs package appends the dtb file defined in the [[deviceinfo|deviceinfo-reference]] to the linux image in the boot partition.
Before proceeding, make sure that you know that your device is supported by the mainline kernel. Otherwise use the source code of a vendor's fork of the kernel, which is known to work as described in the [[porting guide|Porting-to-a-new-device]].
+pmbootstrap.py menuconfig linux-postmarketos and adjust the kernel config to add the drivers for the device if they are not enabled yet. Set as much drivers to build as external module as possible so the main vmlinuz filesize doesn't increase too much.linux-postmarketos in the APKBUILD for the device package if you want to make it the default kernel (more information).deviceinfo_dtb file in the deviceinfo file.A good example of a device using a mainline kernel is the device-nokia-rx51 package.
This is a massive amount of work, and you will need C knowledge, as well as knowledge about how to contribute to the kernel. It is probably a very frustrating path, so make sure that you are either up to that or consider contributing in pmOS in another, from a developers point of view, more enjoyable way. Documentation from our side is also pretty thin on this, so if you actually work on this, please expand it. Thanks!
+You probably need to copy over the device tree source, from which the dtb file gets generated, to the mainline kernel. Please expand this.
+ postmarketOS
+
+ postmarketOS
+ ~/.local/var/pmbootstrap/log.txtlogread tool in BusyBox. The syslog is currently not preserved across reboots.musl-*/busybox-static-* fails to build with a 404 errorRun pmbootstrap aportgen musl-armhf musl-aarch64. The reason why this fails from time to time is, that we use Alpine's binary musl lib c package for armhf/aarch64 in the native chroot, to get the cross-compiler working. So the download URL inside the aports/cross/musl-*/APKBUILD file must be in sync with the upstream version. This pmbootstrap command safely gets the new version, uses apk to verify the signature of the package, generates the hash, and updates the APKBUILD file. To make sure, that pmbootstrap aportgen receives the latest musl version, delete your HTTP cache right before executing this command: pmbootstrap zap -hc. 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.
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.
+Add rc_logging=YES to /etc/rc.conf to have openrc log all its steps to /var/log/rc.log. If you managed to get the system to boot far enough to have telnet access, add [[the port 24 telnet listener|Inspecting-the-initramfs]] and you can mount the root device to view said log.
DEVTMPFS is enabled in your kernel config. Do not enable DEVTMPFS_MOUNT.cat /dev/random > /dev/fb0 returns: cat: write error: No such deviceExample: unzip in BusyBox doesn't extract symlinks like the normal unzip implementation (#82).
+Solution: Simply add unzip to the makedepends in the APKBUILD, and the "real" unzip will be used (or in that case, try to get the sources in another archive format, such as .tar.bz2, .tar.xz, .tar.gz).
When your "work" folder is inside an ecryptfs mounted folder, /dev/random may not work inside the chroot and you may have other issues. Try to move your work folder to another location, you can use /tmp to test if this resolves the issue. You can change the location in pmbootstrap init. See also: #61. (This doesn't seem to be an issue with newer versions of ecryptfs anymore.)
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!). Here's an example.
+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:
+On fastboot devices, you may have to enable UART debugging with fastboot oem uart-on.
By default, all output from the initramfs get redirected to /pmOS_init.log. If you want the output through the debug cable you need to add PMOS_NO_OUTPUT_REDIRECT to your kernel command line.
See Serial debugging.
+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.
+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).
+dhcpcd on the usb network device (check with ip a)telnet 172.16.42.1 (yes, the IP has changed!)pmbootstrap build mkbootimg
+pmbootstrap build unpackbootimg
+pmbootstrap chroot
+apk add mkbootimg unpackbootimg
+# 1. download a full LineageOS image
+# 2. extract it
+# 3. extract the kernel with unpackbootimg
+# 4. there's the kernel image!
+# 5. either try to overwrite the image generated by postmarketOS in /boot and use 'pmbootstrap flasher....'
+# Or: create a bootimg with "mkbootimg" inside "pmbootstrap chroot" and try to flash the image on your host GNU/Linux system with fastboot/heimdall
+
+
+There is a known bug where if you execute cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode exactly one frame is drawn, and the screen isn't updated otherwise.
Specify a tty in weston's commandline. The correct syntax is: weston --tty=1.
If Weston returns an error because it could not access /dev/tty1, 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 CONFIG_VT using pmbootstrap menuconfig and checking under Device Drivers -> Character devices -> Virtual terminal
There are some buggy framebuffer drivers (e.g. in LG Nexus 5) that report incorrect data. You can override it with:
+weston --pixman-type=2
+
+
+More information on issue #54
+See: [[Troubleshooting:grsec]]
+Normal behavior. it means, that your "user" 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 cryptsetup, iw, htop, ...) 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 "user" repository.
Normal behavior. We use a x86_64 version of apk 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 "apk fix" 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.
This issue is known to happen in Alpine Virthardened. 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 (CONFIG_BINFMT_MISC). Try to use another kernel.
The reason is somewhat unknown but looks like the following workaround solves it
+./pmbootstrap zap -p -hc
+./pmbootstrap shutdown
+
+
+See issue #270 for more information and don't hesitate to reopen if this didn't work for you.
+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.
+In some devices (e.g.: bullhead, titan), when flashing the system (pmbootstrap flasher flash_system), it works but fastboot complains of Invalid sparse file format at header magi.
$ ./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
+
+
+It happens when your device expects a sparse system image. The workaround is as follows:
+deviceinfo_flash_sparse=true in deviceinfolibsparse to depends=.For more information, see issue #299
+ +
+ postmarketOS
+ Grsec is the name of a patchset, that used to be freely available to harden the Linux kernel. Alpine has a linux-hardened kernel for example, which uses a fork of that patchset. When you run a kernel based on that patchset on your host Linux system, you will probably run into problems with pmbootstrap because it does some things inside chroots, that is blocked by default in that patchset. One example is setting file permissions (#107).
You have two options now. Either run pmbootstrap with a regular kernel, or disable the grsec specific features with sysctl while running pmbootstrap (you will probably run into other issues though, which have not been resolved - the quick solution is really using the regular kernel).
+We don't really know all options, that need to be disabled. Please extend this wiki page, if you are interested in this and figure it out. However, user cmdr2 reported, that you can do the following to disable all grsec features, and pmbootstrap will work then:
+++To comprehensively disable grsec until the next reboot, I suggest: +
+ls -1 /proc/sys/kernel/grsecurity | xargs -I '___' sudo sysctl -w kernel.grsecurity.___=0
This can only be partially resolved as of now, see #140.
+For starters, disable the RANDMMAP PaX flag:
sudo apk add paxctl
+sudo paxctl -C ~/.local/var/pmbootstrap/chroot_rootfs_samsung-s7562/usr/bin/qemu-arm-static
+sudo paxctl -r ~/.local/var/pmbootstrap/chroot_rootfs_samsung-s7562/usr/bin/qemu-arm-static
+
+
+ postmarketOS
+ While porting pmOS to a new device you probably will find common pitfalls that others have already solved. Here is a set of them:
+Patching a kernel is as simple as putting a .patch file in your aports/device/linux-vendor-flavor folder and adding the patch name to the source variable in your APKBUILD file.
First of all, make sure the following options are configured as you'll probably need them
+CONFIG_DEVTMPFS=y
+CONFIG_VT=y
+CONFIG_DM_CRYPT=y
+
+
+Note: CONFIG_DEVTMPFS_MOUNT is not needed but it doesn't hurt.
Also, we are compiling kernels using gcc6, which probably didn't exist when your manufacturers released the kernel sources for your device. You need the file compiler-gcc6.h. In your APKBUILD add it to source and copy it to the right location.
+drivers/built-in.o:(.data.rel+0x68c): undefined reference to kgsl_iommu_sync_lock'
+drivers/built-in.o:(.data.rel+0x690): undefined reference to kgsl_iommu_sync_unlock'
+
+
+You need to apply the gpu-msm-fix-gcc5-compile.patch patch.
+You can configure CONFIG_CMDLINE so that the arguments are permanent or change it in boot time using fastboot or pmbootstrap, for example:
fastboot boot -c "console=ttyHSL0,115200,n8" ...
+
+pmbootstrap flasher boot --cmdline "PMOS_NO_OUTPUT_REDIRECT"
+
+
+We found out that removing the 3D driver support makes the MSM framebuffer. See #66.
+CONFIG_MSM_KGSL=n
+
+
+PTY allocation request failed on channel 0
+-ash: a: unknown operand
+
+
+Go to Common configurations, you have probably missed CONFIG_DEVTMPFS!
Busybox' zip implementation does not extract symlinks. There are two workarounds. One is to use another archive type (typically kernel sources are downloaded from GitHub, where you can also get the source as .tar.gz - simply by changing the extension in the URL).
The other workaround is to add unzip to the makedepends, so it uses the original unzip instead of the busybox version.
In case you get the following output:
+LZMA arch/arm/boot/compressed/piggy.lzma
+lzma: unrecognized option: 9
+BusyBox v1.26.2 (2017-06-11 06:37:13 GMT) multi-call binary.
+
+Usage: lzma -d [-cf] [FILE]...
+
+Decompress FILE (or stdin)
+
+ -d Decompress
+ -c Write to stdout
+ -f Force
+
+
+In the BusyBox version shipped with Alpine Linux, only lower compression levels are enabled (to reduce the binary size). The kernel you're building is configured to compress with LZMA at the highest compression level. Pick one
+of the following solutions:
+ Add xz to the makedepends= line. Then the "real" lzma binary will be used instead of the Busybox version. This is recommended, because then your kernel will get built most similar to how it is built elsewhere, so you have the
+lowest risk of introducing a reason for the kernel not to boot (because the kernel is too big in size or something like that)
+ Reduce the compression ratio by adding this patch. This will not introduce any dependency, but increase the kernel size.
+* Use another compression algorithm (run pmbootstrap menuconfig linux-... and change it there). Gzip should work, but will produce a big kernel, because pmbootstrap currently installs a workaround to always use the fastest compression method (-1), when the most compressing one (-9) is chosen. This will increase the kernel size the most.
Don't even bother fixing all those warnings, there are too many of them and we don't want the outdated Android kernels in the long run anyway! Write a patch, that removes -Werror from all Makefiles recursively instead (please expand on how to do that step by step, ask in the channel if you need help).
See this patch as example.
+It might be useful for debugging to build Android's kernel with Android's build system.
+You can follow the LineageOS building guide for your device (see this for titan device as example).
+The process should be similar for other devices:
+# make some directories
+mkdir -p ~/bin
+mkdir -p ~/android/lineage
+
+# download the 'repo' tool
+curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
+chmod a+x ~/bin/repo
+
+# clone LineageOS
+cd ~/android/lineage
+~/bin/repo init -u https://github.com/LineageOS/android.git -b cm-14.1
+
+# Download the rest of dependencies (this will take a while and about *TODO* GB of disk space)
+~/bin/repo sync
+
+# now prepare the build for your device (replace 'titan' with the device you want to for the kernel for)
+source build/envsetup.sh
+breakfast titan
+
+# Now instead of following the rest of the guide (which will compile both Android and the kernel
+# for your device), simply compile the kernel:
+mka kernel
+
+# This command will also generate the device tree, initramfs and boot.img images
+mka bootimage
+
+
+You can check the $OUT environment variable and cd into it. In the case of titan the interesting generated files are:
~/android/lineage/out/target/product/titan/boot.img (boot image ready to be flashed: kernel + initramfs)~/android/lineage/out/target/product/titan/dt.img (device trees)~/android/lineage/out/target/product/titan/kernel (linux image)~/android/lineage/out/target/product/titan/ramdisk.img (compressed initramfs)The defconfig used is available at ~/android/lineage/kernel/motorola/msm8226/arch/arm/configs/titan_defconfig
+ postmarketOS
+ After porting postmarketOS to your device, you might find that still some features don't work. You may need to adjust some values inside the /sys directory.
+sysfs is a pseudo file system provided by the Linux kernel that exports information about various kernel subsystems, hardware devices, and associated device drivers from the kernel's device model to user space through virtual files. In addition to providing information about various devices and kernel subsystems, exported virtual files are also used for their configuring.
+One approach is comparing the contents of these files when TWRP or LineageOS is running and the same for pmOS.
+The following script dumps the content of /sys/devices. Copy it as dumpsys.sh
#!/bin/sh
+# dumpsys.sh
+DIR="/sys/devices"
+
+walk() {
+ for file in $(ls $1); do
+ path="$1/$file"
+ if test -L "$path"; then
+ continue
+ fi
+ if test -f "$path"; then
+ echo "$path"
+ cat "$path"
+ fi
+ if test -d "$path"; then
+ walk "$path"
+ fi
+ done
+}
+
+others() {
+ cat /proc/cpuinfo
+ cat /proc/cmdline
+}
+
+walk "$DIR"
+others
+
+
+Upload it to your device when running TWRP (use adb push) and when running postmarketOS (use scp). Run it and then compare the output.
For TWRP/LineageOS:
+adb push dumpsys.sh /
+adb shell "sh /dumpsys.sh > /devices-twrp.dump"
+adb pull /devices-twrp.dump .
+
+
+For pmOS:
+scp dumpsys.sh user@172.16.42.1:~
+# sh dumpsys.sh > devices-pmos.dump
+scp user@172.16.42.1:~/devices-pmos.dump .
+
+
+Then get the differences:
+diff -u devices-pmos.dump devices-twrp.dump > devices.diff
+
+
+You could also run it in even in the stock ROM but it is important that you run the same kernel version in postmarketOS then.
+This way, user drebrez figured out two values needed for the framebuffer configuration for the i9070 port.
echo 16 > /sys/devices/platform/mcde_fb/graphics/fb0/bits_per_pixel
+echo 960,1600 > /sys/devices/platform/mcde_fb/graphics/fb0/virtual_size
+
+
+ postmarketOS
+ It is important for us to contribute the patches and improvements we made to various software back to the original project. So everyone can benefit from the improvements and we don't need to maintain and carry around patches.
+2017-08-03 Alpine Linux: add consolekit22017-07-21 abuild: -D parameter for alternative description2017-07-07 Alpine Linux: busybox-extras with telnetd enabled2017-05-23 weston: instead of less than 1 Hz use default refresh rate-9 to -1 to improve performance)
+ postmarketOS
+ Some vendors do not release the kernel source code, which is very bad for freedom and goes against the Linux kernel license (see My device runs the Linux kernel (e.g. Android), but the vendor does not provide the source in the Troubleshooting page.
+But you can still extract the kernel image from a device that is running Android and use it to run postmarketOS. Of course this is totally discouraged because we want to make sure that we know the code our devices are running but you might find it useful in order to start hacking on postmarketOS without having the kernel source code.
+You can extract the kernel that is running your Android device, it doesn't matter if it's the stock ROM, LineageOS or any custom ROM. For this approach you need the adb tool and root permissions.
NOTE: in this example the boot partition is named msm_sdcc.1 but it might have a different name in your device
+# Connect to your Android device
+adb shell
+
+# Find the partition name
+ls -l /dev/block/platform/
+ls -l /dev/block/platform/msm_sdcc.1/by-name
+
+# From there we know that the boot partition is /dev/block/mmcblk0p14
+# Now we just dump the partition to a file (we need to root permissions)
+su
+cat /dev/block/mmcblk0p14 > /sdcard/boot.img
+chmod 0666 /sdcard/boot.img
+
+# Exit from adb and copy boot.img to your computer
+adb pull /sdcard/boot.img .
+
+
+You can use unpackbootimg (usage is described in [[here|How to find device specific information]]) to extract the kernel from your recently extracted boot.img or from a LineageOS release and run it together with postmarketOS initramfs.
If you extracted the kernel from you Stock ROM, it might not have encryption support enabled and in this case you would not be able to boot from an encrypted partition which is how postmarketOS works by default. To disable encryption in postmarketOS use pmbootstrap install --no-fde. You might need other modules as well for pmOS to work properly.
# fastboot boot <kernel> [ <ramdisk> ]
+fastboot boot \
+uncompressed_boot/boot.img-zImage \
+~/.local/var/pmboostrap/chroot_rootfs-XXX-XXXX/boot/initramfs-lg-hammerhead
+
+
+
+ postmarketOS
+ This is heavily work in progress - if you're working on this, make sure to join the IRC/matrix channel and to extend this wiki page with everything you find out.
+To get wireless LAN working, most WiFi chips need a proprietary firmware blob. While it would be more secure to replace that with open source software in the long term, it isn't feasible right now, so we try to get it working with that closed source firmware. +A great place to start looking for information about many available WiFi chips is this kernel.org page. It often provides driver sources and the required firmware blobs as well.
+We haven't quite figured it out yet, but for starters you need to [[find the WiFi firmware|How-to-find-device-specific-information#firmware-files]], make sure it gets installed and adjust the path in your kernel config (see #122). Some firmwares need additional config files with calibration data, these can usually be found in the LineageOS or Google repositories.
+Wifi is working for the [[i9070|Samsung-i9070-(Samsung-Galaxy-S-Advance)]], all steps are listed on the device's wiki page! (see PR #138) (Feel free to put them here in a more generic way)
+First find the wifi device name with ip link. This is wlan0 on most phones.
+Try to start the wlan interface with ip link set wlan0 up. This will most likely end with an error. Now to get the detailed error from the driver/firmware start dmesg and search for the relevant log lines. Here you will find errors about possible missing firmware and the filename that it wants.
Usually your Android kernel expects the firmware files to be in a folder like /system/vendor/firmware and you need to patch the kernel and change the path to /lib/firmware/postmarketos (see this patch. Sometimes there is no need to patch, but simply change a kernel option that defines this path.
+ postmarketOS
+ The built kernel boots with a black screen and no further sign of acitivity. Fastboot flashes without errors but flash offsets are probably wrong. Only known working kernels have a different ELF file format.
+There is one tool avaiable for unpacking Sony's ELF boot format into the normal ANDROID format: +libbootimg
+Sadly, even unpacking and repacking a working prebuilt kernel doesn't seem to work.
+I had more luck with mkelf.py script from Sony. You can loosely follow the tutorial here. This time unpacking a working kernel elf image and repacking it with mkefl.py worked. Needed to change only a few bits with vbindiff. Now we only need to find a working set of offsets and image parts to do the same with a custom kernel!
+Here are some links describing the problem with Sony's boot format: + https://github.com/chenxiaolong/DualBootPatcher/issues/181 + https://github.com/Tasssadar/libbootimg/pull/2/commits/8986984b5d618be0b753e55d6b9d9d1744bc4094 +* https://books.google.de/books?id=2qo6AwAAQBAJ&pg=PA313&lpg=PA313&dq=sony+boot.img+format&source=bl&ots=0mtMMle9eZ&sig=adCVtfarXK9cticvd5qqYA6g39Y&hl=de&sa=X&ved=0ahUKEwjgp5mfx5XVAhUHWRQKHWSeDZcQ6AEIQzAB#v=onepage&q&f=false
+
+ postmarketOS
+ Current status: +With andersson kernel most things work
+
+ postmarketOS
+ Current status: The framebuffer doesent seem to work correctly (it just sits on boot logo) running cat /dev/urandom > /dev/fb0 does nothing and running cat /dev/urandom > /dev/fb2 makes the screen go black
+the same happens with cat /sys/devices/virtual/graphics/fb0/mode > /sys/devices/virtual/graphics/fb0/modes
What i've tried: + Using 3.10 instead of 3.4 (Gives same isue as anami) + Setting fb settings same as twrp (does nothing)
+
+ postmarketOS
+ [[postmarketOS|Home]] + [[Battery replacement]] + [[Boot process]] + [[Build internals]] + [[Device wishlist]] + [[Deviceinfo reference]] + * [[Flash methods|deviceinfo_flash_methods]] + [[Devices]] + [[External resources]] + [[Firmware]] + [[Glossary]] + [[Matrix and IRC]] + [[Milestones]] + [[Package naming convention]] + [[Partition layout]] + [[Plasma Mobile]] + * [[Packaging|Packaging Plasma Mobile]] + [[Related Projects]] + [[Tips and tricks]] + [[Troubleshooting]] + * [[Grsec|Troubleshooting:grsec]] + * [[Kernel|Troubleshooting:kernel]] + [[Upstreaming]]
+Howto + [[Create a package|Creating a package]] + [[Development guide]] + [[Find device specific information|How to find device specific information]] + [[Initramfs development]] + [[Inspecting the initramfs]] + [[Installation guide]] + [[Mainline Kernel|The Mainline Kernel]] + [[Migration to aports subfolders]] + [[Provide packages with a local webserver|Installing-packages-on-a-running-phone]] + [[Porting to a new device]] + [[Screen calibration]] + [[Serial debugging]] + [[Tuning sysfs]] + [[Using prebuilt kernels]] +* [[Wifi]]
+ + +
+ postmarketOS
+ fastboot should work when the green android appears on the screenelan-touchscreen.
Fun fact: grouper is the first tablet to run pmOS!
+ postmarketOS
+ 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. It is usually "0" | ++ |
name |
+Device model (e.g. "Google Nexus 5") | ++ |
manufacturer |
+Device manufacturer (e.g. "LG") | ++ |
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. This will be necessary for the mainline kernel. | ++ |
modules_initfs |
+Kernel modules to include in the initramfs image. Note: modules to be loaded after the initramfs can be specified like in a modules-load.conf (example). |
++ |
external_disk |
+Does the device have an sdcard or other external storage medium? | +true, false |
+
external_disk_install |
+Allow installing to sdcard | +true, false |
+
flash_methods |
+Method used to flash the device ([[more info | +deviceinfo_flash_methods]]) | +
arch |
+Device architecture, must be supported by Alpine Linux | +armhf, aarch64 |
+
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 | ++ |
kernel_cmdline |
+Kernel command line | ++ |
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 |
+
| ## weston | ++ | + |
| Variable | +Description | +Possibles values | +
|---|---|---|
weston_pixman_type |
+(optional) Use it as a workaround for issue #54. | +mostly "2" for ARGB, all values |
+
weston_core_modules |
+Module(s) to load on device when using Weston | +See the weston.ini manpage for a list of valid modules | +
weston_core_backend |
+Weston backend to use | +See the weston.ini manpage for a list of valid backends. Note that not all of these may be compiled into Weston for Alpine Linux. If not set, this defaults to 'fbdev-backend.so' | +
weston_keymap_rules |
+Keyboard keymap rule to use. | +Valid rules are listed in /usr/share/X11/xkb/rules/. |
+
weston_keymap_model |
+Keyboard keymap model to use. | +Valid models are listed in /usr/share/X11/xkb/rules/symbols, typically buried in a particular symbol file. For example, the model for the Nokia N900 is found in the file /usr/share/X11/xkb/symbols/nokia_vndr/rx-51, with a line that specifies -model nokiarx51. To set the keymap model for the N900, you would set weston_keymap_model=nokiarx51 in the appropriate deviceinfo file |
+
| 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 | +
+ postmarketOS
+ Here is a guide on how to find the correct value for deviceinfo_flash_methods, and some pitfalls you need to look out for depending on your flasher application. Please note, that all flasher mode implementations on the phones
+listed here are proprietary (even if the flashing software is open source). But they are hard to replace (if we can do that at all), so we will use them for now to flash pmOS on the devices.
Boot your phone into the bootloader menu. Usually this can be done by holding Volume Down and the Power button, until something changes on the screen, then only holding the Volume Down button until the menu appears. It should say either "Fastboot mode" or "Odin mode", read the appropriate section below. If
+you don't know the combination for your device, please search the Internet. (It is also a good idea to write this combination to your device's pmOS wiki page, so we can look it up quickly.)
Most Android devices are compatible with the open source fastboot protocol. That is good, because we simply can use the fastboot application to flash them, and no one needs to reverse engineer the protocol. You are done here, if you have a fastboot compatible device.
This uses a proprietary flashing protocol from Samsung. There has been great effort put into Heimdall, an open source program that tries to be compatible to the odin protocol. But it does not work perfectly yet, and some devices are not +supported at all.
+So first check if your device also supports fastboot - some Samsung devices (such as the Galaxy Nexus) actually have both protocols (you would need to press another key combination to enter fastboot mode - search the Internet for the +supported flash modes of your device). If you can use fastboot, please do so.
+For postmarketOS we're going to use Heimdall, but we use it in two different configurations - heimdall-isorec and heimdall-bootimg. You will need to find out the correct one for your device.
A boot.img file contains a Linux kernel and an initramfs, along with some other configuration, such as the kernel command line. Some Samsung devices support these boot.img files, while others only support flashing a kernel with
+a baked-in initramfs. To find out what your device has, download a known working image for your device
+(e.g. from the vendor, or a LineageOS ROM, ...). Usually they come in zip files. Extract the zip file, and you will find a boot.img inside. Run the command file on that to find out, whether it is a real boot.img file, or just a
+vmlinuz file:
file boot.img # real boot.img file -> use heimdall-bootimg
+Android bootimg, kernel, ramdisk, page size: 2048
+
+
+file boot.img # actually a vmlinuz file -> use heimdall-isorec
+boot.img: Linux kernel ARM boot executable zImage (little-endian)
+
+
+heimdall-bootimgWhen using that flasher, make sure that you also add mkbootimg to your depends line in the APKBUILD, and that you set deviceinfo_generate_bootimg in your deviceinfo file to "true".
+To generate a working boot.img, in the deviceinfo you also need to specify the variables for the various offset, follow this guide to find the correct values for your device.
heimdall-isorecUsually the initramfs would get packed into the vmlinuz file, when it has no support for the boot.img format. But this is a problem for postmarketOS, because we want to generate the initramfs explicitly after compiling the
+kernel, like it is done in typical Linux distributions.
So what we do instead, is putting the real initramfs on the recovery partition (or any other free partition, such as "kernel2", but the name comes from "isolated recovery" and was coined by Lanchon). The initramfs baked into the kernel only extracts the real initramfs, and executes its init script.
+You will need to adjust the init script of your kernel's built in initramfs to point to the right partition. Use the linux-samsung-i9100 package for reference.
In case you can't get it working with Heimdall, you could use the proprietary Odin program for Windows (e.g. in a VM) and flash from there. To do that, run the following commands to export all generated files from pmbootstrap and create an Odin-compatible tar file:
pmbootstrap install
+pmbootstrap flasher export --odin
+
+
+It would be great if you could record your flashing session with a USB sniffer and send it to the Heimdall developers (as ticket) or even implement support for your device in Heimdall yourself (C++ knowledge required). Please expand this wiki page on how to actually sniff the USB traffic, if you do that.
+The correct flasher is 0xffff (which reverse engineered Nokia's proprietary flashing protocol). Right now we do not have abstracted it in the pmbootstrap config (so pmbootstrap flasher flash_kernel etc. will not work). That is
+because the Maemo devices have an SD card slot, and it is possible to install uboot on them - so flashing was not really required yet. But it is easy to extend the config to implement that abstraction when it is needed.
+Simply edit the 0xffff part in pmb/config/__init__.py (and please make a pull-request after you have tested it).
+ postmarketOS
+ fastboot boot ... freezes the phone, as does using pmbootstrap.py flasher bootpmboostrap.py flasher flash_system or flash_kernel results in a remote:not allowed error, although this may be related to a corrupted partition table on my particular device.| device | +size | +filesystem | +description | +
|---|---|---|---|
| mmcblk0p16 | +25 MiB | +vfat | +~ | +
| mmcblk0p17 | +5 MiB | +vfat | +~ | +
| mmcblk0p24 | +10 MiB | +ext4 | +~ | +
| mmcblk0p31 | +48 MiB | +vfat | +~ | +
| mmcblk0p32 | +928 MiB | +ext4 | +android system | +
| mmcblk0p33 | +320 MiB | +ext4 | +android cache | +
| mmcblk0p34 | +5.8 GiB | +ext4 | +android userdata | +
adb pushing the .img file and attempting to use dd to write into the system partition. Only succeeded in mangling the partition.
+ postmarketOS
+
+ postmarketOS
+ The jolla does use fastboot from the mer project instead of android. To enter fastboot shut down the device, then plug in the USB lead while holding down volume down.
+
+ postmarketOS
+ ++This is just another clone from millions of devices from Chinese manufacturers.
+
fastboot boot. It can not be extracted like a normal boot.img file, as reported on IRC. Probably the extraction tool can't handle the files.++ramdisk and kernel has 512 bytes added in the beginning of the files
+custom header with file description
+
extracted boot.img, first bytes of pmOS initramfs (not working):
+sp@sppc:~/else/pmbs_work/chroot_native/pmos/extracted$ xxd -l 50 ramdisk
+00000000: 1f8b 0800 0000 0000 0203 949a 0d70 1ce5 .............p..
+00000010: 79c7 5fb0 09b2 621b 411d ac16 0317 c7a1 y._...b.A.......
+00000020: 0ed8 d6d9 96b1 2026 11b5 70d4 5814 4344 ...... &..p.X.CD
+00000030: ea49 .I
+
+
+extracted boot.img, first bytes of the vendor's initramfs (working):
+sp@sppc:~/else/pmbs_work/chroot_native/olololo/extracted$ xxd -l 50 ramdisk
+00000000: 8816 8858 f5a7 0c00 524f 4f54 4653 0000 ...X....ROOTFS..
+00000010: 0000 0000 0000 0000 0000 0000 0000 0000 ................
+00000020: 0000 0000 0000 0000 ffff ffff ffff ffff ................
+00000030: ffff
+
+
+
+ postmarketOS
+ fastboot boot /mnt/rootfs_lg-hammerhead/boot/vmlinuz-lg-hammerhead /mnt/rootfs_lg-hammerhead/boot/initramfs-lg-hammerhead
+
+
+[00:33:38] (native) flash kernel 'lg-hammerhead'
+creating boot image...
+creating boot image - 3600384 bytes
+sending 'SHLVL=1' (3516 KB)...
+OKAY [ 0.331s]
+writing 'SHLVL=1'...
+FAILED (remote: partition table doesn't exist)
+finished. total time: 0.511s
+[00:33:38] ERROR: Command failed: (native) % fastboot --base 0 --kernel-offset 0x00008000 --ramdisk-offset 0x02900000 --tags-offset 0x02700000 --page-size 2048 flash:raw /mnt/rootfs_lg-hammerhead/boot/vmlinuz-lg-hammerhead /mnt/rootfs_lg-hammerhead/boot/initramfs-lg-hammerhead
+
+
+Workaround (on host, not inside chroot):
+mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x2900000 --second_offset 0x00f00000 --tags_offset 0x02700000 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1' --kernel ~/.local/var/pmbootstrap/chroot_native/mnt/rootfs_lg-hammerhead/boot/vmlinuz-lg-hammerhead --ramdisk ~/.local/var/pmbootstrap/chroot_native/mnt/rootfs_lg-hammerhead/boot/initramfs-lg-hammerhead -o pmos.img
+fastboot boot pmos.img
+
+
+There is also a bug and the screen is not updated. Workaround: login using ssh and run the following command:
+ssh user@172.16.42.1
+sudo su
+while [ ! ]; do cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode; done
+
+
+| Component | +Module | +LineageOS Kernel | +Mainline kernel | +
|---|---|---|---|
| Storage | +sdhci | +Working | +Working | +
| WiFi | +bcmdhd | +Missing firmware | +No | +
| USB Networking | ++ | Yes | +No | +
| 2D Video | +mdss_fb | +Screen not refreshing automatically | +No | +
| 3D Video | ++ | Not in kernel | +No | +
| Debug serial | ++ | Yes, /dev/ttyHSL0 | +Yes, /dev/ttyMSM0 | +
+ postmarketOS
+ Hold Volume Down + Power, let go of Power once the device display does something (e.g. turns from battery icon to black screen).
Looks like, we need to package the wcnss.* files for wifi. A version from 2015 can be found here. It's a Qualcomm chip.
+These are not packaged yet in postmarketOS, feel free to package them. + "Almost mainline" from John Stultz <- maybe this also resolves the wrong-color-bug + Freedreno
+
+ postmarketOS
+ Motorola Moto G 2014 (2nd generation), aka "titan".
+initfs hook
+Splash screens don't work and I cannot get framebuffer working in initramfs
+sh /etc/postmarketos-mkinitfs/hooks/00-device-motorola-titan.sh`
+
+
+wifi: requires wcnss-service (some work already begun in titan-wifi branch)
+show_splash
+# From initramfs
+/tmp # show_splash splash1.ppm.gz
+fbsplash: short read
+
+
+This is written to dmesg everytime you type the previous command:
+[ 74.192213,0] mdss_fb_alloc_fb_ion_memory: alloc 0x398000B vaddr = e9b99000 (0x00200000 iova) for fb0
+[ 74.192374,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.192685,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.192846,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193004,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193106,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193263,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193366,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193522,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193624,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193780,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.193882,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194037,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194138,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194292,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194446,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194547,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194702,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194804,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.194960,0] vm_start=b6ad2000 vm_end=b6e6a000 vm_page_prot=1799
+[ 74.196516,0] lm3630a_bl 0-0038: wake up and re-init chip
+
+
+White LED:
+echo 255 > /sys/devices/leds-qpnp-rgb-e1d8be00/leds/white/brightness
+
+
+
+| Component | +Brand | +Module | +Works? | +
|---|---|---|---|
| Accelerometer | +Bosch Sensortec MEMS accelerometer sensor driver | +bma2x2 | ++ |
| Framebuffer | ++ | mdss | +Yes | +
| WiFi | ++ | wcnss | ++ |
| Storage | ++ | + | + |
| USB networking | ++ | + | + |
+ postmarketOS
+ run sdbootThe linux-firmware package is required to provide the wl1251 firmware necessary for initializing the wifi device. (#158)
Once the device has been successfully initialized, enable it:
+$ sudo ip link set wlan0 up
+$ sudo iw wlan0 set type managed
+
+
+Configure wpa_supplicant (only necessary on encrypted networks):
+$ sudo su -
+# wpa_passphrase $YOUR_SSID > /etc/wpa_supplicant/wlan0.conf
+<enter passphrase here and press Enter>
+# exit
+
+
+Connect to network using wpa_supplicant:
+$ sudo wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wlan0.conf
+
+
+If your network uses DHCP, start the DHCP client:
+$ sudo udhcpc -i wlan0
+
+
+There are 6 keyboard backlight LEDs that can be adjusted, they are found under /sys/class/leds/lp5523:kb{1-6}. To adjust brightness, write a value, $VAL between 0 and 255, to the brightness parameter as the root user:
for i in $(seq 1 6);
+ do echo $VAL > /sys/class/leds/lp5523\:kb$i/brightness
+done
+
+
+The boot partition can be accessed within postmarketos by mounting /dev/dm-0. This allows performing kernel updates by installing the linux-nokia-rx51 apk after mounting /dev/dm-0 to /boot.
With DRM enabled (#197), the display can be managed at this location: /sys/devices/platform/omapdrm.0/graphics/fb0/
In order to set the keyboard layout for the virtual console (e.g. to take advantage of number keys on the N900 keyboard), obtain your desired language keymap file for the RX-51, such as this one.. (TODO: Need to pull 'official' vconsole keymaps from Maemo5 if they exist..).
+On the N900, install kbd-bkeymaps, either by using pmbootstrap install --add kbd-bkeysmaps on the host system or by running apk add kbd-bkeysmaps on the device itself.
The keymap must be in binary format, bmap. This can be accomplished using the loadkeys tool:
$ apk add kbd kbd-bkeymaps
+$ loadkeys -b rx51_us.map > rx51_us.bmap
+$ gzip rx51_us.bmap
+
+
+Compress it and copy it to /usr/share/bkeymaps/us/ on the N900.
Log into the N900, and run sudo setup-keymap, then select us and finally rx51_us.
The current battery capacity can be found under /sys/class/power_supply/bq27200-0/capacity, and is represented as a percentage. For example, a value of 11 equates to 11%. If capacity does not exist or contains erroneous information, then your battery needs to be calibrated first. To calibrate the battery:
1) Charge it up fully, using a wall power adapter.
+2) Once it is charged up, power on the device
+3) Unplug the device and allow the battery to run all the way down until it powers off. This may take quite a while to happen (>24hrs, but can be made shorter by running a CPU intensive workload)
+4) When device powers off, plug it back into wall adapter and allow to charge up fully again. The battery and charging chip should now be calibrated.
+
+ postmarketOS
+ This device is used for testing purposes. It is possible to run postmarketOS in a x86_64 Virtual Machine. Note that only 64bits CPUs work.
+QEMU will emulate the default x86_64 architecture (see qemu-system-x86_64 -machine help for more choices).
$ ./pmbootstrap.py init # Choose qemu-amd64 as device
+$ ./pmbootstrap.py install
+$ ./pmbootstrap.py qemu
+
+
+
+ postmarketOS
+ This device is used to emulate an ARM Versatile Express for Cortex-A9.
+Vexpress (Versatile Express) is the reference architecture from the ARM Foundation. It simulates the armv7 architecture and a lot of other hardware (like graphics hardware).
+QEMU supports many other ARM architectures (see qemu-system-arm -machine help).
-dtb flag, it doesn't use the embedded dtb$ ./pmbootstrap.py install
+$ ./pmbootstrap.py flasher export
+$ cp ~/.local/var/pmbootstrap/chroot_rootfs_qemu-vexpress/usr/share/dtb/vexpress-v2p-ca9.dtb .
+$ qemu-system-arm \
+ -kernel vmlinuz-postmarketos \
+ -initrd initramfs-postmarketos \
+ -M vexpress-a9 \
+ -m 1024 \
+ -sd qemu-vexpress.img \
+ -append "console=ttyAMA0,38400n8 console=tty1 PMOS_NO_OUTPUT_REDIRECT" \
+ -dtb vexpress-v2p-ca9.dtb
+
+
+
+
+ postmarketOS
+ This device is not supported by LineageOS but the kernel is apparently in GitHub.
+ssh user@<ip> '/bin/sh'. With this, no prompt is shown (i.e. no "$" or "%"), but commands can be typed and executed and the results are displayedFailed to open frame buffer device ‘/dev/fb0’: No such file or directory
+ postmarketOS
+ Device: Samsung Galaxy S5 mini (SM-G800F; European version)
+Cortex A7 (32 bit ARM), quad core 1.4GHz; 1.5GB RAM, 16GB storage.
+ +Press and hold "volume down + home + power" simultaneously. Then click volume up to confirm.
+SYSTEM partition, so we can't do the entire install using just pmbootstrap flasher.udevadm trigger causes a complete system freeze and eventual reboot. If you comment out that line in start_weston.sh and replace it by udevadm trigger --attr-match=name=sec_touchscreen, the touch screen should work.First, download the TWRP recovery ROM. You'll need both the .img.tar and the .img file. First, extract the tar file to obtain recovery.img. Then, put your phone in flash mode and flash using Heimdall:
$ heimdall flash --RECOVERY recovery.img --BOOT twrp-3.1.1-1-kminilte.img
+
+
+Now you should be able to connect to the device using adb.
Follow the android-recovery-zip steps, substituting samsung-g800f for your-device in all the commands. If you get an error lddtree not found, simply run apk add lddtree in the chroot environment and try again.
If you get the following errors:
+device-mapper: reload ioctl on failed: No such file or directory
+Failed to setup dm-crypt key mapping for device /dev/block/mmcblk0p18.
+Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
+
+
+You can try to reinstall with a different cipher, by editing install_options and changing the CIPHER line to CIPHER="aes-cbc-plain64", re-zipping and using adb sideload again.
This can be done via ./pmbootstrap.py flasher flash_kernel
It should boot, and show the Samsung splash screen. After that you should be able to connect via telnet
+ +
+ postmarketOS
+ Unlike most other Android devices, the i9100 can not boot a boot.img (which consists of kernel + initramfs). Instead, the boot.img file is just a regular kernel. Here's an example from a LineageOS boot.img for the i9100 (for "real" boot.img files, file says something like boot.img: Android bootimg, kernel, ramdisk, page size: 2048 ):
/tmp/test # file boot.img
+boot.img: Linux kernel ARM boot executable zImage (little-endian)
+
+
+However, it is possible to directly integrate a initramfs into the kernel at kernel compile time (this is totally different from the boot.img approach, if this is unclear to you, please ask in the channel), and this is what the Android ROMs do on the i9100. While it is not a big deal in the Android compilation process, it is a problem for postmarketOS, because we want to be able to build the initramfs independently from the kernel.
The following workaround is currently implemented: + We flash the real initramfs to the recovery partition (source) + The initramfs init script built into the kernel checks if the recovery partition contains a compressed initramfs, and if it does, it extracts it and passes execution to the real initramfs' init script. +* This idea is based on something called "isorec".
+While this works for the i9100, this approach needs to be improved to also work on other Samsung devices, that need to be flashed with heimdall, like the i9070 (see #22).
+
+ postmarketOS
+ The volume buttons of my device are broken, so if I softbrick it, there is no way for me to get back into fastboot, because of that I didn't flash the kernel yet, and likely never will, all of this is tested by booting the kernel directly (pmbootstrap flasher boot).
The system image is a bit too large for the default system parition. You can either repartition or, use the easy way out. Simply flash the system image to your userdata partition, which is big enough. pmOS doesn't care, it just looks for a partition with a LUKS header, so this requires no changes at all to pmOS.
+ postmarketOS
+ It's the most stable one, works everything listed above.
+Works everything listed above, has heating issues.
+Compilation and flashing is successfull, haven't tried UART.
+Weston does not show up by default.
+Workaround:
+for i in 1 2; do echo "0,0" > /sys/class/graphics/fb0/pan; done
+
+
+Run it when weston is already started.
+