File TrustedGRUB-1.1.2-gcc4.patch of Package trustedgrub
diff -pruN TrustedGRUB-1.1.0/configure.ac TrustedGRUB-1.1.0-gcc4/configure.ac
--- TrustedGRUB-1.1.0/configure.ac 2007-05-14 17:00:28.000000000 +0200
+++ TrustedGRUB-1.1.0-gcc4/configure.ac 2007-08-27 17:04:55.000000000 +0200
@@ -13,7 +13,7 @@ dnl LIABILITY OF ANY KIND FOR ANY DAMAGE
dnl USE OF THIS SOFTWARE.
AC_PREREQ(2.57)
-AC_INIT([GRUB], [1.1.0], [m.selhorst@sirrix.com])
+AC_INIT([GRUB], [1.1.2], [m.selhorst@sirrix.com])
AC_CONFIG_SRCDIR([stage2/stage2.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
diff -pruN TrustedGRUB-1.1.0/stage2/builtins.c TrustedGRUB-1.1.0-gcc4/stage2/builtins.c
--- TrustedGRUB-1.1.0/stage2/builtins.c 2007-05-09 13:53:22.000000000 +0200
+++ TrustedGRUB-1.1.0-gcc4/stage2/builtins.c 2007-08-27 14:01:27.000000000 +0200
@@ -5562,7 +5562,7 @@ toggle_func(char *arg, int flags)
COMMAND_TRIGGER,
};
- static int process_var(int bl, int var, char *start, char *end)
+ int process_var(int bl, int var, char *start, char *end)
{
char *p, origvar, *origvarp, origval, *v;
@@ -5622,7 +5622,7 @@ toggle_func(char *arg, int flags)
return 0;
}
- static int process_block(int bl, char *start, char *end)
+ int process_block(int bl, char *start, char *end)
{
char *p = start;
int var = 0;
@@ -5843,7 +5843,7 @@ bad_arg:
void toggle_trigger_init(void)
{
- static int detect_vmware(void)
+ int detect_vmware(void)
{
#ifndef GRUB_UTIL
char *start = (char *)0xc0000;
diff -pruN TrustedGRUB-1.1.0/stage2/fsys_ntfs.c TrustedGRUB-1.1.0-gcc4/stage2/fsys_ntfs.c
--- TrustedGRUB-1.1.0/stage2/fsys_ntfs.c 2007-05-09 13:53:22.000000000 +0200
+++ TrustedGRUB-1.1.0-gcc4/stage2/fsys_ntfs.c 2007-08-27 16:54:43.000000000 +0200
@@ -246,7 +246,10 @@ static int get_next_run(RUNL *runl){
n = t&0xf;
runl->clen = 0; v = 1;
while(n--) {
- runl->clen += v * *((__u8 *)runl->ptr)++;
+
+// runl->clen += v * *((__u8 *)runl->ptr)++;
+ runl->clen += v * *((__u8 *)runl->ptr);
+ runl->ptr++;
v <<= 8;
}
n = (t>>4)&0xf;
@@ -256,7 +259,9 @@ static int get_next_run(RUNL *runl){
int c = 0;
v = 1;
while(n--) {
- c += v * *((__u8 *)runl->ptr)++;
+// c += v * *((__u8 *)runl->ptr)++;
+ c += v * *((__u8 *)runl->ptr);
+ runl->ptr++;
v <<= 8;
}
if(c & (v>>1)) c -= v;
diff -pruN TrustedGRUB-1.1.0/stage2/stage2.c TrustedGRUB-1.1.0-gcc4/stage2/stage2.c
--- TrustedGRUB-1.1.0/stage2/stage2.c 2007-05-09 13:53:22.000000000 +0200
+++ TrustedGRUB-1.1.0-gcc4/stage2/stage2.c 2007-08-27 16:55:21.000000000 +0200
@@ -259,7 +259,7 @@ run_menu (char *menu_entries, char *conf
/* nested function, we need the code in multiple places */
- static void set_bar_to(int i)
+ void set_bar_to(int i)
{
first_entry = i - 5;
entryno = 5;
@@ -280,7 +280,7 @@ run_menu (char *menu_entries, char *conf
}
/* search through menu_entries once around */
- static int search_menu(char *buf, int current, int direction, int advance)
+ int search_menu(char *buf, int current, int direction, int advance)
{
int i;
/* make direction a delta */
--- TrustedGRUB-1.1.0/stage2/disk_io.c 2007-05-12 10:19:32.000000000 +0200
+++ TrustedGRUB-1.1.3/stage2/disk_io.c 2009-06-10 14:05:41.000000000 +0200
@@ -1827,9 +1915,9 @@ grub_read (char *buf, int len)
if (measure_kernel)
{
#ifdef DEBUG
- printf("Kernel: Data is in memory -> copying %d Bytes at position: %d\n", len, filepos);
+ printf("Kernel: Data is in memory -> copying %d Bytes at file position: %d \n", len, filepos);
#endif
- memcpy(buf, RAW_ADDR(kernel_real_addr + filepos), len);
+ memcpy(buf, (char*)(RAW_ADDR(kernel_real_addr + filepos)), len);
return len;
}
/* END TCG EXTENSION */
--- TrustedGRUB-1.1.0/stage2/stage2.c 2009-06-10 14:28:44.000000000 +0200
+++ TrustedGRUB-1.1.3/stage2/stage2.c 2009-06-10 14:05:41.000000000 +0200
@@ -512,10 +512,13 @@ menu_restart:
/* print shortcut buffer */
gotoxy(5, 3);
if (search_mode)
+ {
+ x = search_direction ? '?' : '/';
grub_printf("%c%s%c%c%c%c",
- x, search_buf, x = search_direction ? '?' : '/',
+ x, search_buf, x,
DISP_HORIZ,
search_found >= 0 ? DISP_HORIZ : 'X', DISP_HORIZ);
+ }
else if (shortcut_buf[0])
grub_printf("<%s..>", shortcut_buf);
else
--- TrustedGRUB-1.1.0/grub/asmstub.c 2007-05-09 13:53:22.000000000 +0200
+++ TrustedGRUB-1.1.3/grub/asmstub.c 2009-06-10 14:39:23.000000000 +0200
@@ -269,14 +269,17 @@ stop (void)
long tcg_check_tpm (void)
{
+ return 0;
}
long check_for_tpm (void)
{
+ return 0;
}
long tpm_present (void)
{
+ return 0;
}
void tcg_hash_extend_pcr (void)