0

I am hoping someone would be able to help me with the following. I have been trying to compile fdisk for UEFI shell the files are provided at

https://sourceforge.net/projects/uefi-fdisk/

as per the instructions in the readme I am running the 'make' command

But I am getting the following error

./configure: not found

I am not a linux pro, would appreciate any help in this matter.

If any of you is able to compile it please link it in, so I can download. Thanks

1 Answer 1

2

Note that https://sourceforge.net/projects/uefi-fdisk/ was last updated in 2020-04-10, and util-linux has been under steady development since then. So the newer versions of it might have become incompatible, and it might be best to use the exact version mentioned in the README file: it can be found at https://github.com/util-linux/util-linux/archive/refs/tags/v2.34.tar.gz .

So, first let's unpack util-linux:

tar xf v2.34.tar.gz cd util-linux-2.34 

At this point, I looked at the root directory of util-linux source code. Indeed, it had no configure script present... but it had configure.ac and autogen.sh. With a bit of experience on autoconf, I know that autogen.sh is the script that will usually produce ./configure out of configure.ac.

So, at this point it might be useful to deviate from the instructions in the uefi-fdisk README and run ./autogen.sh:

./autogen.sh [... lots of text output ...] Now type './configure' and 'make' to compile. 

And now we have the expected ./configure in the util-linux-2.34 directory. Now we can proceed with the rest of the instructions in the README:

(still in the util-linux.2.34 directory) tar xf ~/uefifdisk-0.6.tar.gz # or wherever you've downloaded it to cd uefi-0.6 

The README claims any 3.x version of GNU-EFI should work, so let's try the newest one:

tar xf ~/gnu-efi-3.0.18.tar.bz2 # or wherever you've downloaded it to 

Note: it seems to be important that you don't leave the gnu-efi-3.0.18.tar.bz2 package in the uefi-0.6 directory. Doing that will cause an error in the build process. Just keep the compressed files somewhere else, or delete them after uncompressing them.

Now it's finally time to run:

make [... a lot of text, ending with ...] strip -s -o fdisk.so.s fdisk.so objcopy -j .reloc -j .dynamic -j .rela -j .dynsym -j .text \ -j .rdata -j .data -j .bss \ --set-section-flags .dynamic=alloc,load,readonly,data \ --target=efi-app-x86_64 fdisk.so.s fdisk.efi rm fdisk.so.s fdisk.so 

Looks good.

ls -l fdisk.efi -rwxr-xr-x 1 username username 348160 Mar 3 11:19 fdisk.efi 

Hey, it worked!

Note that if your target system has Secure Boot enabled, you would need to have the fdisk.efi binary signed before you can run it. Attempting to run a unsigned *.efi file in a Secure Boot-enabled system may produce an error message, or the system may simply pretend the file did not exist or was not executable.

If you don't want to disable Secure Boot, you would have to run your fdisk.efi under a shimx64.efi that is configured with a Machine Owner's Key (MOK), and sign your fdisk.efi with the MOK private key.

Another alternative would be to take control of your Secure Boot key hierarchy, and add the public part of your signing key to the Secure Boot variable db. If your "BIOS settings" menu does not provide you a way to insert the key directly, you might have to delete the Secure Boot primary key (PK), which should enable Secure Boot Setup Mode, in which you should be able to modify any Secure Boot variables with no restrictions. If you go to this route, remember to add your Secure Boot public key as the new PK once you've done, to re-secure the system.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.