Skip to content

esrt: fix ESRT GUID for EFI device #156

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

Merged
merged 1 commit into from
May 25, 2025

Conversation

aokblast
Copy link
Contributor

The EFI GUID in FreeBSD is layouted as following

typedef struct efi_guid {
uint32_t Data1;
uint16_t Data2;
uint16_t Data3;
uint8_t Data4[8];
} efi_guid_t;

Which means the Data1, Data2, Data3 should follows the little endian rule as the MSB should be in the right side.

Also, the table_len in the ioctl argument of EFI_GET_TABLE should be follow the uuid structure. Fix it by reorder it.

The EFI GUID in FreeBSD is layouted as following

typedef struct efi_guid {
	uint32_t  Data1;
	uint16_t  Data2;
	uint16_t  Data3;
	uint8_t   Data4[8];
} efi_guid_t;

Which means the Data1, Data2, Data3 should follows the little endian
rule as the MSB should be in the right side.

Also, the table_len in the ioctl argument of EFI_GET_TABLE should be
follow the uuid structure. Fix it by reorder it.

Sponsored By:   FreeBSD Foundation
Sponsored By:   Framework Laptop Inc.
Copy link

@obiwac obiwac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested it out, it works :)

Copy link
Member

@JohnAZoidberg JohnAZoidberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops thanks, I could've sworn I tried it.
But maybe I ignored an error because the freebsd syscall is flaky anyway.

@JohnAZoidberg JohnAZoidberg merged commit 25f3212 into FrameworkComputer:main May 25, 2025
@aokblast
Copy link
Contributor Author

Oops, I think my emacs setup break the linter. Could you please help me fix that? Or I can create a patch for it.

@JohnAZoidberg
Copy link
Member

Oops, I think my emacs setup break the linter. Could you please help me fix that? Or I can create a patch for it.

oh no problem: #158

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