Hi,
The following is a series of 3 small changes that aim at making the GRUB
codebase more palatable to toolchains such as the EDK2. The main aim is
to enable the use the EDK2 and the GRUB fs code to compile read-only EFI
file system drivers (such as the ones from my efifs project [1]).
It needs to be stressed out that none of these changes have any impact
on the code logic, as they simply boil down to redefining/renaming elements.
* PATCH 1/3 deals with removing the 'size_t' typedef from zfs_lz4.c and
using 'grub_size_t' instead, which is what the typedef is set to in the
first place. This is required to avoid a size_t redef error when using
the EKD2 toolchain.
* PATCH 2/3 replaces the nonstandard use of the '\e' C escape sequence
with its 0x1B hex equivalent. While '\e' is generally understood by
gcc/Clang compilers, others (MSVC) will produce an error. As per
Wikipedia [2], '\e' is not part of any C standard and therefore better
avoided.
* PATCH 3/3 prefixes the gzio defines with 'GZ_'. This is done to avoid
a conflict with a PACKED define in the EDK2. Note that there were 3
possibilities here:
1. Remove the #define PACKED line altogether, since it's not used
anywhere. We decided not to go with this so that in case PACKED is ever
implemented as well as to help people understanding what constant 2 is
for, in case they are ever faced with it.
2. Add a conditional #ifdef PACKED #undef PACKED, which we also decided
against, in case the use of a toolchain's PACKED becomes warranted in
the same code section.
3. Prefix all the constants with GZ_, which is what we decided to go
with. The reasoning is that "#define COMPRESSED" and "#define COMMENT"
are probably a bit too generic and may also conflict with other defines,
so it's probably a good idea to make all the GZ specific constants
unlikely to create conflicts.
Finally, since I've also been carrying this patch for a while in my
repo, and I have recently had positive reports from people using the EFI
version against a real file system, could the F2FS proposal *please* be
integrated into GRUB at long last? I believe this proposal has been
submitted a few times already (last one was on May 4th), and I don't
recall seeing any objections. The reason I ask is that I have been been
carrying the GRUB F2FS patch in efifs for some time, and I sure wouldn't
mind if I could reduce the number of patches users need to apply, before
they can use the GRUB submodule.
Regards,
/Pete
[1] https://github.com/pbatard/efifs
[2]
https://en.wikipedia.org/wiki/Escape_sequences_in_C#Non-standard_escape_sequences
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel