Skip to content

Conversation

@amartinz
Copy link

No description provided.

NotKit and others added 7 commits January 19, 2022 16:49
Some MediaTek devices with eMMC storage enforce controller level
write-protection for partitions that are not supposed to be modified
during normal boot. In this case, syspart should be mounted ro, or
any write attempts will result in mmc controller errors and freezes.
This should help to simulate read-write rootfs on devices with
system partition write protection at the cost of extra fs layer
overhead.
This is needed for A/B devices.

I did not write this code, someone else did but i could not
identify the authorship of it.

Code was taken from device build scripts which contained this part
of code in a ramdisk overlay.

Change-Id: Ib1d509160fe1ca182f7c17431b5e2e3465bbdfc0
Signed-off-by: Alexander Martinz <[email protected]>
@UniversalSuperBox
Copy link
Member

UniversalSuperBox commented Jan 19, 2022

I'm not sure if we should do this. One of the original design goals of initramfs-tools-halium was to move it to using Debian infrastructure instead of UBports. If that was not a concern, we would have been using initramfs-tools-ubuntu-touch this whole time.

The original pitch for initramfs-tools-halium is still open: Halium/projectmanagement#55

In the intervening four years, some things have changed. In particular, Android decided to get rid of initramfs for android9 system-as-root devices. This meant that we were unable to carry initramfs-tools-halium for many devices, so we devised Jumpercable and moved a lot of the mounting logic to the rootfs in general. For Ubuntu Touch based on Ubuntu 20.04, we've performed a small rearchitecture of our boot and mount logic to actually make the dream of a small initramfs (carried by some ever since we started using initramfs-tools-halium) more possible.

Most importantly: The udev race is no longer a problem. We let Linux mount the system partition (via root= on the cmdline) and provide the data partition as a numbered entry (via datapart=/dev/mmcblk... on the cmdline). We mount Android partitions smarter without necessarily requiring udev's coldboot.

I'm not sure if carrying initramfs-tools-halium again into Android 11 is the best choice. In theory, all we need now is an initramfs that knows how to mount the GNU/Linux system's root filesystem and chroot into it. While initramfs-tools-halium may have been a convenient way to build this, I think that a scorched-earth approach will suit better for the future.

Have I mislaid an assumption?

@amartinz
Copy link
Author

i fully agree with you and to be honest, i took the comfortable approach and reuse existing work done by others.

if possible we should surely rethink that whole topic and slim it down.

that would also mean that we need to find a common ground for focal, because i personally would like if we can drop as much legacy as possible, while others want to carry devices dating back to Android 5.1 to focal.

the sooner we figure out which approach we want to take, the better.

@UniversalSuperBox
Copy link
Member

The nice thing is that focal doesn't need everything to agree. The code is happy to have all of the mounts set up for it or not. initramfs-tools-halium will live out in Ubuntu Touch for 7.1 and 9.0 (system-as-system) devices at least, and 5.1 if needed. 9.0 system-as-root and beyond only need to make sure that the Ubuntu Touch rootfs is mounted at /, that the datapart is specified on the command line, and run Jumpercable.

@UniversalSuperBox
Copy link
Member

Oh, we'll need to add support for dynparts into the system as well. But given the binaries are already around it should be doable.

@amartinz amartinz closed this Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants