Changes

Jump to navigation Jump to search
166 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 (encrypted, unless --no-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>boot=== Subpartitions ===systemuserdata</pre>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 imageinstall 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.
The <code>userdata</code> partition is not used yet (proposal to do that is in [https://github.com/postmarketOS/pmbootstrap/issues/60 #60]). But as we are pretty flexible, you can also flash pmOS to will be installed into the <code>userdata</code> system partition, if it has more space and you can't fit it on which means the <code>system</code> postmarketOS boot partition. The initramfs will detect it anyway. Just make sure, that you don't have it flashed to ''both'' partitions!<br />To flash to the becomes <code>userdatasystemp1</code> partition instead of and the <code>system</code> postmarketOS root partition, use becomes <code>pmbootstrap flasher flash_system --partition=USERDATAsystemp2</code>.
Example:<syntaxhighlight lang=== Future ideas ==="shell-session">$ pmbootstrap init$ pmbootstrap install$ pmbootstrap flasher flash_kernel$ pmbootstrap flasher flash_rootfs</syntaxhighlight>
{{note|See also: Allow booting from an image file (Note that the <code>flash_kernel</data/postmarketOScode> command fills Android's boot partition with a boot.img) instead file, that consists of flashing to 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 ({{github|953}})}}.
There might be scenarios==== Pick a different subpartition ====While on some devices, in which the system partition type of 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>systempmbootstrap flasher flash_rootfs --partition userdata</code> . To clear a previous postmarketOS installation from the system partition can not be changed through the flasher, because it only allows [https:use <code>fastboot format system<//en.wikipedia.org/wiki/YAFFS2 yaffs2] or simg with ext4 support code> (during research for otherwise, the mozilla flame, we found that to be initramfs may boot into the case ([https://github.com/postmarketOS/pmbootstrap/issues/299 #299]) - however, it also has an SD slot, so we did not continue this way ([https://github.com/postmarketOS/pmbootstrap/issues/337 #337])wrong installation!).
A proposal we have for that case=== On-device installer ===The on-device installer starts with three partitions (boot, reserved space, is to have one big ext4/yaffs partitioninstaller). It installs postmarketOS into the reserved space, and include removes the whole system image file inside that. Then we would adjust third partition, so in the initramfs code to find end it looks like the regular boot and root partitions inside thatpartition layout. Details are in the [[on-device installer]] article. == See also ==* [[Boot process]], and teach it in particular how to resize the whole thing partitions for boot and root are determined* {{github|953}}: idea to the maximum partition size. We already boot from an image file (did some experimentsnot go anywhere, and so far everything worked (talk to drebrez or ollieparanoidopen a new issue if you are interested in implementing this).* [[deviceinfo_flash_methods|Deviceinfo: flash methods]] [[Category:Technical Reference]]__NOTOC__

Navigation menu