Skip to content

Align rootfs partition id with freedesktop GUIDs on all platforms #9

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

Open
lool opened this issue Apr 8, 2025 · 8 comments
Open

Align rootfs partition id with freedesktop GUIDs on all platforms #9

lool opened this issue Apr 8, 2025 · 8 comments

Comments

@lool
Copy link
Contributor

lool commented Apr 8, 2025

Hi,

In current qcom-ptool, these platforms define an ESP partition called "efi" (using efi.bin) using the proper GUID (c12a7328-f81f-11d2-ba4b-00a0c93ec93b) for EFI System Partition per The Discoverable Partitions Specification (DPS):

  • platforms/qcm6490/partitions.conf
  • platforms/qrb4210-rb2/partitions.conf
  • platforms/qcs9100/partitions.conf
  • platforms/qrb2210-rb1/partitions.conf

However while all of these platforms define a root partition called "rootfs" (using rootfs.img), only these two platforms use the correct GUID (b921b045-1df0-41c3-af44-4c6f280d3fae) for Root Partition (64-bit ARM/AArch64):

  • platforms/qcm6490/partitions.conf
  • platforms/qcs9100/partitions.conf

While these two use a GUID not defined in the DPS (1B81E7E6-F50D-419B-A739-2AEEF8DA3335):

  • platforms/qrb4210-rb2/partitions.conf
  • platforms/qrb2210-rb1/partitions.conf

Notably, I don't think systemd recognizes this GUID.

@lool
Copy link
Contributor Author

lool commented Apr 8, 2025

I suspect this is a remnant of these platforms shipping without an UEFI capable firmware.

@ndechesne
Copy link
Contributor

We imported the partition.conf file for RB1 from db-boot-tool from Linaro, and that GUID comes from here:
https://git.codelinaro.org/linaro/qcomlt/db-boot-tools/-/commit/fb9032ce65d72cc0f00a5d6de727c979fedc1036
When we converted the Android partition config to Linux with ESP and rootfs. This GUID was the one used for the Android userdata partition. So this is a real bug. Do you want to update it?

@lool
Copy link
Contributor Author

lool commented Apr 8, 2025

Is there any known meaning to the GUID? Any boot firmware or other tool that might count on it?

@lool
Copy link
Contributor Author

lool commented Apr 8, 2025

Not sure if this is legit, but this random repo lists it as "userdata" partition:
https://github.com/HelllGuest/Qualcomm_tools/blob/master/gpt_parser-for-xml.py#L473

And this one as Android user data:
https://gitlab.tails.boum.org/tails/gdisk/-/blob/tails/bookworm/parttypes.cc?ref_type=heads#L350

@ndechesne
Copy link
Contributor

Is there any known meaning to the GUID? Any boot firmware or other tool that might count on it?

yes. The GUIDs are used to 'find' the partition. eg. the ROM CODE (PBL) will find the first stage bootloader (XBL) by looking for the GUID DEA0BA2C-CBDD-4805-B4F9-F428251C3E98. And it's the same thing for each stage of the boot.

@lool
Copy link
Contributor Author

lool commented Apr 8, 2025

Is there any known meaning to the GUID? Any boot firmware or other tool that might count on it?

yes. The GUIDs are used to 'find' the partition. eg. the ROM CODE (PBL) will find the first stage bootloader (XBL) by looking for the GUID DEA0BA2C-CBDD-4805-B4F9-F428251C3E98. And it's the same thing for each stage of the boot.

So which part might be break by changing the Android userdata partition? I guess this highlights that this is also OS specific, so really the partitions files here might be for a Linux boot, a Yocto A/B boot, or an Android A/B boot.

We should still be consistent and use the right GUIDs when that makes sense, but I suspect we'll maintain partition files in OS-specific repositories.

@ndechesne
Copy link
Contributor

So which part might be break by changing the Android userdata partition? I guess this highlights that this is also OS specific, so really the partitions files here might be for a Linux boot, a Yocto A/B boot, or an Android A/B boot.

Using the userdata GUID was a 'bug'. For our rootfs partition we need to use the correct GUID (b921b045-1df0-41c3-af44-4c6f280d3fae) for Root Partition (64-bit ARM/AArch64). It won't break anything.

ndechesne added a commit to ndechesne/meta-qcom that referenced this issue Apr 9, 2025
As reported on qualcomm-linux/qcom-ptool#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]>
lumag added a commit to qualcomm-linux/meta-qcom that referenced this issue Apr 9, 2025
As reported on qualcomm-linux/qcom-ptool#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).
@ricardosalveti
Copy link
Contributor

Yeah, changing for the rootfs only won't really affect anything here.

b49020 pushed a commit to b49020/qcom-ptool that referenced this issue Apr 30, 2025
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]>
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

No branches or pull requests

3 participants