1
This is a collection of patches that make the GRUB2 build work on mingw32.
2
They've been submitted upstream, but not yet accepted.
4
Index: grub2-1.99/grub-core/kern/emu/misc.c
5
===================================================================
6
--- grub2-1.99.orig/grub-core/kern/emu/misc.c 2011-09-06 22:25:48.157785280 -0500
7
+++ grub2-1.99/grub-core/kern/emu/misc.c 2011-09-06 22:25:53.149810026 -0500
9
canonicalize_file_name (const char *path)
13
+ ret = xmalloc(PATH_MAX);
14
+ if (!_fullpath(ret, path, PATH_MAX))
18
ret = xmalloc (PATH_MAX);
19
if (!realpath (path, ret))
22
ret = realpath (path, NULL);
24
+#endif /* __MINGW32__ */
28
Index: grub2-1.99/include/grub/util/misc.h
29
===================================================================
30
--- grub2-1.99.orig/include/grub/util/misc.h 2011-09-06 22:25:27.737684020 -0500
31
+++ grub2-1.99/include/grub/util/misc.h 2011-09-06 22:25:33.993715034 -0500
38
grub_int64_t grub_util_get_disk_size (char *name);
40
Index: grub2-1.99/util/misc.c
41
===================================================================
42
--- grub2-1.99.orig/util/misc.c 2011-09-06 22:25:22.085655995 -0500
43
+++ grub2-1.99/util/misc.c 2011-09-06 22:26:21.941952796 -0500
62
grub_util_get_disk_size (char *name)
65
grub_int64_t size = -1LL;
67
+ strip_trailing_slashes(name);
68
hd = CreateFile (name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
69
0, OPEN_EXISTING, 0, 0);