From ff7c0e0e83c7532f9d7768725a3fe655c6f97c03 Mon Sep 17 00:00:00 2001 From: Andy Vandijck Date: Fri, 28 Jul 2017 17:07:41 +0100 Subject: [PATCH] Add EDK2 build support [EXPERIMENTAL] * As per http://www.insanelymac.com/forum/topic/300222-updated-efi-filesystem-drivers-efifs-ported-to-edk2/: I've decided to port the efifs drivers to EDK2 fully (instead of good old GNU EFI) because I wanted a lot more filesystems supported under UEFI. I've now ported them all (all drivers from GRUB). This means there is a total of 36 FS drivers (newly) available. I've upgraded the routines so they support also BlockIo2 and DIskIo2 protocol from UEFI 2.3.1 if they are available. I also extended the SimpleFIleSystem interface to support the extended (OpenEx, ReadEx, WriteEx, FlushEx) functions. --- 0000-GRUB-add-F2FS-support.patch | 6 +- 0001-GRUB-fixes-for-VS-Clang.patch | 8 +- 0002-GRUB-fixes-for-VS-MSVC.patch | 59 ++++++++------ 0003-GRUB-fixes-for-VS-EDK2.patch | 120 +++++++++++++++++++++++++++++ EfiFsPkg.dec | 21 +++++ EfiFsPkg.dsc | 100 ++++++++++++++++++++++++ EfiFsPkg.uni | 9 +++ EfiFsPkg/Affs.inf | 73 ++++++++++++++++++ EfiFsPkg/Afs.inf | 73 ++++++++++++++++++ EfiFsPkg/Bfs.inf | 73 ++++++++++++++++++ EfiFsPkg/Btrfs.inf | 78 +++++++++++++++++++ EfiFsPkg/Cbfs.inf | 75 ++++++++++++++++++ EfiFsPkg/Cpio.inf | 74 ++++++++++++++++++ EfiFsPkg/CpioBe.inf | 74 ++++++++++++++++++ EfiFsPkg/ExFat.inf | 73 ++++++++++++++++++ EfiFsPkg/Ext2.inf | 73 ++++++++++++++++++ EfiFsPkg/F2fs.inf | 73 ++++++++++++++++++ EfiFsPkg/Fat.inf | 73 ++++++++++++++++++ EfiFsPkg/Hfs.inf | 73 ++++++++++++++++++ EfiFsPkg/HfsPlus.inf | 77 ++++++++++++++++++ EfiFsPkg/Iso9660.inf | 73 ++++++++++++++++++ EfiFsPkg/Jfs.inf | 73 ++++++++++++++++++ EfiFsPkg/Minix.inf | 74 ++++++++++++++++++ EfiFsPkg/Minix2.inf | 74 ++++++++++++++++++ EfiFsPkg/Minix2Be.inf | 74 ++++++++++++++++++ EfiFsPkg/Minix3.inf | 74 ++++++++++++++++++ EfiFsPkg/Minix3Be.inf | 74 ++++++++++++++++++ EfiFsPkg/MinixBe.inf | 74 ++++++++++++++++++ EfiFsPkg/NewC.inf | 74 ++++++++++++++++++ EfiFsPkg/NilFs2.inf | 73 ++++++++++++++++++ EfiFsPkg/Ntfs.inf | 76 ++++++++++++++++++ EfiFsPkg/Odc.inf | 74 ++++++++++++++++++ EfiFsPkg/ProcFs.inf | 74 ++++++++++++++++++ EfiFsPkg/ReiserFs.inf | 73 ++++++++++++++++++ EfiFsPkg/RomFs.inf | 73 ++++++++++++++++++ EfiFsPkg/Sfs.inf | 73 ++++++++++++++++++ EfiFsPkg/SquashFs.inf | 84 ++++++++++++++++++++ EfiFsPkg/Tar.inf | 74 ++++++++++++++++++ EfiFsPkg/Udf.inf | 74 ++++++++++++++++++ EfiFsPkg/Ufs.inf | 74 ++++++++++++++++++ EfiFsPkg/Ufs2.inf | 74 ++++++++++++++++++ EfiFsPkg/UfsBe.inf | 74 ++++++++++++++++++ EfiFsPkg/Xfs.inf | 74 ++++++++++++++++++ EfiFsPkg/Zfs.inf | 83 ++++++++++++++++++++ EfiFsPkgExtra.uni | 10 +++ src/driver.c | 29 +++---- src/driver.h | 83 ++++++++++++++++++-- src/file.c | 43 ++++++----- src/grub.c | 21 ++--- src/grub_file.c | 57 +++++++++++--- src/logging.c | 29 +++---- src/missing.c | 61 +++++++++++++-- src/path.c | 3 - src/this.c | 5 +- src/utf8.c | 4 +- 55 files changed, 3300 insertions(+), 121 deletions(-) create mode 100644 0003-GRUB-fixes-for-VS-EDK2.patch create mode 100644 EfiFsPkg.dec create mode 100644 EfiFsPkg.dsc create mode 100644 EfiFsPkg.uni create mode 100644 EfiFsPkg/Affs.inf create mode 100644 EfiFsPkg/Afs.inf create mode 100644 EfiFsPkg/Bfs.inf create mode 100644 EfiFsPkg/Btrfs.inf create mode 100644 EfiFsPkg/Cbfs.inf create mode 100644 EfiFsPkg/Cpio.inf create mode 100644 EfiFsPkg/CpioBe.inf create mode 100644 EfiFsPkg/ExFat.inf create mode 100644 EfiFsPkg/Ext2.inf create mode 100644 EfiFsPkg/F2fs.inf create mode 100644 EfiFsPkg/Fat.inf create mode 100644 EfiFsPkg/Hfs.inf create mode 100644 EfiFsPkg/HfsPlus.inf create mode 100644 EfiFsPkg/Iso9660.inf create mode 100644 EfiFsPkg/Jfs.inf create mode 100644 EfiFsPkg/Minix.inf create mode 100644 EfiFsPkg/Minix2.inf create mode 100644 EfiFsPkg/Minix2Be.inf create mode 100644 EfiFsPkg/Minix3.inf create mode 100644 EfiFsPkg/Minix3Be.inf create mode 100644 EfiFsPkg/MinixBe.inf create mode 100644 EfiFsPkg/NewC.inf create mode 100644 EfiFsPkg/NilFs2.inf create mode 100644 EfiFsPkg/Ntfs.inf create mode 100644 EfiFsPkg/Odc.inf create mode 100644 EfiFsPkg/ProcFs.inf create mode 100644 EfiFsPkg/ReiserFs.inf create mode 100644 EfiFsPkg/RomFs.inf create mode 100644 EfiFsPkg/Sfs.inf create mode 100644 EfiFsPkg/SquashFs.inf create mode 100644 EfiFsPkg/Tar.inf create mode 100644 EfiFsPkg/Udf.inf create mode 100644 EfiFsPkg/Ufs.inf create mode 100644 EfiFsPkg/Ufs2.inf create mode 100644 EfiFsPkg/UfsBe.inf create mode 100644 EfiFsPkg/Xfs.inf create mode 100644 EfiFsPkg/Zfs.inf create mode 100644 EfiFsPkgExtra.uni diff --git a/0000-GRUB-add-F2FS-support.patch b/0000-GRUB-add-F2FS-support.patch index a2f2a5b..dac9d67 100644 --- a/0000-GRUB-add-F2FS-support.patch +++ b/0000-GRUB-add-F2FS-support.patch @@ -1,7 +1,7 @@ -From d9e9f44f0c043688cbf476634e8e39c768517e28 Mon Sep 17 00:00:00 2001 +From 24863a4de9b40fc00a8f3c51cd08fde78ce1cb3a Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 14 Aug 2016 19:22:13 +0200 -Subject: [PATCH] Add F2FS support +Subject: [PATCH 1/4] Add F2FS support * Taken from https://github.com/efidroid/uefi_edk2packages_GrubFSPkg --- @@ -1305,5 +1305,5 @@ index 0000000..7fb256f + grub_fs_unregister (&grub_f2fs_fs); +} -- -2.8.1.windows.1 +2.9.3.windows.2 diff --git a/0001-GRUB-fixes-for-VS-Clang.patch b/0001-GRUB-fixes-for-VS-Clang.patch index 2792a0e..ee91cb0 100644 --- a/0001-GRUB-fixes-for-VS-Clang.patch +++ b/0001-GRUB-fixes-for-VS-Clang.patch @@ -1,7 +1,7 @@ -From bf6591faa32cf00aefb80180952dafa1c921c21f Mon Sep 17 00:00:00 2001 +From d05789f5d54ed27069f1c54a1697a8ae28527134 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 13 Jul 2016 14:19:14 +0100 -Subject: [PATCH 1/2] Clang/C2 compatibility fixes +Subject: [PATCH 2/4] Clang/C2 compatibility fixes --- grub-core/fs/affs.c | 4 ++-- @@ -42,7 +42,7 @@ index 2f73449..053d1f7 100644 #else #define expect(expr, value) (expr) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index d1a54df..5bec00c 100644 +index 3b633d5..9024c10 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -138,7 +138,7 @@ grub_puts_ (const char *s) @@ -118,5 +118,5 @@ index 0bbdc6d..866b345 100644 #else #define GRUB_TARGET_SIZEOF_LONG 8 -- -2.8.1.windows.1 +2.9.3.windows.2 diff --git a/0002-GRUB-fixes-for-VS-MSVC.patch b/0002-GRUB-fixes-for-VS-MSVC.patch index 7a82cda..eccbb2e 100644 --- a/0002-GRUB-fixes-for-VS-MSVC.patch +++ b/0002-GRUB-fixes-for-VS-MSVC.patch @@ -1,8 +1,8 @@ -From 6848bbc5d6bb52448d2998cb3f3357de7273d255 Mon Sep 17 00:00:00 2001 +From da61392469c17c75021380581cf84db47e18c584 Mon Sep 17 00:00:00 2001 From: Pete Batard -Date: Sun, 14 Aug 2016 14:59:37 +0200 -Subject: [PATCH] MSVC compatibility fixes, for packed structs, initialization, - etc +Date: Fri, 28 Jul 2017 12:54:37 +0100 +Subject: [PATCH 3/4] MSVC compatibility fixes, for packed structs, + initialization, etc --- grub-core/fs/affs.c | 2 ++ @@ -16,7 +16,7 @@ Subject: [PATCH] MSVC compatibility fixes, for packed structs, initialization, grub-core/fs/jfs.c | 2 ++ grub-core/fs/nilfs2.c | 2 ++ grub-core/fs/ntfs.c | 2 ++ - grub-core/fs/reiserfs.c | 7 +++++++ + grub-core/fs/reiserfs.c | 16 +++++++++++++++- grub-core/fs/sfs.c | 4 +++- grub-core/fs/udf.c | 2 ++ grub-core/fs/ufs.c | 2 ++ @@ -26,16 +26,16 @@ Subject: [PATCH] MSVC compatibility fixes, for packed structs, initialization, include/grub/btrfs.h | 3 +++ include/grub/hfs.h | 2 ++ include/grub/hfsplus.h | 6 ++++++ - include/grub/misc.h | 8 ++++++++ + include/grub/misc.h | 10 ++++++++++ include/grub/ntfs.h | 2 ++ include/grub/term.h | 4 ++-- include/grub/types.h | 36 +++++++++++++++++++++++++----------- include/grub/zfs/zap_leaf.h | 17 ++++++++++++++--- include/grub/zfs/zio.h | 2 ++ - 27 files changed, 147 insertions(+), 38 deletions(-) + 27 files changed, 157 insertions(+), 39 deletions(-) diff --git a/grub-core/fs/affs.c b/grub-core/fs/affs.c -index 25f8e68..38b7afd 100644 +index 8580d81..26e4a33 100644 --- a/grub-core/fs/affs.c +++ b/grub-core/fs/affs.c @@ -30,6 +30,7 @@ @@ -75,7 +75,7 @@ index d2b490b..8d78fd6 100644 struct grub_bfs_data { diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 9cffa91..c9617a0 100644 +index 4849c1c..de1f023 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -48,6 +48,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -154,7 +154,7 @@ index 9cffa91..c9617a0 100644 stripen *= nsubstripes; redundancy = nsubstripes; diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c -index 635c2c4..8f589f2 100644 +index 8d8dc35..f3b5717 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -75,6 +75,7 @@ enum @@ -189,7 +189,7 @@ index 635c2c4..8f589f2 100644 typedef struct grub_fat_dir_entry grub_fat_dir_node_t; -@@ -722,7 +726,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, +@@ -726,7 +730,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, grub_dprintf ("exfat", "unknown primary type 0x%02x\n", dir.entry_type); } @@ -198,7 +198,7 @@ index 635c2c4..8f589f2 100644 } #else -@@ -849,7 +853,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, +@@ -853,7 +857,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, return GRUB_ERR_NONE; } @@ -490,29 +490,39 @@ index 6f84688..4fa140e 100644 static char * grub_ntfs_read_symlink (grub_fshelp_node_t node) diff --git a/grub-core/fs/reiserfs.c b/grub-core/fs/reiserfs.c -index 39736f6..b14de19 100644 +index 39736f6..c3c65f2 100644 --- a/grub-core/fs/reiserfs.c +++ b/grub-core/fs/reiserfs.c -@@ -42,6 +42,7 @@ +@@ -42,15 +42,27 @@ GRUB_MOD_LICENSE ("GPLv3+"); +#ifndef _MSC_VER ++#ifndef MIN #define MIN(a, b) \ ({ typeof (a) _a = (a); \ typeof (b) _b = (b); \ -@@ -51,6 +52,10 @@ GRUB_MOD_LICENSE ("GPLv3+"); + _a < _b ? _a : _b; }) +- ++#endif ++#ifndef MAX + #define MAX(a, b) \ ({ typeof (a) _a = (a); \ typeof (b) _b = (b); \ _a > _b ? _a : _b; }) ++#endif +#else ++#ifndef MIN +#define MIN(a, b) ((a)<(b)?(a):(b)) ++#endif ++#ifndef MAX +#define MAX(a, b) ((a)>(b)?(a):(b)) ++#endif +#endif #define REISERFS_SUPER_BLOCK_OFFSET 0x10000 #define REISERFS_MAGIC_LEN 12 -@@ -82,6 +87,7 @@ enum grub_reiserfs_item_type +@@ -82,6 +94,7 @@ enum grub_reiserfs_item_type GRUB_REISERFS_UNKNOWN }; @@ -520,7 +530,7 @@ index 39736f6..b14de19 100644 struct grub_reiserfs_superblock { grub_uint32_t block_count; -@@ -217,6 +223,7 @@ struct grub_reiserfs_directory_header +@@ -217,6 +230,7 @@ struct grub_reiserfs_directory_header grub_uint16_t location; grub_uint16_t state; } GRUB_PACKED; @@ -643,10 +653,10 @@ index 6e1fff9..b1589a0 100644 { diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index f0af232..218d9a5 100644 +index 9024c10..498ec83 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c -@@ -968,7 +968,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, +@@ -969,7 +969,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, { grub_size_t len = 0; grub_size_t fill; @@ -754,10 +764,10 @@ index 117740a..5a8caf5 100644 /* Return the offset of the record with the index INDEX, in the node NODE which is part of the B+ tree BTREE. */ diff --git a/include/grub/misc.h b/include/grub/misc.h -index 2a9f87c..bc6fbec 100644 +index 2a9f87c..e353dcd 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h -@@ -27,11 +27,19 @@ +@@ -27,12 +27,22 @@ #include #include @@ -774,9 +784,12 @@ index 2a9f87c..bc6fbec 100644 +#define ALIGN_DOWN(addr, align) \ + ((addr) & ~(align - 1)) +#endif ++#ifndef ARRAY_SIZE #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) ++#endif #define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; } + #define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__) diff --git a/include/grub/ntfs.h b/include/grub/ntfs.h index d1a6af6..203e014 100644 --- a/include/grub/ntfs.h @@ -817,7 +830,7 @@ index 5ffb38f..cc6d92a 100644 static inline struct grub_term_coordinate diff --git a/include/grub/types.h b/include/grub/types.h -index bb8a711..5b44fea 100644 +index afcda13..3c9565a 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -26,10 +26,20 @@ @@ -951,5 +964,5 @@ index 19ce136..11ee51b 100644 /* * Gang block headers are self-checksumming and contain an array -- -2.8.1.windows.1 +2.9.3.windows.2 diff --git a/0003-GRUB-fixes-for-VS-EDK2.patch b/0003-GRUB-fixes-for-VS-EDK2.patch new file mode 100644 index 0000000..4822ed1 --- /dev/null +++ b/0003-GRUB-fixes-for-VS-EDK2.patch @@ -0,0 +1,120 @@ +From 846131b962c85048acffcd4f14f96a2d192f11f5 Mon Sep 17 00:00:00 2001 +From: Pete Batard +Date: Fri, 28 Jul 2017 16:56:39 +0100 +Subject: [PATCH 4/4] EDK2 Compatibility fixes + +--- + grub-core/fs/zfs/zfs_lz4.c | 1 - + grub-core/io/gzio.c | 40 ++++++++++++++++++++-------------------- + grub-core/lib/crypto.c | 4 ++-- + 3 files changed, 22 insertions(+), 23 deletions(-) + +diff --git a/grub-core/fs/zfs/zfs_lz4.c b/grub-core/fs/zfs/zfs_lz4.c +index 053d1f7..c20cf5f 100644 +--- a/grub-core/fs/zfs/zfs_lz4.c ++++ b/grub-core/fs/zfs/zfs_lz4.c +@@ -73,7 +73,6 @@ static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, + #define U32 grub_uint32_t + #define S32 grub_int32_t + #define U64 grub_uint64_t +-typedef grub_size_t size_t; + + typedef struct _U16_S { + U16 v; +diff --git a/grub-core/io/gzio.c b/grub-core/io/gzio.c +index 0f2ea6b..150e250 100644 +--- a/grub-core/io/gzio.c ++++ b/grub-core/io/gzio.c +@@ -140,24 +140,24 @@ eat_field (grub_file_t file, int len) + #define OLD_GZIP_MAGIC grub_le_to_cpu16 (0x9E1F) + + /* Compression methods (see algorithm.doc) */ +-#define STORED 0 +-#define COMPRESSED 1 +-#define PACKED 2 +-#define LZHED 3 ++#define GZ_STORED 0 ++#define GZ_COMPRESSED 1 ++#define GZ_PACKED 2 ++#define GZ_LZHED 3 + /* methods 4 to 7 reserved */ +-#define DEFLATED 8 +-#define MAX_METHODS 9 ++#define GZ_DEFLATED 8 ++#define GZ_MAX_METHODS 9 + + /* gzip flag byte */ +-#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +-#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */ +-#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ +-#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ +-#define COMMENT 0x10 /* bit 4 set: file comment present */ +-#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */ +-#define RESERVED 0xC0 /* bit 6,7: reserved */ ++#define GZ_ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ ++#define GZ_CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */ ++#define GZ_EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ ++#define GZ_ORIG_NAME 0x08 /* bit 3 set: original file name present */ ++#define GZ_COMMENT 0x10 /* bit 4 set: file comment present */ ++#define GZ_ENCRYPTED 0x20 /* bit 5 set: file is encrypted */ ++#define GZ_RESERVED 0xC0 /* bit 6,7: reserved */ + +-#define UNSUPPORTED_FLAGS (CONTINUATION | ENCRYPTED | RESERVED) ++#define GZ_UNSUPPORTED_FLAGS (GZ_CONTINUATION | GZ_ENCRYPTED | GZ_RESERVED) + + /* inflate block codes */ + #define INFLATE_STORED 0 +@@ -201,14 +201,14 @@ test_gzip_header (grub_file_t file) + * problem occurs from here on, then we have corrupt or otherwise + * bad data, and the error should be reported to the user. + */ +- if (hdr.method != DEFLATED +- || (hdr.flags & UNSUPPORTED_FLAGS) +- || ((hdr.flags & EXTRA_FIELD) ++ if (hdr.method != GZ_DEFLATED ++ || (hdr.flags & GZ_UNSUPPORTED_FLAGS) ++ || ((hdr.flags & GZ_EXTRA_FIELD) + && (grub_file_read (gzio->file, &extra_len, 2) != 2 + || eat_field (gzio->file, + grub_le_to_cpu16 (extra_len)))) +- || ((hdr.flags & ORIG_NAME) && eat_field (gzio->file, -1)) +- || ((hdr.flags & COMMENT) && eat_field (gzio->file, -1))) ++ || ((hdr.flags & GZ_ORIG_NAME) && eat_field (gzio->file, -1)) ++ || ((hdr.flags & GZ_COMMENT) && eat_field (gzio->file, -1))) + return 0; + + gzio->data_offset = grub_file_tell (gzio->file); +@@ -1183,7 +1183,7 @@ test_zlib_header (grub_gzio_t gzio) + flg = get_byte (gzio); + + /* Check that compression method is DEFLATE. */ +- if ((cmf & 0xf) != DEFLATED) ++ if ((cmf & 0xf) != GZ_DEFLATED) + { + /* TRANSLATORS: It's about given file having some strange format, not + complete lack of gzip support. */ +diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c +index 683a8aa..620d439 100644 +--- a/grub-core/lib/crypto.c ++++ b/grub-core/lib/crypto.c +@@ -462,7 +462,7 @@ grub_password_get (char buf[], unsigned buf_size) + if (key == '\n' || key == '\r') + break; + +- if (key == '\e') ++ if (key == 0x1B) + { + cur_len = 0; + break; +@@ -487,7 +487,7 @@ grub_password_get (char buf[], unsigned buf_size) + grub_xputs ("\n"); + grub_refresh (); + +- return (key != '\e'); ++ return (key != 0x1B); + } + #endif + +-- +2.9.3.windows.2 + diff --git a/EfiFsPkg.dec b/EfiFsPkg.dec new file mode 100644 index 0000000..4b69608 --- /dev/null +++ b/EfiFsPkg.dec @@ -0,0 +1,21 @@ +## @file +# EfiFs Package +# +# Copyright (c) 2017, Pete Batard +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010005 + PACKAGE_NAME = EfiFsPkg + PACKAGE_UNI_FILE = EfiFsPkg.uni + PACKAGE_GUID = D65E40B8-BC4B-4625-9E5C-17C5726C39C3 + PACKAGE_VERSION = 1.1 + +[UserExtensions.TianoCore."ExtraFiles"] + EfiFsPkgExtra.uni + +[Includes] + grub/include + grub + grub/grub-core/lib/minilzo diff --git a/EfiFsPkg.dsc b/EfiFsPkg.dsc new file mode 100644 index 0000000..dd17e7b --- /dev/null +++ b/EfiFsPkg.dsc @@ -0,0 +1,100 @@ +## @file +# EfiFs Driver Modules +# +# Copyright (c) 2017, Pete Batard +# +## + +[Defines] + PLATFORM_NAME = EfiFs + PLATFORM_GUID = 700d6096-1578-409e-a6c7-9acdf9f565b3 + PLATFORM_VERSION = 1.1 + DSC_SPECIFICATION = 0x00010005 + SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64 + OUTPUT_DIRECTORY = Build/EfiFs + BUILD_TARGETS = DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER = DEFAULT + +[BuildOptions] + GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + INTEL:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + MSFT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + *_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES + +[LibraryClasses] + # + # Entry Point Libraries + # + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + # + # Common Libraries + # + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + +[LibraryClasses.common.PEIM] + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + +[LibraryClasses.ARM, LibraryClasses.AARCH64] + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf + +################################################################################################### +# +# Components Section - list of the modules and components that will be processed by compilation +# tools and the EDK II tools to generate PE32/PE32+/Coff image files. +# +################################################################################################### + +[Components] + EfiFsPkg/EfiFsPkg/Afs.inf + EfiFsPkg/EfiFsPkg/Affs.inf + EfiFsPkg/EfiFsPkg/Bfs.inf + EfiFsPkg/EfiFsPkg/Btrfs.inf + EfiFsPkg/EfiFsPkg/Cbfs.inf + EfiFsPkg/EfiFsPkg/Cpio.inf + EfiFsPkg/EfiFsPkg/CpioBe.inf + EfiFsPkg/EfiFsPkg/Ext2.inf + EfiFsPkg/EfiFsPkg/ExFat.inf + EfiFsPkg/EfiFsPkg/F2fs.inf + EfiFsPkg/EfiFsPkg/Fat.inf + EfiFsPkg/EfiFsPkg/Hfs.inf + EfiFsPkg/EfiFsPkg/HfsPlus.inf + EfiFsPkg/EfiFsPkg/Iso9660.inf + EfiFsPkg/EfiFsPkg/Jfs.inf + EfiFsPkg/EfiFsPkg/Minix.inf + EfiFsPkg/EfiFsPkg/MinixBe.inf + EfiFsPkg/EfiFsPkg/Minix2.inf + EfiFsPkg/EfiFsPkg/Minix2Be.inf + EfiFsPkg/EfiFsPkg/Minix3.inf + EfiFsPkg/EfiFsPkg/Minix3Be.inf + EfiFsPkg/EfiFsPkg/NewC.inf + EfiFsPkg/EfiFsPkg/NilFs2.inf + EfiFsPkg/EfiFsPkg/Ntfs.inf + EfiFsPkg/EfiFsPkg/Odc.inf + EfiFsPkg/EfiFsPkg/ProcFs.inf + EfiFsPkg/EfiFsPkg/ReiserFs.inf + EfiFsPkg/EfiFsPkg/RomFs.inf + EfiFsPkg/EfiFsPkg/Sfs.inf +# EfiFsPkg/EfiFsPkg/SquashFs.inf + EfiFsPkg/EfiFsPkg/Tar.inf + EfiFsPkg/EfiFsPkg/Udf.inf + EfiFsPkg/EfiFsPkg/Ufs.inf + EfiFsPkg/EfiFsPkg/UfsBe.inf + EfiFsPkg/EfiFsPkg/Ufs2.inf + EfiFsPkg/EfiFsPkg/Xfs.inf + EfiFsPkg/EfiFsPkg/Zfs.inf \ No newline at end of file diff --git a/EfiFsPkg.uni b/EfiFsPkg.uni new file mode 100644 index 0000000..4154aed --- /dev/null +++ b/EfiFsPkg.uni @@ -0,0 +1,9 @@ +// /** @file +// Module implementations for EfiFs +// +// Copyright (c) 2017, Pete Batard +// +// **/ + +#string STR_PACKAGE_ABSTRACT #language en-US "Module implementations for EfiFs" +#string STR_PACKAGE_DESCRIPTION #language en-US "This Package contains the module implementation of EfiFs." diff --git a/EfiFsPkg/Affs.inf b/EfiFsPkg/Affs.inf new file mode 100644 index 0000000..af787ab --- /dev/null +++ b/EfiFsPkg/Affs.inf @@ -0,0 +1,73 @@ +## @file +# +# Affs - EfiFs Amiga Fast FileSystem driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = affs + FILE_GUID = BD873114-A318-48C4-AEF9-6C9E43A50FFA + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/affs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Amiga FFS\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Afs.inf b/EfiFsPkg/Afs.inf new file mode 100644 index 0000000..a02df8c --- /dev/null +++ b/EfiFsPkg/Afs.inf @@ -0,0 +1,73 @@ +## @file +# +# Afs - EfiFs Andrew File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = afs + FILE_GUID = DEFE2F9E-38C4-4278-AB7D-3BCC7B3C9292 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/afs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"AFS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Bfs.inf b/EfiFsPkg/Bfs.inf new file mode 100644 index 0000000..2bad973 --- /dev/null +++ b/EfiFsPkg/Bfs.inf @@ -0,0 +1,73 @@ +## @file +# +# Bfs - EfiFs BeOS File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = bfs + FILE_GUID = 7686EACB-461E-417F-BB6B-0C5DBA8B4087 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/bfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"BFS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 \ No newline at end of file diff --git a/EfiFsPkg/Btrfs.inf b/EfiFsPkg/Btrfs.inf new file mode 100644 index 0000000..ea3aded --- /dev/null +++ b/EfiFsPkg/Btrfs.inf @@ -0,0 +1,78 @@ +## @file +# +# Btrfs - EfiFs B-tree File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = btrfs + FILE_GUID = E4FD4F23-5515-434C-9F19-59CA8B122825 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/lib/crc.c + ../grub/grub-core/lib/minilzo/minilzo.c + ../grub/grub-core/io/lzopio.c + ../grub/grub-core/io/gzio.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/btrfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"Btrfs\" + *_*_*_CC_FLAGS = -DEXTRAMODULE=gzio + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Cbfs.inf b/EfiFsPkg/Cbfs.inf new file mode 100644 index 0000000..5f37825 --- /dev/null +++ b/EfiFsPkg/Cbfs.inf @@ -0,0 +1,75 @@ +## @file +# +# Cbfs - EfiFs Callback File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = cbfs + FILE_GUID = DEEC0FF0-64AE-4B2D-A9D1-87057258854C + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources.common] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/io/gzio.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/archelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/cbfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"CBFS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Cpio.inf b/EfiFsPkg/Cpio.inf new file mode 100644 index 0000000..ca976ff --- /dev/null +++ b/EfiFsPkg/Cpio.inf @@ -0,0 +1,74 @@ +## @file +# +# Cpio - EfiFs cpio File System driver (Little Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = cpio + FILE_GUID = FE902772-06CD-40E4-B35B-0E760C5E9C1A + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/archelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/cpio.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (LE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/CpioBe.inf b/EfiFsPkg/CpioBe.inf new file mode 100644 index 0000000..dc5ae4e --- /dev/null +++ b/EfiFsPkg/CpioBe.inf @@ -0,0 +1,74 @@ +## @file +# +# CpioBe - EfiFs cpio File System driver (Big Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = cpio_be + FILE_GUID = A3853AE0-E77D-405E-8A75-16333DE1632C + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/archelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/cpio_be.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (BE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/ExFat.inf b/EfiFsPkg/ExFat.inf new file mode 100644 index 0000000..579b7aa --- /dev/null +++ b/EfiFsPkg/ExFat.inf @@ -0,0 +1,73 @@ +## @file +# +# ExFat - EfiFs ExFAT File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = exfat + FILE_GUID = 2920E524-AD21-499E-9F4A-466BFDC3BFFB + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/exfat.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ExFAT\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ext2.inf b/EfiFsPkg/Ext2.inf new file mode 100644 index 0000000..0031b42 --- /dev/null +++ b/EfiFsPkg/Ext2.inf @@ -0,0 +1,73 @@ +## @file +# +# Ext2 - EfiFs ext2/ext3/ext4 File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = ext2 + FILE_GUID = 7DDA7772-B8F5-4859-9DBA-0D6F2DBA4AF1 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/ext2.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ext2/3/4\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/F2fs.inf b/EfiFsPkg/F2fs.inf new file mode 100644 index 0000000..e6f8d71 --- /dev/null +++ b/EfiFsPkg/F2fs.inf @@ -0,0 +1,73 @@ +## @file +# +# F2FS - EfiFs F2FS driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = f2fs + FILE_GUID = 3D1F4906-3509-4DD4-8850-70033DE336E4 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/f2fs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"F2FS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Fat.inf b/EfiFsPkg/Fat.inf new file mode 100644 index 0000000..0c78cd2 --- /dev/null +++ b/EfiFsPkg/Fat.inf @@ -0,0 +1,73 @@ +## @file +# +# Fat - EfiFs FAT File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = fat + FILE_GUID = B9E0C839-BF75-4889-82FF-214BED41BA47 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/fat.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ExFAT\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Hfs.inf b/EfiFsPkg/Hfs.inf new file mode 100644 index 0000000..addbdc1 --- /dev/null +++ b/EfiFsPkg/Hfs.inf @@ -0,0 +1,73 @@ +## @file +# +# Hfs - EfiFs Hierarchical File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = hfs + FILE_GUID = BB57B5D8-F6DE-481C-9B08-C779B0F33E25 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/hfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"HFS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/HfsPlus.inf b/EfiFsPkg/HfsPlus.inf new file mode 100644 index 0000000..65584b8 --- /dev/null +++ b/EfiFsPkg/HfsPlus.inf @@ -0,0 +1,77 @@ +## @file +# +# HfsPlus - Hierarchical File System "Plus" driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = hfsplus + FILE_GUID = EE593365-0635-44FC-AF28-DB98B63FDBC6 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/io/gzio.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/hfsplus.c + ../grub/grub-core/fs/hfspluscomp.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"HFS+\" + # HFS+ has a compressed driver + *_*_*_CC_FLAGS = -DCOMPRESSED_DRIVERNAME=$(BASE_NAME)comp -DEXTRAMODULE=gzio + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Iso9660.inf b/EfiFsPkg/Iso9660.inf new file mode 100644 index 0000000..7c389ba --- /dev/null +++ b/EfiFsPkg/Iso9660.inf @@ -0,0 +1,73 @@ +## @file +# +# Iso9660 - EfiFs ISO9660 File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = iso9660 + FILE_GUID = EFBE987A-A33B-4EE4-B2B5-35DEDC28A5E9 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/iso9660.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ISO9660\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Jfs.inf b/EfiFsPkg/Jfs.inf new file mode 100644 index 0000000..a3994d3 --- /dev/null +++ b/EfiFsPkg/Jfs.inf @@ -0,0 +1,73 @@ +## @file +# +# JFS - EfiFs Journaled File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = jfs + FILE_GUID = E87CF4E3-318E-4B5F-98B9-A6B47414506D + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/jfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"JFS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix.inf b/EfiFsPkg/Minix.inf new file mode 100644 index 0000000..8d95be0 --- /dev/null +++ b/EfiFsPkg/Minix.inf @@ -0,0 +1,74 @@ +## @file +# +# Minix - EfiFs MINIX File System driver (Little Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = minix + FILE_GUID = 16CE8469-1586-4CE0-B90C-88D049A2967B + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/minix.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix (LE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix2.inf b/EfiFsPkg/Minix2.inf new file mode 100644 index 0000000..951cb20 --- /dev/null +++ b/EfiFsPkg/Minix2.inf @@ -0,0 +1,74 @@ +## @file +# +# Minix2 - EfiFs MINIX 2 File System driver (Little Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = minix2 + FILE_GUID = 0AF860D2-4089-496A-AB51-2F28730E5CF6 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/minix2.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix2 (LE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix2Be.inf b/EfiFsPkg/Minix2Be.inf new file mode 100644 index 0000000..bf0a953 --- /dev/null +++ b/EfiFsPkg/Minix2Be.inf @@ -0,0 +1,74 @@ +## @file +# +# Minix2Be - EfiFs MINIX 2 File System driver (Big Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = minix2_be + FILE_GUID = 0974F29A-42B5-4B32-A9E6-7BB42BE57B84 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/minix2_be.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix2 (BE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix3.inf b/EfiFsPkg/Minix3.inf new file mode 100644 index 0000000..6685a07 --- /dev/null +++ b/EfiFsPkg/Minix3.inf @@ -0,0 +1,74 @@ +## @file +# +# Minix3 - EfiFs MINIX 3 File System driver (Little Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = minix3 + FILE_GUID = 8DE9E73E-B120-49AA-960B-FC18FCEAAB3A + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/minix3.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix3 (LE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Minix3Be.inf b/EfiFsPkg/Minix3Be.inf new file mode 100644 index 0000000..0db0a0b --- /dev/null +++ b/EfiFsPkg/Minix3Be.inf @@ -0,0 +1,74 @@ +## @file +# +# Minix3Be - EfiFs MINIX 3 File System driver (Big Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = minix3_be + FILE_GUID = 9C3DB9FC-7B1A-4534-B5B9-C21E56EE7BA6 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/minix3_be.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix3 (BE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/MinixBe.inf b/EfiFsPkg/MinixBe.inf new file mode 100644 index 0000000..d3c2634 --- /dev/null +++ b/EfiFsPkg/MinixBe.inf @@ -0,0 +1,74 @@ +## @file +# +# MinixBe - EfiFs MINIX File System driver (Big Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = minix_be + FILE_GUID = 5B677870-CF38-4892-AF77-AA5C9695DFBB + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/minix_be.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Minix (BE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/NewC.inf b/EfiFsPkg/NewC.inf new file mode 100644 index 0000000..28f2915 --- /dev/null +++ b/EfiFsPkg/NewC.inf @@ -0,0 +1,74 @@ +## @file +# +# NewC - EfiFs cpio (newc) File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = newc + FILE_GUID = 5C0F70A7-DC33-4A82-9056-924E83E33F01 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources.common] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/archelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/newc.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (newc)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/NilFs2.inf b/EfiFsPkg/NilFs2.inf new file mode 100644 index 0000000..077864c --- /dev/null +++ b/EfiFsPkg/NilFs2.inf @@ -0,0 +1,73 @@ +## @file +# +# NilFS2 - EfiFs NILFS2 driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = nilfs2 + FILE_GUID = E6BCED0B-96E0-4BD7-AF96-65467ABAAC6E + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/nilfs2.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"NILFS2\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ntfs.inf b/EfiFsPkg/Ntfs.inf new file mode 100644 index 0000000..dabdb69 --- /dev/null +++ b/EfiFsPkg/Ntfs.inf @@ -0,0 +1,76 @@ +## @file +# +# Ntfs - EfiFs NTFS driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = ntfs + FILE_GUID = 80FB68D4-7C52-4AFE-A91E-D3DDADB5C54F + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/ntfs.c + ../grub/grub-core/fs/ntfscomp.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"NTFS\" + # NTFS has a compressed driver + *_*_*_CC_FLAGS = -DCOMPRESSED_DRIVERNAME=$(BASE_NAME)comp + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Odc.inf b/EfiFsPkg/Odc.inf new file mode 100644 index 0000000..9bccbd9 --- /dev/null +++ b/EfiFsPkg/Odc.inf @@ -0,0 +1,74 @@ +## @file +# +# Odc - EfiFs cpio (odc) File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = odc + FILE_GUID = FC117DCB-B369-46B7-A84E-E34EF821756C + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources.common] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/archelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/odc.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"cpio (odc)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/ProcFs.inf b/EfiFsPkg/ProcFs.inf new file mode 100644 index 0000000..3f9b187 --- /dev/null +++ b/EfiFsPkg/ProcFs.inf @@ -0,0 +1,74 @@ +## @file +# +# ProcFs - EfiFs procfs driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = procfs + FILE_GUID = 4F59B6B8-8FED-41B4-A970-CCBAF0F684DF + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/archelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/proc.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"procfs\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/ReiserFs.inf b/EfiFsPkg/ReiserFs.inf new file mode 100644 index 0000000..1b26153 --- /dev/null +++ b/EfiFsPkg/ReiserFs.inf @@ -0,0 +1,73 @@ +## @file +# +# ReiserFs - EfiFs Reiser File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = reiserfs + FILE_GUID = 8B20B75F-5AAB-4839-A5F2-2843653BDEFF + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/reiserfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ReiserFS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/RomFs.inf b/EfiFsPkg/RomFs.inf new file mode 100644 index 0000000..b28e8e9 --- /dev/null +++ b/EfiFsPkg/RomFs.inf @@ -0,0 +1,73 @@ +## @file +# +# RomFs - EfiFs ROM File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = romfs + FILE_GUID = A57C00D8-2766-4DDF-AC8D-BAC89472F255 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/romfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"romfs\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Sfs.inf b/EfiFsPkg/Sfs.inf new file mode 100644 index 0000000..85cee49 --- /dev/null +++ b/EfiFsPkg/Sfs.inf @@ -0,0 +1,73 @@ +## @file +# +# AFFS - EfiFs Amiga SFS driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = sfs + FILE_GUID = 0093FDD4-86D8-457C-82C9-2832321BB8B5 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/sfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"Amiga SFS\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/SquashFs.inf b/EfiFsPkg/SquashFs.inf new file mode 100644 index 0000000..d9f3816 --- /dev/null +++ b/EfiFsPkg/SquashFs.inf @@ -0,0 +1,84 @@ +## @file +# +# SquashFs - EfiFs Squash File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = squash4 + FILE_GUID = F85516B3-FEAD-4D5B-9E4A-9A476ABA65CA + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/lib/crc.c + ../grub/grub-core/lib/crypto.c + ../grub/grub-core/lib/xzembed/xz_dec_bcj.c + ../grub/grub-core/lib/xzembed/xz_dec_lzma2.c + ../grub/grub-core/lib/xzembed/xz_dec_stream.c + ../grub/grub-core/lib/minilzo/minilzo.c + ../grub/grub-core/io/gzio.c + ../grub/grub-core/io/lzopio.c + ../grub/grub-core/io/xzio.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/squash4.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"SquashFS\" + # SquashFS uses additional modules + *_*_*_CC_FLAGS = -DEXTRAMODULE=gzio -DEXTRAMODULE2=lzopio -DEXTRAMODULE3=xzio + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Tar.inf b/EfiFsPkg/Tar.inf new file mode 100644 index 0000000..f984f2c --- /dev/null +++ b/EfiFsPkg/Tar.inf @@ -0,0 +1,74 @@ +## @file +# +# Tar - tar archive File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = tar + FILE_GUID = 5FA5BB28-C228-48BC-BEED-4137E56B5C32 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/archelp.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/tar.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"tar\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Udf.inf b/EfiFsPkg/Udf.inf new file mode 100644 index 0000000..df4ae79 --- /dev/null +++ b/EfiFsPkg/Udf.inf @@ -0,0 +1,74 @@ +## @file +# +# Udf - EfiFs Universal Disk Format File System driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = udf + FILE_GUID = 3E1C5997-2AED-4A6C-A8BF-07882633D1FB + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/udf.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"UDF\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ufs.inf b/EfiFsPkg/Ufs.inf new file mode 100644 index 0000000..d39e7b8 --- /dev/null +++ b/EfiFsPkg/Ufs.inf @@ -0,0 +1,74 @@ +## @file +# +# Ufs - EfiFs UFS driver (Little Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = ufs1 + FILE_GUID = CFC9DAEA-DBB4-4A5A-8034-D0ABF2849DF3 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/ufs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"UFS (LE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Ufs2.inf b/EfiFsPkg/Ufs2.inf new file mode 100644 index 0000000..8d9c9b5 --- /dev/null +++ b/EfiFsPkg/Ufs2.inf @@ -0,0 +1,74 @@ +## @file +# +# Ufs2 - EfiFs UFS2 driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = ufs2 + FILE_GUID = 15ED2F4C-1EB8-4B4F-826B-73D83EDAA449 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/ufs2.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"UFS2\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/UfsBe.inf b/EfiFsPkg/UfsBe.inf new file mode 100644 index 0000000..c3ac095 --- /dev/null +++ b/EfiFsPkg/UfsBe.inf @@ -0,0 +1,74 @@ +## @file +# +# UfsBe - EfiFs UFS driver (Big Endian). +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = ufs1_be + FILE_GUID = F3B03ADF-0595-483C-BF15-0C39A444345C + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/ufs_be.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR="\"UFS (BE)\"" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Xfs.inf b/EfiFsPkg/Xfs.inf new file mode 100644 index 0000000..809f9c3 --- /dev/null +++ b/EfiFsPkg/Xfs.inf @@ -0,0 +1,74 @@ +## @file +# +# Xfs - EfiFs XFS driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = xfs + FILE_GUID = 8F56A526-1566-442F-9D7F-3E704772B75A + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.1 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/xfs.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"XFS\" + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkg/Zfs.inf b/EfiFsPkg/Zfs.inf new file mode 100644 index 0000000..71fee10 --- /dev/null +++ b/EfiFsPkg/Zfs.inf @@ -0,0 +1,83 @@ +## @file +# +# Zfs - EfiFs ZFS driver. +# + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = zfs + FILE_GUID = 0F6A96E7-0F76-4947-90DB-D4FD7A7E6147 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.0 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + ENTRY_POINT = FSDriverInstall + +[Sources] + ../src/driver.c + ../src/file.c + ../src/grub.c + ../src/grub_file.c + ../src/logging.c + ../src/missing.c + ../src/this.c + ../src/path.c + ../src/utf8.c + ../grub/grub-core/io/gzio.c + ../grub/grub-core/lib/crypto.c + ../grub/grub-core/lib/pbkdf2.c + ../grub/grub-core/kern/err.c + ../grub/grub-core/kern/misc.c + ../grub/grub-core/kern/list.c + ../grub/grub-core/fs/fshelp.c + ../grub/grub-core/fs/zfs/zfs.c + ../grub/grub-core/fs/zfs/zfs_fletcher.c + ../grub/grub-core/fs/zfs/zfs_lz4.c + ../grub/grub-core/fs/zfs/zfs_lzjb.c + ../grub/grub-core/fs/zfs/zfs_sha256.c + ../grub/grub-core/fs/zfs/zfscrypt.c + +[Packages] + EfiFsPkg/EfiFsPkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + +[LibraryClasses] + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + UefiDriverEntryPoint + DebugLib + PcdLib + +[Guids] + gEfiFileInfoGuid + gEfiFileSystemInfoGuid + gEfiFileSystemVolumeLabelInfoIdGuid + +[Protocols] + gEfiDiskIoProtocolGuid + gEfiDiskIo2ProtocolGuid + gEfiBlockIoProtocolGuid + gEfiBlockIo2ProtocolGuid + gEfiSimpleFileSystemProtocolGuid + gEfiUnicodeCollationProtocolGuid + gEfiUnicodeCollation2ProtocolGuid + gEfiDevicePathToTextProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang + +[BuildOptions] + *_*_IA32_CC_FLAGS = -DFORMAT=efi-app-ia32 + *_*_X64_CC_FLAGS = -DFORMAT=efi-app-x64 + *_*_*_CC_FLAGS = -Os -DCPU_$(ARCH) -DGRUB_FILE=__FILE__ -DDRIVERNAME=$(BASE_NAME) -DDRIVERNAME_STR=\"ZFS\" + # ZFS has an extra module + *_*_*_CC_FLAGS = -DEXTRAMODULE=gzio + # On MSFT compilers, we must force-disable the default /GL option in order to replace the memset() intrinsic + MSFT:*_*_*_CC_FLAGS = /GL- /wd4028 /wd4068 /wd4133 /wd4146 /wd4201 /wd4204 /wd4244 /wd4245 /wd4267 /wd4311 /wd4312 /wd4334 /wd4706 diff --git a/EfiFsPkgExtra.uni b/EfiFsPkgExtra.uni new file mode 100644 index 0000000..370ae25 --- /dev/null +++ b/EfiFsPkgExtra.uni @@ -0,0 +1,10 @@ +// /** @file +// Module Localized content +// +// Copyright (c) 2017, Pete Batard +// +// **/ + +#string STR_PROPERTIES_PACKAGE_NAME +#language en-US +"EfiFs Package" diff --git a/src/driver.c b/src/driver.c index 78f1b1f..3def386 100644 --- a/src/driver.c +++ b/src/driver.c @@ -1,6 +1,6 @@ /* driver.c - Wrapper for standalone EFI filesystem drivers */ /* - * Copyright © 2014-2016 Pete Batard + * Copyright © 2014-2017 Pete Batard * Based on iPXE's efi_driver.c and efi_file.c: * Copyright © 2011,2013 Michael Brown . * @@ -18,9 +18,6 @@ * along with this program. If not, see . */ -#include -#include - #include "driver.h" /* We'll try to instantiate a custom protocol as a mutex, so we need a GUID */ @@ -115,9 +112,9 @@ FSBindingSupported(EFI_DRIVER_BINDING_PROTOCOL *This, * actually support, but not check if the target is valid or * initialize anything, so we must close all protocols we opened. */ - BS->CloseProtocol(ControllerHandle, &DiskIo2Protocol, + BS->CloseProtocol(ControllerHandle, &gEfiDiskIo2ProtocolGuid, This->DriverBindingHandle, ControllerHandle); - BS->CloseProtocol(ControllerHandle, &DiskIoProtocol, + BS->CloseProtocol(ControllerHandle, &gEfiDiskIoProtocolGuid, This->DriverBindingHandle, ControllerHandle); return EFI_SUCCESS; @@ -154,11 +151,14 @@ FSBindingStart(EFI_DRIVER_BINDING_PROTOCOL *This, } /* Prefer UEFI 2.0 conversion protocols if available */ - Status = BS->LocateProtocol(&DevicePathToTextProtocol, NULL, (VOID**) &DevicePathToText); + Instance->DevicePathString = NULL; + Status = BS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID**) &DevicePathToText); if (Status == EFI_SUCCESS) Instance->DevicePathString = DevicePathToText->ConvertDevicePathToText(DevicePath, FALSE, FALSE); +#if defined(_GNU_EFI) else Instance->DevicePathString = DevicePathToStr(DevicePath); +#endif if (Instance->DevicePathString == NULL) { Status = EFI_OUT_OF_RESOURCES; @@ -317,27 +317,28 @@ GetFSGuid(VOID) { INTN i, j, k, Len = StrLen(ShortDriverName); static EFI_GUID Guid = { 0xEF1F5EF1, 0xF17E, 0x5857, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; - CHAR16 *FsName = StrDuplicate(ShortDriverName); + CHAR16 c; const CHAR16 *PlusName = L"plus"; UINT8 Data4[12]; /* +4 so that we can also reduce something like "1234567plus" into "1234567+" */ - StrLwr(FsName); for (i = 0, j = 0, k = 0; j < ARRAYSIZE(Data4); i = (i+1)%Len, j++) { + c = ShortDriverName[i]; + if ((c >= L'A') && (c <= L'Z')) + c += L'a' - L'A'; /* Convert any 'plus' that is part of the name to '+' */ - if (FsName[i] == PlusName[k]) { + if (c == PlusName[k]) { if (++k == 4) { k = 0; j -= 3; Data4[j] = (UINT8) '+'; } else { - Data4[j] = (UINT8) FsName[i]; + Data4[j] = (UINT8) c; } } else { k = 0; - Data4[j] = (UINT8) FsName[i]; + Data4[j] = (UINT8) c; } } - FreePool(FsName); CopyMem(Guid.Data4, Data4, 8); return &Guid; @@ -409,7 +410,9 @@ FSDriverInstall(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable) VOID *Interface; UINTN i; +#if defined(_GNU_EFI) InitializeLib(ImageHandle, SystemTable); +#endif SetLogging(); EfiImageHandle = ImageHandle; diff --git a/src/driver.h b/src/driver.h index a70c907..fa0048b 100644 --- a/src/driver.h +++ b/src/driver.h @@ -1,6 +1,6 @@ /* fs_driver.h - Wrapper for standalone EFI filesystem drivers */ /* - * Copyright © 2014-2016 Pete Batard + * Copyright © 2014-2017 Pete Batard * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,45 @@ * along with this program. If not, see . */ +#if defined(__MAKEWITH_GNUEFI) #include -#include +#include +#include /* ASSERT */ +#else +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#endif #pragma once @@ -27,11 +64,33 @@ #endif /* Having GNU_EFI_USE_MS_ABI should avoid the need for that ugly uefi_call_wrapper */ -#if !defined(__MAKEWITH_GNUEFI) || !defined(GNU_EFI_USE_MS_ABI) +#if defined(_GNU_EFI) && !defined(GNU_EFI_USE_MS_ABI) #error gnu-efi, with option GNU_EFI_USE_MS_ABI, is required for the compilation of this driver. #endif #endif +/* Sort out the differences between EDK2 and gnu-efi */ +#if defined(_GNU_EFI) +#define STUPID_CLANG_REF(a,b) a.b +#define FORWARD_LINK_REF(list) STUPID_CLANG_REF(list,Flink) +#else +#define STUPID_CLANG_REF(a,b) a.b +#define FORWARD_LINK_REF(list) STUPID_CLANG_REF(list, ForwardLink) +#define Atoi (INTN)StrDecimalToUintn +#define APrint AsciiPrint +#define strlena AsciiStrLen +#define strcmpa AsciiStrCmp +#define BS gBS +#define RT gRT +#define ST gST +#define _CR BASE_CR +#define PROTO_NAME(x) gEfi ## x ## Guid +#define GUID_NAME(x) gEfi ## x ## Guid +#define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL +#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FILE_SYSTEM_VOLUME_LABEL +#define EFI_SIGNATURE_32(a,b,c,d) SIGNATURE_32(a,b,c,d) +#endif + /* Driver version */ #define FS_DRIVER_VERSION_MAJOR 1 #define FS_DRIVER_VERSION_MINOR 1 @@ -63,13 +122,25 @@ #define FS_LOGLEVEL_DEBUG 4 #define FS_LOGLEVEL_EXTRA 5 -typedef UINTN (*Print_t) (IN CHAR16 *fmt, ... ); +typedef UINTN (*Print_t) (IN CONST CHAR16 *fmt, ... ); extern Print_t PrintError; extern Print_t PrintWarning; extern Print_t PrintInfo; extern Print_t PrintDebug; extern Print_t PrintExtra; +/** + * Print an error message along with a human readable EFI status code + * + * @v Status EFI status code + * @v Format A non '\n' terminated error message string + * @v ... Any extra parameters + */ +#define PrintStatusError(Status, Format, ...) \ + if (LogLevel >= FS_LOGLEVEL_ERROR) { \ + Print(Format, ##__VA_ARGS__); PrintStatus(Status); } + + /* Forward declaration */ struct _EFI_FS; @@ -129,7 +200,7 @@ extern VOID strcpya(CHAR8 *dst, CONST CHAR8 *src); extern CHAR8 *strchra(const CHAR8 *s, INTN c); extern CHAR8 *strrchra(const CHAR8 *s, INTN c); extern VOID SetLogging(VOID); -extern VOID PrintStatusError(EFI_STATUS Status, const CHAR16 *Format, ...); +extern VOID PrintStatus(EFI_STATUS Status); extern VOID GrubDriverInit(VOID); extern VOID GrubDriverExit(VOID); extern CHAR16 *GrubGetUuid(EFI_FS *This); @@ -159,5 +230,7 @@ extern EFI_STATUS FSInstall(EFI_FS *This, EFI_HANDLE ControllerHandle); extern VOID FSUninstall(EFI_FS *This, EFI_HANDLE ControllerHandle); extern EFI_STATUS EFIAPI FileOpenVolume(EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, EFI_FILE_HANDLE *Root); +extern EFI_GUID *GetFSGuid(VOID); +extern EFI_STATUS PrintGuid (EFI_GUID *Guid); extern EFI_STATUS EFIAPI FSDriverInstall(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable); diff --git a/src/file.c b/src/file.c index 074e889..1538beb 100644 --- a/src/file.c +++ b/src/file.c @@ -1,6 +1,6 @@ /* file.c - SimpleFileIo Interface */ /* - * Copyright © 2014-2016 Pete Batard + * Copyright © 2014-2017 Pete Batard * Based on iPXE's efi_driver.c and efi_file.c: * Copyright © 2011,2013 Michael Brown . * @@ -18,9 +18,6 @@ * along with this program. If not, see . */ -#include -#include - #include "driver.h" /** @@ -54,7 +51,7 @@ InfoHook(const CHAR8 *name, const GRUB_DIRHOOK_INFO *Info, VOID *Data) if (strcmpa(name, File->basename) != 0) return 0; - File->IsDir = (Info->Dir); + File->IsDir = (BOOLEAN) (Info->Dir); if (Info->MtimeSet) File->Mtime = Info->Mtime; @@ -529,7 +526,6 @@ FileGetInfo(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, VOID *Data) EFI_FILE_SYSTEM_INFO *FSInfo = (EFI_FILE_SYSTEM_INFO *) Data; EFI_FILE_INFO *Info = (EFI_FILE_INFO *) Data; EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *VLInfo = (EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *)Data; - CHAR16 GuidString[36]; EFI_TIME Time; CHAR8* label; INTN tmpLen; @@ -588,13 +584,22 @@ FileGetInfo(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, VOID *Data) FSInfo->Size = *Len; FSInfo->ReadOnly = 1; /* NB: This should really be cluster size, but we don't have access to that */ - FSInfo->BlockSize = File->FileSystem->BlockIo->Media->BlockSize; + if (File->FileSystem->BlockIo2 != NULL) { + FSInfo->BlockSize = File->FileSystem->BlockIo2->Media->BlockSize; + } else { + FSInfo->BlockSize = File->FileSystem->BlockIo->Media->BlockSize; + } if (FSInfo->BlockSize == 0) { PrintWarning(L"Corrected Media BlockSize\n"); FSInfo->BlockSize = 512; } - FSInfo->VolumeSize = (File->FileSystem->BlockIo->Media->LastBlock + 1) * - FSInfo->BlockSize; + if (File->FileSystem->BlockIo2 != NULL) { + FSInfo->VolumeSize = (File->FileSystem->BlockIo2->Media->LastBlock + 1) * + FSInfo->BlockSize; + } else { + FSInfo->VolumeSize = (File->FileSystem->BlockIo->Media->LastBlock + 1) * + FSInfo->BlockSize; + } /* No idea if we can easily get this for GRUB, and the device is RO anyway */ FSInfo->FreeSpace = 0; @@ -635,9 +640,9 @@ FileGetInfo(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, VOID *Data) } else { - GuidToString(GuidString, Type); - PrintError(L"'%s': Cannot get information of type %s\n", - FileName(File), GuidString); + Print(L"'%s': Cannot get information of type ", FileName(File)); + PrintGuid(Type); + Print(L"\n"); return EFI_UNSUPPORTED; } @@ -656,11 +661,11 @@ static EFI_STATUS EFIAPI FileSetInfo(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN Len, VOID *Data) { EFI_GRUB_FILE *File = _CR(This, EFI_GRUB_FILE, EfiFile); - CHAR16 GuidString[36]; - GuidToString(GuidString, Type); - PrintError(L"Cannot set information of type %s for file '%s'\n", - GuidString, FileName(File)); + Print(L"Cannot set information of type "); + PrintGuid(Type); + Print(L" for file '%s'\n", FileName(File)); + return EFI_WRITE_PROTECTED; } @@ -756,7 +761,7 @@ FSInstall(EFI_FS *This, EFI_HANDLE ControllerHandle) /* Install the simple file system protocol. */ Status = BS->InstallMultipleProtocolInterfaces(&ControllerHandle, - &FileSystemProtocol, &This->FileIoInterface, + &gEfiSimpleFileSystemProtocolGuid, &This->FileIoInterface, NULL); if (EFI_ERROR(Status)) { PrintStatusError(Status, L"Could not install simple file system protocol"); @@ -772,7 +777,7 @@ FSUninstall(EFI_FS *This, EFI_HANDLE ControllerHandle) { PrintInfo(L"FSUninstall: %s\n", This->DevicePathString); - LibUninstallProtocolInterfaces(ControllerHandle, - &FileSystemProtocol, &This->FileIoInterface, + BS->UninstallMultipleProtocolInterfaces(ControllerHandle, + &gEfiSimpleFileSystemProtocolGuid, &This->FileIoInterface, NULL); } diff --git a/src/grub.c b/src/grub.c index 25b8542..258deec 100644 --- a/src/grub.c +++ b/src/grub.c @@ -1,6 +1,6 @@ /* grub.c - The elastic binding between grub and standalone EFI */ /* - * Copyright © 2014 Pete Batard + * Copyright © 2014-2017 Pete Batard * Based on GRUB, glibc and additional software: * Copyright © 2001-2014 Free Software Foundation, Inc. * @@ -18,9 +18,6 @@ * along with this program. If not, see . */ -#include -#include - #include #include @@ -131,7 +128,11 @@ grub_realloc(void *p, grub_size_t new_size) if (ptr != NULL) { ptr = &ptr[-1]; +#if defined(__MAKEWITH_GNUEFI) ptr = ReallocatePool(ptr, (UINTN)*ptr, (UINTN)(new_size + sizeof(grub_size_t))); +#else + ptr = ReallocatePool((UINTN)*ptr, (UINTN)(new_size + sizeof(grub_size_t)), ptr); +#endif if (ptr != NULL) *ptr++ = new_size; } @@ -265,10 +266,10 @@ GrubTimeToEfiTime(const INT32 t, EFI_TIME *tp) rem -= SECS_PER_DAY; ++days; } - tp->Hour = rem / SECS_PER_HOUR; + tp->Hour = (UINT8) (rem / SECS_PER_HOUR); rem %= SECS_PER_HOUR; - tp->Minute = rem / 60; - tp->Second = rem % 60; + tp->Minute = (UINT8) (rem / 60); + tp->Second = (UINT8) (rem % 60); y = 1970; while (days < 0 || days >= (__isleap (y) ? 366 : 365)) { @@ -281,11 +282,11 @@ GrubTimeToEfiTime(const INT32 t, EFI_TIME *tp) - LEAPS_THRU_END_OF (y - 1)); y = yg; } - tp->Year = y; + tp->Year = (UINT16) y; ip = __mon_yday[__isleap(y)]; for (y = 11; days < (long int) ip[y]; --y) continue; days -= ip[y]; - tp->Month = y + 1; - tp->Day = days + 1; + tp->Month = (UINT8) (y + 1); + tp->Day = (UINT8) (days + 1); } diff --git a/src/grub_file.c b/src/grub_file.c index e7fadea..3edb108 100644 --- a/src/grub_file.c +++ b/src/grub_file.c @@ -1,6 +1,6 @@ /* grub_file.c - GRUB file handling interface */ /* - * Copyright © 2014 Pete Batard + * Copyright © 2014-2017 Pete Batard * Based on GRUB -- GRand Unified Bootloader * Copyright © 2001-2014 Free Software Foundation, Inc. * @@ -18,10 +18,6 @@ * along with this program. If not, see . */ -#include -#include -#include /* ASSERT */ - #include #include #include @@ -119,7 +115,7 @@ grub_file_seek(grub_file_t file, grub_off_t offset) { grub_error (GRUB_ERR_OUT_OF_RANGE, N_("attempt to seek outside of the file")); - return -1; + return (grub_off_t)-1; } old = file->offset; @@ -143,16 +139,28 @@ grub_disk_read(grub_disk_t disk, grub_disk_addr_t sector, { EFI_STATUS Status; EFI_FS* FileSystem = (EFI_FS *) disk->data; + EFI_BLOCK_IO_MEDIA *Media; ASSERT(FileSystem != NULL); ASSERT(FileSystem->DiskIo != NULL); ASSERT(FileSystem->BlockIo != NULL); + if (FileSystem->BlockIo2 != NULL) { + Media = FileSystem->BlockIo2->Media; + } else { + Media = FileSystem->BlockIo->Media; + } + /* NB: We could get the actual blocksize through FileSystem->BlockIo->Media->BlockSize * but GRUB uses the fixed GRUB_DISK_SECTOR_SIZE, so we follow suit */ - Status = FileSystem->DiskIo->ReadDisk(FileSystem->DiskIo, FileSystem->BlockIo->Media->MediaId, + if (FileSystem->DiskIo2 != NULL) { + Status = FileSystem->DiskIo2->ReadDiskEx(FileSystem->DiskIo2, Media->MediaId, + sector * GRUB_DISK_SECTOR_SIZE + offset, &(FileSystem->DiskIo2Token), size, buf); + } else { + Status = FileSystem->DiskIo->ReadDisk(FileSystem->DiskIo, Media->MediaId, sector * GRUB_DISK_SECTOR_SIZE + offset, (UINTN)size, buf); + } if (EFI_ERROR(Status)) { PrintStatusError(Status, L"Could not read block at address %08x", sector); @@ -170,10 +178,37 @@ grub_disk_get_size (grub_disk_t disk) ASSERT(FileSystem != NULL); ASSERT(FileSystem->BlockIo != NULL); - return (grub_uint64_t) (FileSystem->BlockIo->Media->LastBlock + 1) * + if (FileSystem->BlockIo2 != NULL) { + return (FileSystem->BlockIo2->Media->LastBlock + 1) * + FileSystem->BlockIo2->Media->BlockSize; + } + + return (FileSystem->BlockIo->Media->LastBlock + 1) * FileSystem->BlockIo->Media->BlockSize; } +grub_disk_dev_t grub_disk_dev_list; + +void +grub_disk_dev_register(grub_disk_dev_t dev) +{ + dev->next = grub_disk_dev_list; + grub_disk_dev_list = dev; +} + +void +grub_disk_dev_unregister(grub_disk_dev_t dev) +{ + grub_disk_dev_t *p, q; + + for (p = &grub_disk_dev_list, q = *p; q; p = &(q->next), q = q->next) + if (q == dev) + { + *p = q->next; + break; + } +} + grub_device_t grub_device_open(const char *name) { @@ -188,7 +223,7 @@ grub_device_open(const char *name) grub_printf("Could not convert device '%s' to UTF-16\n", name); return NULL; } - for (FileSystem = (EFI_FS *) FsListHead.Flink; FileSystem != (EFI_FS *) &FsListHead; + for (FileSystem = (EFI_FS *) FORWARD_LINK_REF(FsListHead); FileSystem != (EFI_FS *) &FsListHead; FileSystem = (EFI_FS *) FileSystem->Flink) { if (StrCmp(FileSystem->DevicePathString, Name) == 0) break; @@ -240,7 +275,7 @@ GrubDeviceInit(EFI_FS *FileSystem) FreePool(name); if (FileSystem->GrubDevice == NULL) { - RemoveEntryList(FileSystem); + RemoveEntryList((LIST_ENTRY *)FileSystem); return EFI_NOT_FOUND; } @@ -251,7 +286,7 @@ EFI_STATUS GrubDeviceExit(EFI_FS *FileSystem) { grub_device_close((grub_device_t) FileSystem->GrubDevice); - RemoveEntryList(FileSystem); + RemoveEntryList((LIST_ENTRY *)FileSystem); return EFI_SUCCESS; } diff --git a/src/logging.c b/src/logging.c index 7a65a65..bcf0478 100644 --- a/src/logging.c +++ b/src/logging.c @@ -1,6 +1,6 @@ /* logging.c - EFI logging */ /* - * Copyright © 2014-2016 Pete Batard + * Copyright © 2014-2017 Pete Batard * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,10 +16,6 @@ * along with this program. If not, see . */ -#include -#include -#include - #include "driver.h" /* Not defined in gnu-efi yet */ @@ -29,7 +25,7 @@ extern EFI_GUID gShellVariableGuid; EFI_GUID ShellVariable = SHELL_VARIABLE_GUID; -static UINTN PrintNone(IN CHAR16 *fmt, ... ) { return 0; } +static UINTN PrintNone(IN CONST CHAR16 *fmt, ... ) { return 0; } Print_t PrintError = PrintNone; Print_t PrintWarning = PrintNone; Print_t PrintInfo = PrintNone; @@ -45,30 +41,25 @@ Print_t* PrintTable[] = { &PrintError, &PrintWarning, &PrintInfo, UINTN LogLevel = DEFAULT_LOGLEVEL; /** - * Print an error message along with a human readable EFI status code + * Print status * * @v Status EFI status code - * @v Format A non '\n' terminated error message string - * @v ... Any extra parameters */ VOID -PrintStatusError(EFI_STATUS Status, CONST CHAR16 *Format, ...) +PrintStatus(EFI_STATUS Status) { +#if defined(__MAKEWITH_GNUEFI) CHAR16 StatusString[64]; - va_list ap; - - if (LogLevel < FS_LOGLEVEL_ERROR) - return; - StatusToString(StatusString, Status); - va_start(ap, Format); - VPrint((CHAR16 *)Format, ap); - va_end(ap); // Make sure the Status is unsigned 32 bits Print(L": [%d] %s\n", (Status & 0x7FFFFFFF), StatusString); +#else + Print(L": [%d]\n", (Status & 0x7FFFFFFF)); +#endif } -/* You can control the verbosity of the driver output by setting the shell environment +/* + * You can control the verbosity of the driver output by setting the shell environment * variable FS_LOGGING to one of the values defined in the FS_LOGLEVEL constants */ VOID diff --git a/src/missing.c b/src/missing.c index fad6518..15a1244 100644 --- a/src/missing.c +++ b/src/missing.c @@ -18,12 +18,12 @@ * along with this program. If not, see . */ -#include -#include +#include "driver.h" - // Microsoft's intrinsics are a major pain in the ass - // https://stackoverflow.com/a/2945619/1069307 -#if defined(_M_X64) && (defined(_MSC_VER) || defined(__c2__)) +// Microsoft's intrinsics are a major pain in the ass +// https://stackoverflow.com/a/2945619/1069307 +#if defined(_MSC_VER) || defined(__c2__) +#if !defined(__MAKEWITH_GNUEFI) || defined(_M_X64) #include // For size_t void* memset(void *, int, size_t); @@ -57,6 +57,33 @@ void* memmove(void *s1, const void *s2, size_t n) CopyMem(s1, s2, n); return s1; } + +INT64 _allmul(INT64 a, INT64 b) +{ + INT64 _a = (a>=0)?a:-a, _b = (b>=0)?b:-b; + if (((a > 0) & (b < 0)) || ((a < 0) && (b > 0))) + return -MultU64x32(_a, (UINTN)_b); + return MultU64x32(_a, (UINTN)_b); +} + +INT64 _allshl(INT64 a, INTN b) +{ + return (b >= 0) ? (INT64)LShiftU64((UINT64)a, (UINTN)b) : + (INT64)RShiftU64((UINT64)a, (UINTN)-b); +} + +INT64 _allshr(INT64 a, INTN b) +{ + return (b >= 0) ? (INT64)RShiftU64((UINT64)a, (UINTN)b) : + (INT64)LShiftU64((UINT64)a, (UINTN)-b); +} + +UINT64 _aullshr(UINT64 a, INTN b) +{ + return (b >= 0) ? RShiftU64(a, (UINTN)b) : + LShiftU64(a, (UINTN)-b); +} +#endif #endif VOID @@ -91,3 +118,27 @@ strrchra(const CHAR8 *s, INTN c) return p; } + +EFI_STATUS +PrintGuid(EFI_GUID *Guid) +{ + if (Guid == NULL) { + Print(L"ERROR: PrintGuid called with a NULL value.\n"); + return EFI_INVALID_PARAMETER; + } + + Print(L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", + Guid->Data1, + Guid->Data2, + Guid->Data3, + Guid->Data4[0], + Guid->Data4[1], + Guid->Data4[2], + Guid->Data4[3], + Guid->Data4[4], + Guid->Data4[5], + Guid->Data4[6], + Guid->Data4[7] + ); + return EFI_SUCCESS; +} diff --git a/src/path.c b/src/path.c index 12c4e93..c11482d 100644 --- a/src/path.c +++ b/src/path.c @@ -17,9 +17,6 @@ * along with this program. If not, see . */ -#include -#include - #include "driver.h" /* copy src into dest converting the path to a relative one inside the current diff --git a/src/this.c b/src/this.c index 52eb6e9..2658461 100644 --- a/src/this.c +++ b/src/this.c @@ -16,9 +16,6 @@ * along with this program. If not, see . */ -#include -#include - #include "config.h" #include "driver.h" @@ -90,5 +87,7 @@ GRUB_MOD_EXIT GrubModuleExit[] = { NULL }; +#if defined(__MAKEWITH_GNUEFI) // Designate the driver entrypoint EFI_DRIVER_ENTRY_POINT(FSDriverInstall) +#endif diff --git a/src/utf8.c b/src/utf8.c index 45c68fe..9e8374e 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -18,9 +18,7 @@ * along with this program. If not, see . */ -#include -#include -#include /* ASSERT */ +#include "driver.h" /* * Define this if you want to support UTF-16 in UCS-2