Menu

Tree [7f864e] main /
 History

HTTPS access


File Date Author Commit
 libmy 2023-04-13 Bernard Bernard [aca688] Ajouté getramndom et getopt
 Makefile 2023-04-15 Bernard Bernard [7f864e] Construction de l'archive sans besoin de clean
 README 2023-04-13 Bernard Bernard [87b93c] Version 0.7 should compile alos on Fedora
 TODO 2023-04-12 Bernard Bernard [b02a97] TODO
 alloc.c 2020-04-09 Bernard Bernard [7d96b6] Projet util-linux fdisk à la place de gdisk.
 debug.c 2020-04-09 Bernard Bernard [40234d] Projet util-linux fdisk à la place de gdisk.
 debug.h 2023-04-12 Bernard Bernard [1dd262] Typo
 efi_main.c 2023-04-12 Bernard Bernard [7a996f] Typo
 elf-x86_64.lds 2020-04-09 Bernard Bernard [ca3ed2] Projet util-linux fdisk à la place de gdisk.
 initfini.c 2020-04-09 Bernard Bernard [86080f] Projet util-linux fdisk à la place de gdisk.
 io.c 2023-04-12 Bernard Bernard [0bd82b] La fonction __open64_2() prend plus de deux arg...
 libcolr.c 2023-04-12 Bernard Bernard [363a1c] Typoe et ménage
 libcomn.c 2023-04-12 Bernard Bernard [59e356] Renommé libcomn.c
 libuuid.c 2023-04-12 Bernard Bernard [56748c] Typo
 relocate-x86_64.c 2020-04-09 Bernard Bernard [b8af7b] Projet util-linux fdisk à la place de gdisk.
 start-ia32.S 2020-04-09 Bernard Bernard [363cdc] Projet util-linux fdisk à la place de gdisk.
 start-x86_64.S 2023-04-12 Bernard Bernard [f17eb1] Typo
 thread.c 2020-04-10 Bernard Bernard [5fc861] La fonction pthread_once() ne sert plus.
 time.c 2020-04-09 Bernard Bernard [8953e8] Projet util-linux fdisk à la place de gdisk.
 uefi.h 2020-04-09 Bernard Bernard [5e067c] Projet util-linux fdisk à la place de gdisk.

Read Me

UEFI fdisk: aka fdisk.efi by Bub'soft.
Build of util-linux fdisk for UEFI BIOS environments.
Version 0.7 april 2023.
Version <1 means it's pretty much beta software in fact.

First attempt by Bernard Burette <bernard at burette dot net>
january 2014.

This is a build of util-linux fdisk for UEFI. You should be able to
register it as a boot-program in the UEFI or run it from the UEFI Shell
if you system has one. Anyway this executable image should be copied to
the EFI System Partition (aka EFI SP or Partition type 0xEF) to be
permanently available. You also have the option of copying it to a
removable storage like USB storage and invoke the UEFI Shell then
navigate ("fs1:", "cd xx", etc.) to your key to run it from there.

Unlike the original fdisk, this program accepts no options on its
command line. When you run it, it prints a list of all detected hard
disks each with a name like "EFI_HANDLE(<hex_number>)" and if more than
one is found lets you choose which one you want to review/edit.

Also the commands to backup the partition table to disk (O option in
main menu) and to load the partition table from a backup file (I option
in main menu) do not work (yet). I need to write the code to read from
and write to a file in pure UEFI code first.

Apart from that all functions should operate properly. Refer to fdisk
manual for more information on how to use this program.


To successfully build UEFI fdisk, you will additional packages:
- util-linux fdisk, the original code can be found at:
  https://github.com/karelzak/util-linux
  fdisk needs additional libraries as well: check it's documentation.
- GNU-EFI library, can be found at:
  http://sourceforge.net/projects/gnu-efi/

Unpack the sources from util-linux to a location you like, it will
create a subdirectory containing all its stuff. Then go inside this
subdirectory (for example ~/util-linux-2.38) and *there* unpack this
package, it will create a new subdirectory (for example
~/util-linux-2.38/uefi-0.7) where you will actually build the UEFI
version of fdisk. You now need to unpack GNU-EFI package in this build
directory, it will once again create its own subdirectory (for example
~/util-linux-2.38/uefi-0.7/gnu-efi-3.0.15).

Now your current directory should still be ~/util-linux-2.38/uefi-0.7,
so just enter "make" and voilà!


A few things to know:
- We use GNU-EFI version 3.0.15 but any version around 3.x and hopefully
  newer versions should work as well, you might need to adjust the
  directory name in the Makefile if auto-detection does not work.
- No 32 bits stuff has been done (is it still necessary nowadays?) the
  GNU-EFI library can be compiled in both 32 bits and 64 bits but this
  program will at the very least miss the start-up code "start-ia32.S"
  and the relocation management code "relocate-ia32.c", feel free to
  help me if you think this is a necessity.
- We use a hand-made version of the standard "libc" because the linux
  one embeds system calls to the kernel (we don't want them because EFI
  has nothing to do with Linux kernel), this library is mostly built
  from bits imported from "dietlibc" but some other bits were imported
  from "glibc". This private "libc" library is called "libmy.a" and is
  built in the "libmy/" subdirectory.
- We build everithing using 2 bytes wchar_t because EFI is UTF-16, still
  util-linux fdisk uses UTF-8 internally so it doesn't need any other
  UTF-xx and our glue functions hand code conversions from UTF-8 to EFI
  UTF-16: this might not work in all languages.
- As written before the UEFI functions don't include directory and file
  management so the parts of fdisk for backup to file and recovery from
  file don't work at all (the open() function returns EIPERM and fdisk
  will display an error).
- For all the system calls from the standard libray we build EFI
  versions of functions like write(), read() and so on, all these
  functions are in the ".c" source files in this "." directory, not in
  the"libmy/" subdirectory.
- If you change options in the Makefile (like enable asserts or stack
  checking or _FORTIFY_SOURCE or EFI_DEBUG debugging) the link should
  warn you that you're adding bloat to the program.
- Some libmy.a files have been updated to compile with version 12 of GCC,
  as this is the version packaged with most recent Ubuntu 22.10 you need
  around 100 MiB of free disk space to build everything, the fdisk.efi
  programm itself is around 300 kiB.
 

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.