~ubuntu-branches/ubuntu/oneiric/dell-recovery/oneiric-proposed

« back to all changes in this revision

Viewing changes to bootloader_patches/mingw.patch

  • Committer: Package Import Robot
  • Author(s): Mario Limonciello
  • Date: 2011-09-13 12:52:05 UTC
  • Revision ID: package-import@ubuntu.com-20110913125205-etix9v2x6ewwh1c7
Tags: 1.05
* If binaries already have been built for dell-recovery-bootloader, don't
  build them again.
* Clean up all dell-recovery-bootloader built binaries on purge.
* Drop devicekit-disks references.
* Add extra variables to hide EFI recovery partition as well as legacy
  recovery partition.
* Add support to build grub-setup.exe for a mingw32 target in postinst.
* Add depends of ubiquity for dell-recovery-bootloader and -casper to force
  them to be removed during OOBE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
3
 
 
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
 
8
@@ -232,6 +232,11 @@
 
9
 canonicalize_file_name (const char *path)
 
10
 {
 
11
   char *ret;
 
12
+#ifdef __MINGW32__
 
13
+  ret = xmalloc(PATH_MAX);
 
14
+  if (!_fullpath(ret, path, PATH_MAX))
 
15
+    return NULL;
 
16
+#else
 
17
 #ifdef PATH_MAX
 
18
   ret = xmalloc (PATH_MAX);
 
19
   if (!realpath (path, ret))
 
20
@@ -239,6 +244,7 @@
 
21
 #else
 
22
   ret = realpath (path, NULL);
 
23
 #endif
 
24
+#endif /* __MINGW32__ */
 
25
   return ret;
 
26
 }
 
27
 
 
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
 
32
@@ -47,7 +47,6 @@
 
33
 
 
34
 void sync (void);
 
35
 int fsync (int fno);
 
36
-void sleep(int s);
 
37
 
 
38
 grub_int64_t grub_util_get_disk_size (char *name);
 
39
 
 
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
 
44
@@ -55,6 +55,7 @@
 
45
 #ifdef __MINGW32__
 
46
 #include <windows.h>
 
47
 #include <winioctl.h>
 
48
+#include "dirname.h"
 
49
 #endif
 
50
 
 
51
 #ifdef GRUB_UTIL
 
52
@@ -316,17 +317,13 @@
 
53
   return 0;
 
54
 }
 
55
 
 
56
-void sleep (int s)
 
57
-{
 
58
-  Sleep (s * 1000);
 
59
-}
 
60
-
 
61
 grub_int64_t
 
62
 grub_util_get_disk_size (char *name)
 
63
 {
 
64
   HANDLE hd;
 
65
   grub_int64_t size = -1LL;
 
66
 
 
67
+  strip_trailing_slashes(name);
 
68
   hd = CreateFile (name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
 
69
                    0, OPEN_EXISTING, 0, 0);
 
70