summaryrefslogtreecommitdiff
path: root/package/grub/patches
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-06-26 22:14:44 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-06-26 22:14:44 +0200
commit1143ead360fb043f43388d727e710f358702bc9a (patch)
treef0887c25a9e77521d146c402ef2dd6d960537be8 /package/grub/patches
parentebf1950d0cefc445715925286a3977e887fa1388 (diff)
parentb4427c591b463255c34994b17db3655b1e9d6c3e (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/grub/patches')
-rw-r--r--package/grub/patches/patch-conf_common_mk11
-rw-r--r--package/grub/patches/patch-include_grub_misc_h17
-rw-r--r--package/grub/patches/patch-kern_misc_c54
-rw-r--r--package/grub/patches/patch-kern_misc_c.orig26
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c29
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c.orig21
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_des_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_dsa_c29
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_elgamal_c20
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_md4_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_md5_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_primegen_c38
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_rijndael_c53
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_rmd160_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_serpent_c20
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha1_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha256_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha512_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_tiger_c11
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_twofish_c20
-rw-r--r--package/grub/patches/patch-lib_libgcrypt-grub_cipher_whirlpool_c11
-rw-r--r--package/grub/patches/patch-util_grub-install_in11
-rw-r--r--package/grub/patches/patch-util_grub-mkconfig_lib_in11
-rw-r--r--package/grub/patches/patch-util_grub_d_10_linux_in20
24 files changed, 479 insertions, 0 deletions
diff --git a/package/grub/patches/patch-conf_common_mk b/package/grub/patches/patch-conf_common_mk
new file mode 100644
index 000000000..ea4ffc0df
--- /dev/null
+++ b/package/grub/patches/patch-conf_common_mk
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/conf/common.mk 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/conf/common.mk 2010-06-26 18:20:29.307157138 +0200
+@@ -11159,7 +11159,7 @@ trigtables.c: gentrigtables
+ ./gentrigtables > $@
+ DISTCLEANFILES += trigtables.c
+ gentrigtables: gentrigtables.c
+- $(CC) -o $@ $^ $(CPPFLAGS) -lm
++ $(HOSTCC) -o $@ $^ $(CPPFLAGS) -lm
+ DISTCLEANFILES += gentrigtables
+
+ pkglib_MODULES += setjmp.mod
diff --git a/package/grub/patches/patch-include_grub_misc_h b/package/grub/patches/patch-include_grub_misc_h
new file mode 100644
index 000000000..fb3e46108
--- /dev/null
+++ b/package/grub/patches/patch-include_grub_misc_h
@@ -0,0 +1,17 @@
+--- grub-1.98.orig/include/grub/misc.h 2010-03-06 21:51:37.000000000 +0100
++++ grub-1.98/include/grub/misc.h 2010-06-26 18:54:44.075171713 +0200
+@@ -91,14 +91,6 @@ grub_strncat (char *dest, const char *sr
+ return dest;
+ }
+
+-/* Prototypes for aliases. */
+-#ifndef GRUB_UTIL
+-int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);
+-void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n);
+-void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
+-void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
+-#endif
+-
+ int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n);
+ int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2);
+ int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n);
diff --git a/package/grub/patches/patch-kern_misc_c b/package/grub/patches/patch-kern_misc_c
new file mode 100644
index 000000000..2912e2564
--- /dev/null
+++ b/package/grub/patches/patch-kern_misc_c
@@ -0,0 +1,54 @@
+--- grub-1.98.orig/kern/misc.c 2010-03-06 21:51:37.000000000 +0100
++++ grub-1.98/kern/misc.c 2010-06-26 20:12:26.711214130 +0200
+@@ -64,23 +64,6 @@ grub_memmove (void *dest, const void *sr
+ return dest;
+ }
+
+-#ifndef APPLE_CC
+-void *memmove (void *dest, const void *src, grub_size_t n)
+- __attribute__ ((alias ("grub_memmove")));
+-/* GCC emits references to memcpy() for struct copies etc. */
+-void *memcpy (void *dest, const void *src, grub_size_t n)
+- __attribute__ ((alias ("grub_memmove")));
+-#else
+-void *memcpy (void *dest, const void *src, grub_size_t n)
+-{
+- return grub_memmove (dest, src, n);
+-}
+-void *memmove (void *dest, const void *src, grub_size_t n)
+-{
+- return grub_memmove (dest, src, n);
+-}
+-#endif
+-
+ char *
+ grub_strcpy (char *dest, const char *src)
+ {
+@@ -516,15 +499,6 @@ grub_memset (void *s, int c, grub_size_t
+
+ return s;
+ }
+-#ifndef APPLE_CC
+-void *memset (void *s, int c, grub_size_t n)
+- __attribute__ ((alias ("grub_memset")));
+-#else
+-void *memset (void *s, int c, grub_size_t n)
+-{
+- return grub_memset (s, c, n);
+-}
+-#endif
+
+ grub_size_t
+ grub_strlen (const char *s)
+@@ -1053,11 +1027,6 @@ grub_abort (void)
+ grub_exit ();
+ }
+
+-#ifndef APPLE_CC
+-/* GCC emits references to abort(). */
+-void abort (void) __attribute__ ((alias ("grub_abort")));
+-#endif
+-
+ #ifdef NEED_ENABLE_EXECUTE_STACK
+ /* Some gcc versions generate a call to this function
+ in trampolines for nested functions. */
diff --git a/package/grub/patches/patch-kern_misc_c.orig b/package/grub/patches/patch-kern_misc_c.orig
new file mode 100644
index 000000000..52a7ed8ee
--- /dev/null
+++ b/package/grub/patches/patch-kern_misc_c.orig
@@ -0,0 +1,26 @@
+--- grub-1.98.orig/kern/misc.c 2010-03-06 21:51:37.000000000 +0100
++++ grub-1.98/kern/misc.c 2010-06-26 19:44:00.999168677 +0200
+@@ -64,23 +64,6 @@ grub_memmove (void *dest, const void *sr
+ return dest;
+ }
+
+-#ifndef APPLE_CC
+-void *memmove (void *dest, const void *src, grub_size_t n)
+- __attribute__ ((alias ("grub_memmove")));
+-/* GCC emits references to memcpy() for struct copies etc. */
+-void *memcpy (void *dest, const void *src, grub_size_t n)
+- __attribute__ ((alias ("grub_memmove")));
+-#else
+-void *memcpy (void *dest, const void *src, grub_size_t n)
+-{
+- return grub_memmove (dest, src, n);
+-}
+-void *memmove (void *dest, const void *src, grub_size_t n)
+-{
+- return grub_memmove (dest, src, n);
+-}
+-#endif
+-
+ char *
+ grub_strcpy (char *dest, const char *src)
+ {
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c
new file mode 100644
index 000000000..8b3594525
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c
@@ -0,0 +1,29 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/camellia.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/camellia.c 2010-06-26 20:49:20.915278106 +0200
+@@ -26,6 +26,7 @@
+ */
+
+
++#include <grub/misc.h>
+ #include "camellia.h"
+
+ /* u32 must be 32bit word */
+@@ -946,13 +947,13 @@ void camellia_setup192(const unsigned ch
+ unsigned char kk[32];
+ u32 krll, krlr, krrl,krrr;
+
+- memcpy(kk, key, 24);
+- memcpy((unsigned char *)&krll, key+16,4);
+- memcpy((unsigned char *)&krlr, key+20,4);
++ grub_memcpy(kk, key, 24);
++ grub_memcpy((unsigned char *)&krll, key+16,4);
++ grub_memcpy((unsigned char *)&krlr, key+20,4);
+ krrl = ~krll;
+ krrr = ~krlr;
+- memcpy(kk+24, (unsigned char *)&krrl, 4);
+- memcpy(kk+28, (unsigned char *)&krrr, 4);
++ grub_memcpy(kk+24, (unsigned char *)&krrl, 4);
++ grub_memcpy(kk+28, (unsigned char *)&krrr, 4);
+ camellia_setup256(kk, subkey);
+ return;
+ }
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c.orig b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c.orig
new file mode 100644
index 000000000..6e14215b4
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_camellia_c.orig
@@ -0,0 +1,21 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/camellia.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/camellia.c 2010-06-26 20:41:39.651169327 +0200
+@@ -946,13 +946,13 @@ void camellia_setup192(const unsigned ch
+ unsigned char kk[32];
+ u32 krll, krlr, krrl,krrr;
+
+- memcpy(kk, key, 24);
+- memcpy((unsigned char *)&krll, key+16,4);
+- memcpy((unsigned char *)&krlr, key+20,4);
++ grub_memcpy(kk, key, 24);
++ grub_memcpy((unsigned char *)&krll, key+16,4);
++ grub_memcpy((unsigned char *)&krlr, key+20,4);
+ krrl = ~krll;
+ krrr = ~krlr;
+- memcpy(kk+24, (unsigned char *)&krrl, 4);
+- memcpy(kk+28, (unsigned char *)&krrr, 4);
++ grub_memcpy(kk+24, (unsigned char *)&krrl, 4);
++ grub_memcpy(kk+28, (unsigned char *)&krrr, 4);
+ camellia_setup256(kk, subkey);
+ return;
+ }
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_des_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_des_c
new file mode 100644
index 000000000..c2c93be5a
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_des_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/des.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/des.c 2010-06-26 20:35:49.335279651 +0200
+@@ -119,7 +119,7 @@
+ #include "cipher.h"
+
+ #if defined(__GNUC__) && defined(__GNU_LIBRARY__)
+-#define working_memcmp memcmp
++#define working_memcmp grub_memcmp
+ #else
+ /*
+ * According to the SunOS man page, memcmp returns indeterminate sign
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_dsa_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_dsa_c
new file mode 100644
index 000000000..91b467779
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_dsa_c
@@ -0,0 +1,29 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/dsa.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/dsa.c 2010-06-26 20:41:13.511279436 +0200
+@@ -157,7 +157,7 @@ gen_k( gcry_mpi_t q )
+ to get_random_bytes() and use this the here maybe it is
+ easier to do this directly in random.c. */
+ char *pp = gcry_random_bytes_secure( 4, GCRY_STRONG_RANDOM );
+- memcpy( rndbuf,pp, 4 );
++ grub_memcpy( rndbuf,pp, 4 );
+ gcry_free(pp);
+ }
+ _gcry_mpi_set_buffer( k, rndbuf, nbytes, 0 );
+@@ -337,7 +337,7 @@ generate (DSA_secret_key *sk, unsigned i
+ else
+ { /* Change only some of the higher bits (= 2 bytes)*/
+ char *r = gcry_random_bytes_secure (2, random_level);
+- memcpy(rndbuf, r, 2 );
++ grub_memcpy(rndbuf, r, 2 );
+ gcry_free(r);
+ }
+
+@@ -713,7 +713,7 @@ dsa_generate_ext (int algo, unsigned int
+ gcry_sexp_release (l1);
+ return GPG_ERR_INV_OBJ; /* No value or value too large. */
+ }
+- memcpy (buf, s, n);
++ grub_memcpy (buf, s, n);
+ buf[n] = 0;
+ qbits = (unsigned int)strtoul (buf, NULL, 0);
+ gcry_sexp_release (l1);
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_elgamal_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_elgamal_c
new file mode 100644
index 000000000..5cd42146e
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_elgamal_c
@@ -0,0 +1,20 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/elgamal.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/elgamal.c 2010-06-26 20:40:56.115156639 +0200
+@@ -212,7 +212,7 @@ gen_k( gcry_mpi_t p, int small_k )
+ easier to do this directly in random.c Anyway, it is
+ highly inlikely that we will ever reach this code. */
+ char *pp = gcry_random_bytes_secure( 4, GCRY_STRONG_RANDOM );
+- memcpy( rndbuf, pp, 4 );
++ grub_memcpy( rndbuf, pp, 4 );
+ gcry_free(pp);
+ }
+ _gcry_mpi_set_buffer( k, rndbuf, nbytes, 0 );
+@@ -308,7 +308,7 @@ generate ( ELG_secret_key *sk, unsigned
+ {
+ char *r = gcry_random_bytes_secure( 2,
+ GCRY_VERY_STRONG_RANDOM );
+- memcpy(rndbuf, r, 2 );
++ grub_memcpy(rndbuf, r, 2 );
+ gcry_free(r);
+ }
+ }
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_md4_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_md4_c
new file mode 100644
index 000000000..8bbe886a7
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_md4_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/md4.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/md4.c 2010-06-26 20:24:28.691278909 +0200
+@@ -109,7 +109,7 @@ transform ( MD4_CONTEXT *ctx, const unsi
+ }
+ }
+ #else
+- memcpy (in, data, 64);
++ grub_memcpy (in, data, 64);
+ #endif
+
+ /* Round 1. */
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_md5_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_md5_c
new file mode 100644
index 000000000..53aa3e69f
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_md5_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/md5.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/md5.c 2010-06-26 20:24:19.631157281 +0200
+@@ -100,7 +100,7 @@ transform ( MD5_CONTEXT *ctx, const unsi
+ }
+ }
+ #else
+- memcpy( correct_words, data, 64 );
++ grub_memcpy( correct_words, data, 64 );
+ #endif
+
+
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_primegen_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_primegen_c
new file mode 100644
index 000000000..c97d88c1d
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_primegen_c
@@ -0,0 +1,38 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/primegen.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/primegen.c 2010-06-26 20:42:06.831276628 +0200
+@@ -1478,7 +1478,7 @@ _gcry_generate_fips186_2_prime (unsigned
+ }
+
+ /* Step 2: U = sha1(seed) ^ sha1((seed+1) mod 2^{qbits}) */
+- memcpy (seed_plus, seed, seedlen);
++ grub_memcpy (seed_plus, seed, seedlen);
+ for (i=seedlen-1; i >= 0; i--)
+ {
+ seed_plus[i]++;
+@@ -1596,7 +1596,7 @@ _gcry_generate_fips186_2_prime (unsigned
+ *r_counter = counter;
+ if (r_seed && r_seedlen)
+ {
+- memcpy (seed_plus, seed, seedlen);
++ grub_memcpy (seed_plus, seed, seedlen);
+ *r_seed = seed_plus;
+ seed_plus = NULL;
+ *r_seedlen = seedlen;
+@@ -1751,7 +1751,7 @@ _gcry_generate_fips186_3_prime (unsigned
+
+ /* Step 11. Note that we do no use an explicit offset but increment
+ SEED_PLUS accordingly. */
+- memcpy (seed_plus, seed, seedlen);
++ grub_memcpy (seed_plus, seed, seedlen);
+ counter = 0;
+
+ /* Generate P. */
+@@ -1838,7 +1838,7 @@ _gcry_generate_fips186_3_prime (unsigned
+ *r_counter = counter;
+ if (r_seed && r_seedlen)
+ {
+- memcpy (seed_plus, seed, seedlen);
++ grub_memcpy (seed_plus, seed, seedlen);
+ *r_seed = seed_plus;
+ seed_plus = NULL;
+ *r_seedlen = seedlen;
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_rijndael_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_rijndael_c
new file mode 100644
index 000000000..056abefa3
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_rijndael_c
@@ -0,0 +1,53 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/rijndael.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/rijndael.c 2010-06-26 20:23:29.463277513 +0200
+@@ -139,7 +139,7 @@ do_setkey (RIJNDAEL_context *ctx, const
+ if ((_gcry_get_hw_features () & HWF_PADLOCK_AES))
+ {
+ ctx->use_padlock = 1;
+- memcpy (ctx->padlock_key, key, keylen);
++ grub_memcpy (ctx->padlock_key, key, keylen);
+ }
+ #endif
+ }
+@@ -411,9 +411,9 @@ do_encrypt (const RIJNDAEL_context *ctx,
+ byte b[16];
+ } b;
+
+- memcpy (a.a, ax, 16);
++ grub_memcpy (a.a, ax, 16);
+ do_encrypt_aligned (ctx, b.b, a.a);
+- memcpy (bx, b.b, 16);
++ grub_memcpy (bx, b.b, 16);
+ }
+
+
+@@ -440,7 +440,7 @@ do_padlock (const RIJNDAEL_context *ctx,
+ if (decrypt_flag)
+ cword[0] |= 0x00000200;
+
+- memcpy (a, ax, 16);
++ grub_memcpy (a, ax, 16);
+
+ asm volatile
+ ("pushfl\n\t" /* Force key reload. */
+@@ -454,7 +454,7 @@ do_padlock (const RIJNDAEL_context *ctx,
+ : "%ecx", "cc", "memory"
+ );
+
+- memcpy (bx, b, 16);
++ grub_memcpy (bx, b, 16);
+
+ }
+ #endif /*USE_PADLOCK*/
+@@ -609,9 +609,9 @@ do_decrypt (RIJNDAEL_context *ctx, byte
+ ctx->decryption_prepared = 1;
+ }
+
+- memcpy (a.a, ax, 16);
++ grub_memcpy (a.a, ax, 16);
+ do_decrypt_aligned (ctx, b.b, a.a);
+- memcpy (bx, b.b, 16);
++ grub_memcpy (bx, b.b, 16);
+ #undef rk
+ }
+
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_rmd160_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_rmd160_c
new file mode 100644
index 000000000..fb818bd51
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_rmd160_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/rmd160.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/rmd160.c 2010-06-26 20:23:39.319276778 +0200
+@@ -185,7 +185,7 @@ transform ( RMD160_CONTEXT *hd, const un
+ * executes on a 586-100 (39.73 bogomips) at about 1900kb/sec;
+ * [measured with a 4MB data and "gpgm --print-md rmd160"] */
+ u32 x[16];
+- memcpy( x, data, 64 );
++ grub_memcpy( x, data, 64 );
+ #endif
+
+
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_serpent_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_serpent_c
new file mode 100644
index 000000000..7c99e23ad
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_serpent_c
@@ -0,0 +1,20 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/serpent.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/serpent.c 2010-06-26 20:29:51.523275940 +0200
+@@ -917,7 +917,7 @@ serpent_test (void)
+ (const u32 *) test_data[i].text_plain,
+ (u32 *) scratch);
+
+- if (memcmp (scratch, test_data[i].text_cipher, sizeof (serpent_block_t)))
++ if (grub_memcmp (scratch, test_data[i].text_cipher, sizeof (serpent_block_t)))
+ switch (test_data[i].key_length)
+ {
+ case 16:
+@@ -931,7 +931,7 @@ serpent_test (void)
+ serpent_decrypt_internal (&context,
+ (const u32 *) test_data[i].text_cipher,
+ (u32 *) scratch);
+- if (memcmp (scratch, test_data[i].text_plain, sizeof (serpent_block_t)))
++ if (grub_memcmp (scratch, test_data[i].text_plain, sizeof (serpent_block_t)))
+ switch (test_data[i].key_length)
+ {
+ case 16:
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha1_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha1_c
new file mode 100644
index 000000000..b04764bb8
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha1_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/sha1.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/sha1.c 2010-06-26 20:23:50.135168960 +0200
+@@ -114,7 +114,7 @@ transform (SHA1_CONTEXT *hd, const unsig
+ for ( ;nblocks; nblocks--)
+ {
+ #ifdef WORDS_BIGENDIAN
+- memcpy (x, data, 64);
++ grub_memcpy (x, data, 64);
+ data += 64;
+ #else
+ {
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha256_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha256_c
new file mode 100644
index 000000000..f9676e392
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha256_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/sha256.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/sha256.c 2010-06-26 20:24:00.135274844 +0200
+@@ -150,7 +150,7 @@ transform (SHA256_CONTEXT *hd, const uns
+ h = hd->h7;
+
+ #ifdef WORDS_BIGENDIAN
+- memcpy (x, data, 64);
++ grub_memcpy (x, data, 64);
+ #else
+ {
+ byte *p2;
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha512_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha512_c
new file mode 100644
index 000000000..070a15dff
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_sha512_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/sha512.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/sha512.c 2010-06-26 20:24:09.235288423 +0200
+@@ -162,7 +162,7 @@ transform (SHA512_CONTEXT *hd, const uns
+ h = hd->h7;
+
+ #ifdef WORDS_BIGENDIAN
+- memcpy (w, data, 128);
++ grub_memcpy (w, data, 128);
+ #else
+ {
+ int i;
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_tiger_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_tiger_c
new file mode 100644
index 000000000..a039004a2
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_tiger_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/tiger.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/tiger.c 2010-06-26 20:22:45.507277255 +0200
+@@ -685,7 +685,7 @@ transform ( TIGER_CONTEXT *hd, const uns
+ x[7] = MKWORD(data, 7);
+ #undef MKWORD
+ #else
+- memcpy( &x[0], data, 64 );
++ grub_memcpy( &x[0], data, 64 );
+ #endif
+
+ /* save */
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_twofish_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_twofish_c
new file mode 100644
index 000000000..88e9e761c
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_twofish_c
@@ -0,0 +1,20 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/twofish.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/twofish.c 2010-06-26 20:30:05.671278033 +0200
+@@ -932,7 +932,7 @@ main()
+ twofish_encrypt (&ctx, buffer[1], buffer[1]);
+ }
+ }
+- encrypt_msg = memcmp (buffer, test_encrypt, sizeof (test_encrypt)) ?
++ encrypt_msg = grub_memcmp (buffer, test_encrypt, sizeof (test_encrypt)) ?
+ "encryption failure!\n" : "encryption OK!\n";
+
+ /* Decryption test. */
+@@ -954,7 +954,7 @@ main()
+ /* Stop the timer, and print results. */
+ timer = clock () - timer;
+ printf (encrypt_msg);
+- printf (memcmp (buffer, test_decrypt, sizeof (test_decrypt)) ?
++ printf (grub_memcmp (buffer, test_decrypt, sizeof (test_decrypt)) ?
+ "decryption failure!\n" : "decryption OK!\n");
+ printf ("elapsed time: %.1f s.\n", (float) timer / CLOCKS_PER_SEC);
+
diff --git a/package/grub/patches/patch-lib_libgcrypt-grub_cipher_whirlpool_c b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_whirlpool_c
new file mode 100644
index 000000000..a92518354
--- /dev/null
+++ b/package/grub/patches/patch-lib_libgcrypt-grub_cipher_whirlpool_c
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/lib/libgcrypt-grub/cipher/whirlpool.c 2010-03-06 21:52:26.000000000 +0100
++++ grub-1.98/lib/libgcrypt-grub/cipher/whirlpool.c 2010-06-26 20:17:35.043170089 +0200
+@@ -1381,7 +1381,7 @@ whirlpool_final (void *ctx)
+ context->buffer[context->count++] = 0;
+
+ /* Add length of message. */
+- memcpy (context->buffer + context->count, context->length, 32);
++ grub_memcpy (context->buffer + context->count, context->length, 32);
+ context->count += 32;
+ whirlpool_add (context, NULL, 0);
+
diff --git a/package/grub/patches/patch-util_grub-install_in b/package/grub/patches/patch-util_grub-install_in
new file mode 100644
index 000000000..6cbc9fbc3
--- /dev/null
+++ b/package/grub/patches/patch-util_grub-install_in
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/util/grub-install.in 2010-03-06 21:51:37.000000000 +0100
++++ grub-1.98/util/grub-install.in 2010-06-26 21:16:50.031158562 +0200
+@@ -306,7 +306,7 @@ config_opt=
+
+ if [ "x${devabstraction_module}" = "x" ] ; then
+ if [ x"${install_device}" != x ]; then
+- if echo "${install_device}" | grep -qx "(.*)" ; then
++ if echo "${install_device}" | grep -q "(.*)" ; then
+ install_drive="${install_device}"
+ else
+ install_drive="`$grub_probe --target=drive --device ${install_device}`"
diff --git a/package/grub/patches/patch-util_grub-mkconfig_lib_in b/package/grub/patches/patch-util_grub-mkconfig_lib_in
new file mode 100644
index 000000000..a51e3ec53
--- /dev/null
+++ b/package/grub/patches/patch-util_grub-mkconfig_lib_in
@@ -0,0 +1,11 @@
+--- grub-1.98.orig/util/grub-mkconfig_lib.in 2010-03-06 21:51:37.000000000 +0100
++++ grub-1.98/util/grub-mkconfig_lib.in 2010-06-26 21:17:19.399157123 +0200
+@@ -154,7 +154,7 @@ version_test_numeric ()
+ a=$b
+ b=$c
+ fi
+- if (echo $a ; echo $b) | sort -n | head -n 1 | grep -qx $b ; then
++ if (echo $a ; echo $b) | sort -n | head -n 1 | grep -q $b ; then
+ return 0
+ else
+ return 1
diff --git a/package/grub/patches/patch-util_grub_d_10_linux_in b/package/grub/patches/patch-util_grub_d_10_linux_in
new file mode 100644
index 000000000..b84b3e3ca
--- /dev/null
+++ b/package/grub/patches/patch-util_grub_d_10_linux_in
@@ -0,0 +1,20 @@
+--- grub-1.98.orig/util/grub.d/10_linux.in 2010-03-06 21:51:37.000000000 +0100
++++ grub-1.98/util/grub.d/10_linux.in 2010-06-26 21:18:10.803156350 +0200
+@@ -66,8 +66,8 @@ linux_entry ()
+ # Use ELILO's generic "efifb" when it's known to be available.
+ # FIXME: We need an interface to select vesafb in case efifb can't be used.
+ if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
+- if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
+- && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
++ if grep -q "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
++ && grep -q "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
+ cat << EOF
+ set gfxpayload=keep
+ EOF
+@@ -135,5 +135,5 @@ while [ "x$list" != "x" ] ; do
+ "single ${GRUB_CMDLINE_LINUX}"
+ fi
+
+- list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
++ list=`echo $list | tr ' ' '\n' | grep -v $linux | tr '\n' ' '`
+ done