Stuart Henderson <[email protected]> writes:

> On 2025/08/05 08:17, Dave Voutila wrote:
>> Stuart Henderson <[email protected]> writes:
>>
>> > You can probably just BUILD_DEPENDS on sysutils/e2fsprogs, I think that's 
>> > basically the same uuid library as in
>> > utils-linux.
>> >
>>
>> Sadly it doesn't appear to be or the way e2fsprogs installs it, it
>> doesn't work. /shrug
>
> having two libraries named libuuid.so.whatever is a non starter for
> ports, so it would need to be done differently than just installing the
> utils-linux ones under the same name.
>
> do you already have a WIP port for edk2 or just building separately?
> if you have one, I'm happy to take a look and see if I can whack it into
> shape if you like. it's quite likely that it's just a different include
> path or something that would be needed.
>
>> > Alternatively you can often patch to use the uuid functions we have in 
>> > libc without too much trouble.
>>
>> That might be a good option now that you mention it. I'll take a
>> peek. Either UEFI or the edk2 implementation seems full of GUIDs and i
>> don't see why there would be anything special in the utils-linux
>> version.
>
> the APIs are a bit different (iirc one of them wants things
> allocating upfront and the other returns memory that you need to
> free for most things) but it's not usually too bad to change.
> iirc there's some convenient print or string related function
> that one of the common uuid APIs has but the other doesn't which
> was the most annoying of the things I ran into.
>
> but if it's anything other than "easy", considering it's only a
> build dep, the extra dep doesn't really hurt.


I think i figured out the easiest fix:

diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c 
b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index e4f4090ee4..52c4e3b997 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 // Include files
 //

-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <uuid.h>
 #elif defined(__GNUC__) && !defined(_WIN32)
 #if !defined(__CROSS_LIB_UUID__)


Why this works is beyond me. Probably the build system switched all the
uuid stuff to Python and this is dead code? lol

Reply via email to