June 17, 2024

Antminer S9 U-boot build - Pain and suffering with mkeficapsule

The first signs of trouble are this message after we type "make".
  HOSTCC  tools/mkeficapsule
tools/mkeficapsule.c:18:10: fatal error: uuid/uuid.h: No such file or directory
   18 | #include 
Running "locate" on my fedora system shows a file by this name in:
/usr/include/linux/uuid.h
I edit tools/mkeficapsule.c to fix this path and then get:
tools/mkeficapsule.c:22:10: fatal error: gnutls/gnutls.h: No such file or directory
   22 | #include 
The answer to this is:
su
dnf install gnutls-devel
And then we get:
tools/mkeficapsule.c: In function ‘main’:
tools/mkeficapsule.c:908:29: error: implicit declaration of function ‘uuid_parse’ [-Wimplicit-function-declaration]
  908 |                         if (uuid_parse(optarg, uuid_buf)) {
This "mkeficapsule" program is a real turd. I wonder if I even need it? A bit of searching reveals: "mkeficapsule is a tool provided by U-Boot (as part of the tools-only targets) for generating UEFI capsule update archives."

It certainly doesn't sound like anything I need. I learn that there is also this package I should install:

su
dnf install uuid-devel
This gives us "/usr/include/uuid.h" -- but I don't see uuid_parse() declared. I add a stub routine for uuid_parse and then I get:
/usr/bin/ld: cannot find -luuid: No such file or directory
This is getting almost comical. I wish I knew how to just tell the U-boot build system to skip building this altogether. I see this on my system:
/usr/lib64/libuuid.so.1
There it is, as big as day. So, what the heck is the problem?
Who knows?

I edit tools/Makefile and comment out this line:

# hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule
This does the trick!!
The build now moves right along and finishes.
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org