postmarketos-mkinitfs: mount /sysroot/boot from initramfs, not via fstab
Modify postmarketos-mkinitfs and postmarketos-base to mount the boot partition in the initramfs and not in /etc/fstab anymore.
While at it, remove the write_unless_modified logic from postmarketos-base.post-install, because the codepath of not modifying the given file is not useful and even got triggered once although it should not have been (#661 (closed)). The new /etc/fstab modifications are harmless now (and /etc/issue and /etc/motd aren't that important), but it's better to remove the function altogether, before we end up using it for something that is critical in the future.
Find the details in the commit messages.
Documentation
While implementing these fixes, I've updated the boot process and partition layout wiki pages. In particular, they have information about the pmos_boot and pmos_root kernel parameters now, and about the use case of having postmarketOS installed on SD and on eMMC at the same time.
- https://wiki.postmarketos.org/wiki/Boot_process
- https://wiki.postmarketos.org/wiki/Partition_Layout
- https://wiki.postmarketos.org/wiki/Fstab
Test plan
$ pmbootstrap install
(boot up)
$ cat /etc/fstab
$ mount | grep boot # pay attention to rw/ro
I've verified it myself on qemu-amd64 and pine64-pinephone.
qemu-amd64:~$ cat /etc/fstab
/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
/dev/usbdisk /media/usb vfat noauto,ro 0 0
# This file is *not* used to mount / or /boot.
# More information: https://postmarketos.org/fstab
qemu-amd64:~$ mount | grep /boot
/dev/vda1 on /boot type ext4 (rw,relatime)
Fixes: #664 (closed), #661 (closed), #258 (closed), #586 (closed)
Merge request reports
Activity
added initramfs type::feature labels
- Resolved by Administrator
added 14 commits
-
d82bb1d1...4cff95a5 - 11 commits from branch
master
- 58ae4df2 - main/postmarketos-base: rm write_unless_modified (MR 1398)
- 863ec713 - main/postmarketos-mkinitfs: mount /sysroot/boot (MR 1398)
- 784782f5 - main/postmarketos-base: keep /etc/fstab (MR 1398)
By Bart Ribbers on 2020-07-08T16:03:36
Toggle commit list-
d82bb1d1...4cff95a5 - 11 commits from branch
enabled an automatic merge when the pipeline for 784782f5 succeeds
By Bart Ribbers on 2020-07-08T16:03:48
Somehow I forgot the cherry pick label.
I've just verified that it works on the v20.05 branch too, with a pinephone and internal eMMC installation.
I'll cherry pick it now.
EDIT: cherry-picked, along with other patches touching postmarketos-base, so we have the same state as in master and patches apply cleanly.
By Oliver Smith on 2020-07-13T22:46:41
Edited by Administratoradded backport-to-v20.05 label
added 1 deleted label and removed type::feature label
mentioned in merge request !1850 (merged)
By Oliver Smith on 2021-01-07T23:37:39