0025-grub2-update-to-2.02-beta2-fixes-mac-os-x-10.9-support-and-many-other-things.patch 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
  2. Date: Wed, 12 Mar 2014 11:21:16 +0000
  3. Subject: grub2: update to 2.02-beta2, fixes mac os x 10.9 support (and many other things)
  4. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  5. diff --git a/package/grub2/Makefile b/package/grub2/Makefile
  6. index dd490ff..4edd92b 100644
  7. --- a/package/grub2/Makefile
  8. +++ b/package/grub2/Makefile
  9. @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
  10. include $(INCLUDE_DIR)/kernel.mk
  11. PKG_NAME:=grub
  12. -PKG_VERSION:=2.00
  13. +PKG_VERSION:=2.02~beta2
  14. PKG_RELEASE:=1
  15. -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. -PKG_SOURCE_URL:=@GNU/grub
  17. -PKG_MD5SUM:=e927540b6eda8b024fb0391eeaa4091c
  18. +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  19. +PKG_SOURCE_URL:=http://alpha.gnu.org/gnu/grub
  20. +PKG_MD5SUM:=be62932eade308a364ea4bbc91295930
  21. HOST_BUILD_PARALLEL:=1
  22. PKG_BUILD_DEPENDS:=grub2/host
  23. diff --git a/package/grub2/patches/100-grub_setup_root.patch b/package/grub2/patches/100-grub_setup_root.patch
  24. index 7775b2a..9619c41 100644
  25. --- a/package/grub2/patches/100-grub_setup_root.patch
  26. +++ b/package/grub2/patches/100-grub_setup_root.patch
  27. @@ -1,41 +1,6 @@
  28. --- a/util/grub-setup.c
  29. +++ b/util/grub-setup.c
  30. -@@ -141,12 +141,11 @@ write_rootdev (char *core_img, grub_devi
  31. - static void
  32. - setup (const char *dir,
  33. - const char *boot_file, const char *core_file,
  34. -- const char *dest, int force,
  35. -+ const char *root, const char *dest, int force,
  36. - int fs_probe, int allow_floppy)
  37. - {
  38. - char *boot_path, *core_path, *core_path_dev, *core_path_dev_full;
  39. - char *boot_img, *core_img;
  40. -- char *root = 0;
  41. - size_t boot_size, core_size;
  42. - grub_uint16_t core_sectors;
  43. - grub_device_t root_dev = 0, dest_dev, core_dev;
  44. -@@ -253,7 +252,10 @@ setup (const char *dir,
  45. -
  46. - core_dev = dest_dev;
  47. -
  48. -- {
  49. -+ if (root)
  50. -+ root_dev = grub_device_open(root);
  51. -+
  52. -+ if (!root_dev) {
  53. - char **root_devices = grub_guess_root_devices (dir);
  54. - char **cur;
  55. - int found = 0;
  56. -@@ -263,6 +265,8 @@ setup (const char *dir,
  57. - char *drive;
  58. - grub_device_t try_dev;
  59. -
  60. -+ if (root_dev)
  61. -+ break;
  62. - drive = grub_util_get_grub_dev (*cur);
  63. - if (!drive)
  64. - continue;
  65. -@@ -956,6 +960,8 @@ static struct argp_option options[] = {
  66. +@@ -87,6 +87,8 @@ static struct argp_option options[] = {
  67. N_("install even if problems are detected"), 0},
  68. {"skip-fs-probe",'s',0, 0,
  69. N_("do not probe for filesystems in DEVICE"), 0},
  70. @@ -44,7 +9,7 @@
  71. {"verbose", 'v', 0, 0, N_("print verbose messages."), 0},
  72. {"allow-floppy", 'a', 0, 0,
  73. /* TRANSLATORS: The potential breakage isn't limited to floppies but it's
  74. -@@ -993,6 +999,7 @@ struct arguments
  75. +@@ -130,6 +132,7 @@ struct arguments
  76. char *core_file;
  77. char *dir;
  78. char *dev_map;
  79. @@ -52,7 +17,7 @@
  80. int force;
  81. int fs_probe;
  82. int allow_floppy;
  83. -@@ -1040,6 +1047,13 @@ argp_parser (int key, char *arg, struct
  84. +@@ -178,6 +181,13 @@ argp_parser (int key, char *arg, struct
  85. arguments->dev_map = xstrdup (arg);
  86. break;
  87. @@ -66,12 +31,88 @@
  88. case 'f':
  89. arguments->force = 1;
  90. break;
  91. -@@ -1172,7 +1186,7 @@ main (int argc, char *argv[])
  92. - setup (arguments.dir ? : DEFAULT_DIRECTORY,
  93. - arguments.boot_file ? : DEFAULT_BOOT_FILE,
  94. - arguments.core_file ? : DEFAULT_CORE_FILE,
  95. -- dest_dev, arguments.force,
  96. -+ arguments.root_dev, dest_dev, arguments.force,
  97. - arguments.fs_probe, arguments.allow_floppy);
  98. +@@ -313,7 +323,7 @@ main (int argc, char *argv[])
  99. + GRUB_SETUP_FUNC (arguments.dir ? : DEFAULT_DIRECTORY,
  100. + arguments.boot_file ? : DEFAULT_BOOT_FILE,
  101. + arguments.core_file ? : DEFAULT_CORE_FILE,
  102. +- dest_dev, arguments.force,
  103. ++ arguments.root_dev, dest_dev, arguments.force,
  104. + arguments.fs_probe, arguments.allow_floppy,
  105. + arguments.add_rs_codes);
  106. +
  107. +--- a/util/setup.c
  108. ++++ b/util/setup.c
  109. +@@ -247,13 +247,12 @@ identify_partmap (grub_disk_t disk __att
  110. + void
  111. + SETUP (const char *dir,
  112. + const char *boot_file, const char *core_file,
  113. +- const char *dest, int force,
  114. ++ const char *root, const char *dest, int force,
  115. + int fs_probe, int allow_floppy,
  116. + int add_rs_codes __attribute__ ((unused))) /* unused on sparc64 */
  117. + {
  118. + char *core_path;
  119. + char *boot_img, *core_img, *boot_path;
  120. +- char *root = 0;
  121. + size_t boot_size, core_size;
  122. + #ifdef GRUB_SETUP_BIOS
  123. + grub_uint16_t core_sectors;
  124. +@@ -307,7 +306,10 @@ SETUP (const char *dir,
  125. +
  126. + core_dev = dest_dev;
  127. +
  128. +- {
  129. ++ if (root)
  130. ++ root_dev = grub_device_open(root);
  131. ++
  132. ++ if (!root_dev) {
  133. + char **root_devices = grub_guess_root_devices (dir);
  134. + char **cur;
  135. + int found = 0;
  136. +@@ -317,6 +319,8 @@ SETUP (const char *dir,
  137. + char *drive;
  138. + grub_device_t try_dev;
  139. +
  140. ++ if (root_dev)
  141. ++ break;
  142. + drive = grub_util_get_grub_dev (*cur);
  143. + if (!drive)
  144. + continue;
  145. +--- a/include/grub/util/install.h
  146. ++++ b/include/grub/util/install.h
  147. +@@ -182,13 +182,13 @@ grub_install_get_image_target (const cha
  148. + void
  149. + grub_util_bios_setup (const char *dir,
  150. + const char *boot_file, const char *core_file,
  151. +- const char *dest, int force,
  152. ++ const char *root, const char *dest, int force,
  153. + int fs_probe, int allow_floppy,
  154. + int add_rs_codes);
  155. + void
  156. + grub_util_sparc_setup (const char *dir,
  157. + const char *boot_file, const char *core_file,
  158. +- const char *dest, int force,
  159. ++ const char *root, const char *dest, int force,
  160. + int fs_probe, int allow_floppy,
  161. + int add_rs_codes);
  162. - /* Free resources. */
  163. +--- a/util/grub-install.c
  164. ++++ b/util/grub-install.c
  165. +@@ -1660,7 +1660,7 @@ main (int argc, char *argv[])
  166. + /* Now perform the installation. */
  167. + if (install_bootsector)
  168. + grub_util_bios_setup (platdir, "boot.img", "core.img",
  169. +- install_drive, force,
  170. ++ NULL, install_drive, force,
  171. + fs_probe, allow_floppy, add_rs_codes);
  172. + break;
  173. + }
  174. +@@ -1686,7 +1686,7 @@ main (int argc, char *argv[])
  175. + /* Now perform the installation. */
  176. + if (install_bootsector)
  177. + grub_util_sparc_setup (platdir, "boot.img", "core.img",
  178. +- install_device, force,
  179. ++ NULL, install_device, force,
  180. + fs_probe, allow_floppy,
  181. + 0 /* unused */ );
  182. + break;
  183. diff --git a/package/grub2/patches/200-fix-gets-removal.patch b/package/grub2/patches/200-fix-gets-removal.patch
  184. index 4370fb5..737fb97 100644
  185. --- a/package/grub2/patches/200-fix-gets-removal.patch
  186. +++ b/package/grub2/patches/200-fix-gets-removal.patch
  187. @@ -1,15 +1,16 @@
  188. --- a/grub-core/gnulib/stdio.in.h
  189. +++ b/grub-core/gnulib/stdio.in.h
  190. -@@ -137,12 +137,6 @@
  191. - "use gnulib module fflush for portable POSIX compliance");
  192. +@@ -695,13 +695,6 @@ _GL_WARN_ON_USE (getline, "getline is un
  193. + # endif
  194. #endif
  195. -/* It is very rare that the developer ever has full control of stdin,
  196. -- so any use of gets warrants an unconditional warning. Assume it is
  197. -- always declared, since it is required by C89. */
  198. +- so any use of gets warrants an unconditional warning; besides, C11
  199. +- removed it. */
  200. -#undef gets
  201. --_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  202. +-#if HAVE_RAW_DECL_GETS
  203. +-#endif
  204. -
  205. - #if @GNULIB_FOPEN@
  206. - # if @REPLACE_FOPEN@
  207. - # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  208. +
  209. + #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
  210. + struct obstack;