-
Notifications
You must be signed in to change notification settings - Fork 14
RB1: Partition table update as well as some cleanup #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As reported on qualcomm-linux#9, the GUID used for rootfs is incorrectly. It was wrongly inherited from the original partition XML file of an Android build, and the GUID which was used corresponds to what Android uses for userdata partition. This changes sets the correct GUID (b921b045-1df0-41c3-af44-4c6f280d3fae) for Root Partition (64-bit ARM/AArch64). Reported-by: Loic Minier <[email protected]> Signed-off-by: Nicolas Dechesne <[email protected]> Signed-off-by: Sumit Garg <[email protected]>
The *_r partitions are dropped since they are no longer supporting any known use-case. The A/B boot sequence offers all the needed features as of now. Signed-off-by: Sumit Garg <[email protected]>
Given the UEFI boot requirement, the boot partition is only meant to support U-Boot chainloaded from ABL. The traditional Linux android boot image is no longer required to support booting Yocto, so let's optimize for size and give more flash space available for the user. 4MB is choosen as maximum limit for U-Boot image size since with more UEFI features enabled like secure boot etc. the size can cross 2MB limit. Signed-off-by: Sumit Garg <[email protected]>
Thanks for progressing this @b49020! Each commit makes sense to me; NB: I haven't tested the updated partitions. I wonder how we should convey the assumptions and requirements for people consuming these files. We have an effort in progress to build a companion site to convey the role of each repo under qualcomm-linux and how they work together (perhaps also repositories outside of qualcomm-linux org), but I believe we still want each repo to carry its own documentation when relevant. If I was trying to convey this in, say, a markdown doc along with qcom-ptool, I'd share my basic understanding of what we're trying to do here and the state of things as follows (this is a bit of a brain dump):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I guess we will do further cleanup once we know the role of each partition.
Looks like a great idea to me. I will try to document bits along as per your suggestion however some comments on following bits:
I am not sure if this repo is the right place to hold a list of features supported by the firmware as it can easily get out of sync. It's better to put them under overall Qcom Linux documentation specifically under board specific BSP documentation.
This info makes sense for this repo however we are still collecting information about role of each partition. Once that's available we can document them as well as drop unneeded partitions. |
That would really be a nice feature but I am unsure if that's achievable on Qcom platforms since the firmware and the OS partitions co-exist in the main eMMC flash area. One idea could be to support a dedicated flash media for OS installation like SD card then we can restrict eMMC access to firmware only but that will just be a lot of flash space left wasted. |
I suppose UFS allows for this kind of partitioning based of different LUNs. |
What about eMMC boot partitions? Could we use these as is being done for the CDT? |
Indeed. I had that in mind, or perhaps finding something with write protect. there are 2 'features' here. 1) hide the partitions which are not dedicated to the OS, 2) ensure that a user cannot 'easily' erase them. |
To leverage hw boot partition:
Note also that GPT has partition attribute flags, like |
This will force changing quite a few components, and size might still not be enough. Following EBBR (https://github.com/ARM-software/ebbr/blob/main/source/chapter4-firmware-media.rst#gpt-partitioning) we can set them as 'required partition'. In the end they will be exposed, but as described in EBBR, ideally those wouldn't automatically be changed by generic linux installers (but would depend on the installer). |
Although we should be able to change later boot-loader stages but the PBL code (ROM code on Qcom platforms) loads XBL-SC from the xbl_* partition. The ROM code is un-modifiable and if it doesn't support loading from an eMMC boot partition then we won't have any option then. I will double check though. The second main issue will be the size constraint as below:
This will only be able to hold a single uefi_a partition (sz: 8MB) which really will be a blocker to use these partitions if we really want a dedicated storage option for the OS. Another issue is that the firmware/boot-loader itself uses the same GPT partition layout to load firmware images which is being used by the OS as well. It's really a problem for distro installers as they can't create or alter the GPT partition layout to best suite their needs like dynamic size of ESP partition, rootfs or if user wants to create a separate userdata partition which might be encrypted as well. |
PBL (like most boot components) will 'search' for partition by looking up GUID. I don't know if they search in user data only, or if they seach in the boot partitions too.. |
d58b0ae
to
4c6e7bc
Compare
The bluetooth_* partitions are known to be not used by the Yocto or Debian BSP, so let's drop them. Signed-off-by: Sumit Garg <[email protected]>
The future firmware plan for RB1 is to switch from current ABL boot flow to proper edk2/UEFI boot flow as supported by RB3G2. This partition layout update helps us to prepare for migration from current ABL based boot flow to rather edk2/UEFI based boot flow. IOW, there won't be any need to chainload U-Boot to provide UEFI interface once we migrate. Add UEFI, corresponding DTB and recoveryinfo partitions similar to what we currently have on RB3G2. Signed-off-by: Sumit Garg <[email protected]>
In order to be compliant with future edk2/UEFI upgrade, let's update GUIDs for *_b partitions which is required to be compatible with capsule update requirements. Signed-off-by: Sumit Garg <[email protected]>
Add ddr_b partition which is to be used in order to support proper A/B boot flow. Signed-off-by: Sumit Garg <[email protected]>
Add description as to how qcom-ptool is internded to be used and list supported boot flows. Signed-off-by: Sumit Garg <[email protected]>
I hope I have addressed all the comments, feel free to review again. |
This PR intends to update RB1 partition layout such that it is compatible with future edk2/UEFI support as well as optimising for size to drop redundant partitions and reducing size for boot partition.