Changes

Jump to navigation Jump to search
106 bytes added ,  22:10, 6 July 2020
=== General partition layout (A postmarketOS installation image) ==={{note|The postmarketOS initramfs detects consists of two partitions, the boot and the partitions by their root partition label.}}<pre class="shell">/dev/installp1 # label: pmOS_boot This distinction was made to support FDE (contains kernelfull disk encryption). With FDE, initramfsthe entire root partition gets encrypted, initramfsand the only non-extra)/dev/installp2 # label: pmOS_root encrypted part remains the boot partition (can be encrypted, when --fde is specifiedwhich does not hold any personal data)</pre>.
<syntaxhighlight lang=== SD card ==="shell">p1 # label: pmOS_boot (contains kernel, initramfs, initramfs-extra)p2 # label: pmOS_root (contains everything else, can be encrypted)</syntaxhighlight>
This is Due to the least awkward layout - both partitions from above get directly created on the SD card. If your device has wide range of devices we support, there are a sdcard slot, it is recommended to use it. Because then you don't wear down the internal flash storage few variations of the device and don't need to worry about the phone's internal storage partition layoutwhere these partitions will be exactly after installing postmarketOS.
Usage:=== Use the whole storage device ===Both partitions are directly written to the storage device (SD card, eMMC, ...), for example <code>/dev/mmcblk0p1</code> and <code>/dev/mmcblk0p2</code>.
<pre class="shell">$ This is always done with SD cards./pmbootstrapWith the eMMC (internal storage), this is only done if it the factory OS can be flashed back without relying on a specific partitioning layout.py install --sdcard /dev/mmcblkX</pre>=== (This is not possible with Android internal storage ===, see [[#Subpartitions|subpartitions]] below.)
We don't want A typical SD card installation:<syntaxhighlight lang="shell-session">$ pmbootstrap init$ pmbootstrap install --sdcard=/dev/path-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:-sdcard-device</syntaxhighlight>
The Android internal storage is already partitioned A typical eMMC installation (you would flash the resulting image with a tool like [https://wiki.pine64.org/index.php/PinePhone#Flashing_eMMC_using_Jumpdrive Jumpdrive]):<syntaxhighlight lang="shell- session">$ pmbootstrap init$ pmbootstrap install$ pmbootstrap export # create a symlink to the layout seems to be different rootfs image file for every device, as well as the numbers they have assigned. But most notably the devices have the following partitions:further usage</syntaxhighlight>
<pre>bootsystemuserdata</pre>=== Subpartitions ===We usually flash a <code>boot.img</code> file (which is the kernel + initramfs) to Android's <code>boot</code> partition (see also: [[deviceinfo_flash_methods]]) - because that is what works and what all other ROMs dofactory OS) require a specific partition layout. Now In order to make it feasible for the interesting part is the system partitionuser to switch back to Android on their device, where we flash our installation image (rootfs)install postmarketOS only into an existing partition. But the installation image already has a partition layout The postmarketOS boot and own root partitions! So you will have '''become subpartitions'''of that partition. In the end, it will look like this:
<pre class="shell">systemp1 # pmOS For example, a typical Android installation consists of:* boot partition, only initramfs-extra gets used from theresystemp2 # pmOS (un)encrypted root filesystem</pre>* system* userdataThe initramfs * (in the <code>bootmore partitions with firmware etc.img</code> file!) will automatically find and mount the pmOS boot and root partition, load the <code>initramfs-extra</code> (which contains additional files, it was split to save space) and take care of booting through until [https://github.com/postmarketOS/pmbootstrap/wiki/Glossary#openrc OpenRC] takes over.
==== Flashing to "userdata" ====The <code>userdata</code> postmarketOS will be installed into the system partition is not used yet (proposal to do that is in {{issue|60}}). But as we are pretty flexible, you can also flash pmOS to which means the postmarketOS boot partition becomes <code>userdatasystemp1</code> partition, if it has more space and you can't fit it on the postmarketOS root partition becomes <code>systemsystemp2</code> partition. The initramfs will detect it anyway. Just make sure, that you don't have it flashed to ''both'' partitions!
To flash to the Example:<code>userdata</code> partition instead of the <code>system</code> partition, use <codesyntaxhighlight lang="shell-session">$ pmbootstrap init$ pmbootstrap install$ pmbootstrap flasher flash_kernel$ pmbootstrap flasher flash_rootfs --partition=USERDATA</codesyntaxhighlight>.
If you had flashed postmarketOS to Note that the system partition before, make sure to format it with <code>fastboot format systemflash_kernel</code>command fills Android's boot partition with a boot.img file, that consists of the Linux kernel and initramfs from postmarketOS. The files are duplicated on the postmarketOS boot partition, but not used from there. Some Android devices have a strict size limit for this boot.img file, which is why we load additional files from the initramfs-extra file from the postmarketOS boot partition.
=== Future ideas =Pick a different subpartition ====While on some devices, the system partition is bigger than the userdata partition, it is the other way around on others. So it is possible to switch to the userdata partition with <code>pmbootstrap flasher flash_rootfs --partition userdata</code>. To clear a previous postmarketOS installation from the system partition, use <code>fastboot format system</code> (otherwise, the initramfs may boot into the wrong installation!).
{{note|See also: Allow booting from an image file === On-device installer ===The on-device installer starts with three partitions (/data/boot, reserved space, installer). It installs postmarketOSinto the reserved space, and removes the third partition, so in the end it looks like the regular boot and root partition layout. Details are in the [[on-device installer]] article.img) instead of flashing to a partition ({{github|953}})}}
There might be scenarios== See also ==* [[Boot process]], in which particular how the partition type of the <code>system</code> partition can not be changed through the flasher, because it only allows [https://en.wikipedia.org/wiki/YAFFS2 yaffs2] or simg with ext4 support (during research partitions for the mozilla flame, we found that to be the case (boot and root are determined* {{issuegithub|299953}}) - however, it also has : idea to boot from an SD slot, so we image file (did not continue go anywhere, open a new issue if you are interested in implementing this way ({{issue|337}})). 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).* [[deviceinfo_flash_methods|Deviceinfo: flash methods]]
[[Category:Technical Reference]]
__NOTOC__

Navigation menu