Hello community, here is the log from the commit of package grub checked in at Thu Aug 24 17:59:33 CEST 2006. -------- --- arch/i386/grub/grub.changes 2006-07-17 15:29:59.000000000 +0200 +++ grub/grub.changes 2006-08-24 17:22:32.000000000 +0200 @@ -1,0 +2,5 @@ +Thu Aug 24 17:22:19 CEST 2006 - snwint@suse.de + +- support latest gfxmenu + +------------------------------------------------------------------- Old: ---- grub-gfxmenu-v7.diff New: ---- grub-gfxmenu-v8.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ grub.spec ++++++ --- /var/tmp/diff_new_pack.sVToy0/_old 2006-08-24 17:56:18.000000000 +0200 +++ /var/tmp/diff_new_pack.sVToy0/_new 2006-08-24 17:56:18.000000000 +0200 @@ -18,7 +18,7 @@ License: GPL Group: System/Boot Version: 0.97 -Release: 16 +Release: 18 Source0: %{name}-%{version}.tar.gz Source1: installgrub Source2: grubonce @@ -26,7 +26,7 @@ Patch1: use_ferror.diff Patch2: grub-R Patch3: bad-assert-sideeffect -Patch4: %{name}-gfxmenu-v7.diff +Patch4: %{name}-gfxmenu-v8.diff Patch5: reiser-unpack Patch6: chainloader-devicefix Patch7: %{name}-%{version}-devicemap.diff @@ -180,6 +180,8 @@ exit 0 %changelog -n grub +* Thu Aug 24 2006 - snwint@suse.de +- support latest gfxmenu * Mon Jul 17 2006 - snwint@suse.de - extended gfxmenu interface to pass options for 'module' lines (#160066) - merged various gfxmenu patch fragments into one patch ++++++ grub-gfxmenu-v7.diff -> grub-gfxmenu-v8.diff ++++++ --- arch/i386/grub/grub-gfxmenu-v7.diff 2006-07-17 15:22:53.000000000 +0200 +++ grub/grub-gfxmenu-v8.diff 2006-08-24 17:21:01.000000000 +0200 @@ -61,7 +61,7 @@ getrtsecs (void) --- stage2/asm.S +++ stage2/asm.S -@@ -1614,6 +1614,301 @@ +@@ -1614,6 +1614,286 @@ popl %ebp ret @@ -94,6 +94,7 @@ + + movl 8(%ebp),%edx + movl %edx,%edi ++ leal gfx_ofs_sys_cfg(%edx),%esi + andl $0xf,%edi + shrl $4,%edx + @@ -103,26 +104,12 @@ + .code16 + + pushw %ds -+ + movw %dx,%ds -+ leal gfx_ofs_sys_cfg(%di),%esi -+ movl gfx_ofs_mem_file(%di),%eax -+ movl gfx_ofs_mem_cur(%di),%ebx -+ movl gfx_ofs_mem_max(%di),%ecx -+ movw %ds,%dx -+ -+ /* basically just a lcall, but we need %edi */ -+ pushw %cs -+ pushw $gfx_init_50 -+ pushl gfx_ofs_jmp_table + 4 * 0 (%di) -+ -+ movl gfx_ofs_mem_align(%di),%edi -+ -+ lret -+ -+gfx_init_50: -+ movl $0,%ebx -+ adcl $0,%ebx ++ ++ lcall *gfx_ofs_jmp_table + 4 * 0 (%di) ++ ++ sbbl %ebx,%ebx ++ negl %ebx + + popw %ds + @@ -132,8 +119,7 @@ + popl %ebp + + movl %ebx,%eax -+ negl %ebx -+ incl %ebx ++ xorl $1,%ebx + movl 8(%ebp),%edx + movl %ebx,gfx_ofs_ok(%edx) + @@ -221,6 +207,7 @@ + + movl 8(%ebp),%edx + movl %edx,%ebx ++ leal gfx_ofs_sys_cfg(%edx),%esi + andl $0xf,%ebx + shrl $4,%edx + @@ -232,16 +219,14 @@ + pushw %ds + + movw %dx,%ds -+ shll $4,%edx ++ + movl gfx_ofs_cmdline(%bx),%edi -+ subl %edx,%edi -+ movw gfx_ofs_cmdline_len(%bx),%cx -+ movw gfx_ofs_timeout(%bx),%ax -+ imulw $18,%ax ++ movl gfx_ofs_cmdline_len(%bx),%ecx ++ movl gfx_ofs_timeout(%bx),%eax ++ imull $18,%eax + -+ pushl %ebp + lcall *gfx_ofs_jmp_table + 4 * 2 (%bx) -+ popl %ebp ++ + movl %eax,%ecx + + popw %ds @@ -304,7 +289,7 @@ + shll $4,%edx + + subw $sizeof_menu_desc,%sp -+ movw %sp,%bp ++ movw %esp,%ebp + + movl gfx_ofs_menu_entries(%bx),%eax + movw %ax,menu_entries(%bp) @@ -330,9 +315,9 @@ + movl gfx_ofs_args_entry_len(%bx),%eax + movw %ax,menu_arg_size(%bp) + -+ movw %bp,%si -+ pushw %ss -+ popw %es ++ movl %ss,%esi ++ shll $4,%esi ++ addl %ebp,%esi + + lcall %ds: *gfx_ofs_jmp_table + 4 * 3 (%bx) + @@ -411,35 +396,30 @@ &builtin_hiddenmenu, --- stage2/shared.h +++ stage2/shared.h -@@ -374,6 +374,27 @@ +@@ -374,6 +374,22 @@ #endif /* WITHOUT_LIBC_STUBS */ +/* see typedef gfx_data_t below */ +#define gfx_ofs_ok 0x00 -+#define gfx_ofs_mem_start 0x04 -+#define gfx_ofs_mem_cur 0x08 -+#define gfx_ofs_mem_max 0x0c -+#define gfx_ofs_code_seg 0x10 -+#define gfx_ofs_jmp_table 0x14 -+#define gfx_ofs_sys_cfg 0x44 -+#define gfx_ofs_cmdline 0x64 -+#define gfx_ofs_cmdline_len 0x68 -+#define gfx_ofs_menu_list 0x6c -+#define gfx_ofs_menu_default_entry 0x70 -+#define gfx_ofs_menu_entries 0x74 -+#define gfx_ofs_menu_entry_len 0x78 -+#define gfx_ofs_args_list 0x7c -+#define gfx_ofs_args_entry_len 0x80 -+#define gfx_ofs_timeout 0x84 -+#define gfx_ofs_mem_file 0x88 -+#define gfx_ofs_mem_align 0x8c ++#define gfx_ofs_code_seg 0x04 ++#define gfx_ofs_jmp_table 0x08 ++#define gfx_ofs_sys_cfg 0x38 ++#define gfx_ofs_cmdline 0x6c ++#define gfx_ofs_cmdline_len 0x70 ++#define gfx_ofs_menu_list 0x74 ++#define gfx_ofs_menu_default_entry 0x78 ++#define gfx_ofs_menu_entries 0x7c ++#define gfx_ofs_menu_entry_len 0x80 ++#define gfx_ofs_args_list 0x84 ++#define gfx_ofs_args_entry_len 0x88 ++#define gfx_ofs_timeout 0x8c + + #ifndef ASM_FILE /* * Below this should be ONLY defines and other constructs for C code. -@@ -595,6 +616,41 @@ +@@ -595,6 +611,38 @@ extern int default_entry; extern int current_entryno; @@ -451,10 +431,9 @@ + */ +typedef struct { + unsigned ok; /* set while we're in graphics mode */ -+ unsigned mem_start, mem_cur, mem_max; + unsigned code_seg; /* code segment of binary graphics code */ + unsigned jmp_table[12]; /* link to graphics functions */ -+ unsigned char sys_cfg[32]; /* sys_cfg[0]: identifies boot loader (grub == 2) */ ++ unsigned char sys_cfg[52]; /* sys_cfg[0]: identifies boot loader (grub == 2) */ + char *cmdline; /* command line returned by gfx_input() */ + unsigned cmdline_len; /* length of the above */ + char *menu_list; /* list of menu entries, each of fixed length (menu_entry_len) */ @@ -464,8 +443,6 @@ + char *args_list; /* same structure as menu_list, menu_entries entries */ + unsigned args_entry_len; /* one entry */ + unsigned timeout; /* in seconds (0: no timeout) */ -+ unsigned mem_file; /* aligned gfx file start */ -+ unsigned mem_align; /* aligned cpio file start */ +} __attribute__ ((packed)) gfx_data_t; + +extern gfx_data_t *graphics_data; @@ -505,7 +482,7 @@ printf ("\ Press enter to boot the selected OS or \'p\' to enter a\n\ password to unlock the next set of features."); -@@ -753,6 +761,459 @@ +@@ -753,6 +761,493 @@ } @@ -597,7 +574,7 @@ +{ + if( + *(unsigned *) buf == 0x0b2d97f00 && /* magic id */ -+ (buf[4] >= 5 && buf[4] <= 7) /* version 5 - 7 */ ++ (buf[4] == 8) /* version 8 */ + ) { + return *(unsigned *) (buf + 8); + } @@ -609,23 +586,23 @@ +/* + * Search cpio archive for gfx file. + */ -+static unsigned find_file(unsigned char *buf, unsigned len, unsigned *gfx_file_start) ++static unsigned find_file(unsigned char *buf, unsigned len, unsigned *gfx_file_start, unsigned *file_len) +{ -+ unsigned i, fname_len, flen, code_start = 0; ++ unsigned i, fname_len, code_start = 0; + + *gfx_file_start = 0; + + for(i = 0; i < len;) { + if((len - i) >= 0x1a && (buf[i] + (buf[i + 1] << 8)) == 0x71c7) { + fname_len = *(unsigned short *) (buf + i + 20); -+ flen = *(unsigned short *) (buf + i + 24) + (*(unsigned short *) (buf + i + 22) << 16); ++ *file_len = *(unsigned short *) (buf + i + 24) + (*(unsigned short *) (buf + i + 22) << 16); + i += 26 + fname_len; + i = ((i + 1) & ~1); + if((code_start = magic_ok(buf + i))) { + *gfx_file_start = i; + return code_start; + } -+ i += flen; ++ i += *file_len; + i = ((i + 1) & ~1); + } + else { @@ -645,6 +622,26 @@ + return u; +} + ++static void sleep(int delay) ++{ ++ int tick, last_tick = currticks(); ++ ++ delay *= 18; ++ ++ while(delay--) { ++ while((tick = currticks()) == last_tick) { } ++ last_tick = tick; ++ } ++} ++ ++static void wait_for_key() ++{ ++ printf("Press a key to continue..."); ++ getkey(); ++ printf("\r \r"); ++} ++ ++ +/* + * Leave that much space on the heap. Everything else goes to the graphics + * functions. @@ -652,9 +649,21 @@ + * 0x2000 is _not_ enough + */ +#define MIN_HEAP_SIZE 0x4000 ++#define MIN_GFX_FREE 0x1000 + -+/* gfx code needs at least this much free memory */ -+#define MIN_GFX_FREE 0xc000 ++#define SC_BOOTLOADER 0 ++#define SC_FAILSAFE 3 ++#define SC_SYSCONFIG_SIZE 4 ++#define SC_BOOTLOADER_SEG 8 ++#define SC_XMEM_0 24 ++#define SC_XMEM_1 26 ++#define SC_XMEM_2 28 ++#define SC_XMEM_3 30 ++#define SC_FILE 32 ++#define SC_ARCHIVE_START 36 ++#define SC_ARCHIVE_END 40 ++#define SC_MEM0_START 44 ++#define SC_MEM0_END 48 + +/* + * Does normally not return. @@ -663,14 +672,15 @@ +run_graphics_menu (char *menu_entries, char *config_entries, int num_entries, + char *heap, int entryno) +{ -+ unsigned char *buf; -+ unsigned u, buf_size, code_start, file_start; ++ unsigned char *buf, *buf_ext; ++ unsigned buf_size, buf_ext_size, code_start, file_start; + char *s, *t, *t2, *cfg, *new_config, *p; + char *saved_heap; -+ int i, j, max_len; ++ int i, j, max_len, gfx_file_size, verbose; + int selected_entry; + gfx_data_t *gfx_data; + char *cmd_buf; ++ unsigned mem0_start, mem0_end, file_len; + + /* + * check gfx_data_t struct offsets for consistency; gcc will optimize away @@ -682,9 +692,6 @@ + extern void wrong_struct_size(void); + #define gfx_ofs_check(a) if(gfx_ofs_##a != (char *) &gfx_data->a - (char *) gfx_data) wrong_struct_size(); + gfx_ofs_check(ok); -+ gfx_ofs_check(mem_start); -+ gfx_ofs_check(mem_cur); -+ gfx_ofs_check(mem_max); + gfx_ofs_check(code_seg); + gfx_ofs_check(jmp_table); + gfx_ofs_check(sys_cfg); @@ -697,8 +704,6 @@ + gfx_ofs_check(args_list); + gfx_ofs_check(args_entry_len); + gfx_ofs_check(timeout); -+ gfx_ofs_check(mem_file); -+ gfx_ofs_check(mem_align); + #undef gfx_ofs_check + } + @@ -708,7 +713,14 @@ + heap += sizeof *gfx_data; + memset(gfx_data, 0, sizeof *gfx_data); + -+ gfx_data->sys_cfg[0] = 2; /* bootloader: grub */ ++ gfx_data->sys_cfg[SC_BOOTLOADER] = 2; /* bootloader: grub */ ++ gfx_data->sys_cfg[SC_SYSCONFIG_SIZE] = 52; /* config data size */ ++ *(unsigned short *) (gfx_data->sys_cfg + SC_BOOTLOADER_SEG) = (unsigned) gfx_data >> 4; /* segment */ ++ gfx_data->sys_cfg[SC_XMEM_0] = 0x21; /* 1MB @ 2MB */ ++ gfx_data->sys_cfg[SC_XMEM_1] = 0x41; /* 1MB @ 4MB */ ++ verbose = (*(unsigned char *) 0x417) & 3 ? 1 : 0; /* SHIFT pressed */ ++ gfx_data->sys_cfg[SC_FAILSAFE] = verbose; ++ + gfx_data->timeout = grub_timeout >= 0 ? grub_timeout : 0; + + @@ -773,123 +785,121 @@ + + /* get memory area to be used by graphics functions */ + ++ /* use 1MB starting at 2MB as file buffer */ ++ buf_ext = (unsigned char *) (2 << 20); ++ buf_ext_size = 1 << 20; ++ ++ /* must be 16-byte aligned */ + buf = (unsigned char *) (((unsigned) heap + 0xf) & ~0xf); + + buf_size = stack_ptr() - buf - MIN_HEAP_SIZE; + buf_size &= ~0xf; + -+ /* too small */ -+ if(buf_size < 0x10000) return; ++ mem0_start = (unsigned) buf; ++ mem0_end = mem0_start + buf_size; + -+ gfx_data->mem_start = (unsigned) buf; -+ gfx_data->mem_max = gfx_data->mem_start + buf_size; -+ -+#if 0 -+ printf("graphics menu\n"); -+ printf( -+ "heap = 0x%x, buf = 0x%x (0x%x bytes), graphics_file = %s\n", -+ heap, gfx_data->mem_start, buf_size, graphics_file -+ ); -+ getkey(); -+#endif ++ if(verbose) { ++ printf("low memory 0x%x - 0x%x (%d bytes)\n", mem0_start, mem0_end, buf_size); ++ wait_for_key(); ++ } + + heap += buf_size; + -+ + /* read the file */ + + if(!grub_open(graphics_file)) { -+ printf("graphics file \"%s\" missing, press a key to continue...\n", graphics_file); -+ getkey(); ++ printf("%s: file not found\n", graphics_file); ++ sleep(5); ++ heap = saved_heap; + return; + } + -+ i = grub_read(buf, buf_size); ++ gfx_file_size = grub_read(buf_ext, buf_ext_size); + + grub_close(); + -+ if(i <= 0) { -+ printf("error reading \"%s\", press a key to continue...\n", graphics_file); -+ getkey(); ++ if(gfx_file_size <= 0) { ++ printf("%s: read error\n", graphics_file); ++ sleep(5); ++ heap = saved_heap; + return; + } + -+ /* besides the file, we need some working memory, too */ -+ if(i + MIN_GFX_FREE + 0x0f >= (int) buf_size) { -+ printf("file \"%s\" too large, press a key to continue...\n", graphics_file); -+ printf("i is %d, MIN_GFX_FREE is %d, buf_size is %d\n",i,MIN_GFX_FREE,buf_size); -+ getkey(); -+ return; ++ if(verbose) { ++ printf("%s: %d bytes (%d bytes left)\n", graphics_file, gfx_file_size, buf_ext_size - gfx_file_size); ++ wait_for_key(); + } + -+ gfx_data->mem_cur = gfx_data->mem_start + ((i + 0x0f + 3) & ~3); /* align it */ -+ -+#if 0 -+ printf("image: %d bytes (%d bytes left)\n", i, gfx_data->mem_max - gfx_data->mem_cur); -+ getkey(); -+#endif -+ -+ + /* locate file inside cpio archive */ -+ if(!(code_start = find_file(buf, i, &file_start))) { -+ printf("\"%s\" has wrong format, press a key to continue...\n", graphics_file); -+ getkey(); ++ if(!(code_start = find_file(buf_ext, gfx_file_size, &file_start, &file_len))) { ++ printf("%s: invalid file format\n", graphics_file); ++ sleep(5); ++ heap = saved_heap; + return; + } + -+ -+ /* align it */ -+ u = (-(code_start + gfx_data->mem_start + file_start)) & 0x0f; -+ gfx_data->mem_align = gfx_data->mem_start + u; -+ gfx_data->mem_file = gfx_data->mem_align + file_start; -+ if(u) { -+ memcpy((void *) gfx_data->mem_align, (void *) gfx_data->mem_start, i); ++ if(verbose) { ++ printf("init: start 0x%x, len %d; code offset 0x%x\n", file_start, file_len, code_start); ++ wait_for_key(); + } + -+ /* init interface to graphics functions */ ++ if(file_len - code_start + MIN_GFX_FREE > buf_size) { ++ printf("not enough free memory: %d extra bytes need\n", file_len - code_start + MIN_GFX_FREE - buf_size); ++ sleep(5); ++ heap = saved_heap; ++ return; ++ } + -+ code_start += gfx_data->mem_file; ++ memcpy((void *) buf, (void *) (buf_ext + file_start + code_start), file_len - code_start); + -+#if 0 -+ printf("code_start: 0x%x, file_start: 0x%x, mem_align = 0x%x, mem_file = 0x%x\n", -+ code_start, file_start, gfx_data->mem_align, gfx_data->mem_file -+ ); -+ getkey(); -+#endif -+ -+ gfx_data->code_seg = code_start >> 4; ++ mem0_start += file_len - code_start; ++ mem0_start = (mem0_start + 3) & ~3; /* align */ + -+#if 0 -+ printf("code start = 0x%x, code_seg = 0x%x\n", code_start, gfx_data->code_seg); -+#endif ++ /* init interface to graphics functions */ + -+ for(i = 0; (unsigned) i < sizeof gfx_data->jmp_table / sizeof *gfx_data->jmp_table; i++) { -+ gfx_data->jmp_table[i] = (gfx_data->code_seg << 16) + ((unsigned short *) code_start)[i]; ++ *(unsigned *) (gfx_data->sys_cfg + SC_FILE) = (unsigned) buf_ext + file_start; ++ *(unsigned *) (gfx_data->sys_cfg + SC_ARCHIVE_START) = (unsigned) buf_ext; ++ *(unsigned *) (gfx_data->sys_cfg + SC_ARCHIVE_END) = (unsigned) buf_ext + gfx_file_size; ++ *(unsigned *) (gfx_data->sys_cfg + SC_MEM0_START) = mem0_start; ++ *(unsigned *) (gfx_data->sys_cfg + SC_MEM0_END) = mem0_end; ++ ++ gfx_data->code_seg = (unsigned) buf >> 4; ++ ++ if(verbose) { ++ printf("init 0x%x, archive 0x%x - 0x%x, low mem 0x%x - 0x%x\ncode seg 0x%x\n", ++ (unsigned) buf_ext + file_start, ++ (unsigned) buf_ext, (unsigned) buf_ext + gfx_file_size, ++ mem0_start, mem0_end, gfx_data->code_seg ++ ); ++ wait_for_key(); + } + -+#if 0 -+ for(i = 0; i < 12; i++) { -+ printf("%d: 0x%x\n", i, gfx_data->jmp_table[i]); ++ for(i = 0; (unsigned) i < sizeof gfx_data->jmp_table / sizeof *gfx_data->jmp_table; i++) { ++ gfx_data->jmp_table[i] = (gfx_data->code_seg << 16) + ((unsigned short *) buf)[i]; + } + -+ for(i = 0; i < gfx_data->menu_entries; i++) { -+ printf(">%s< - >%s<\n", -+ gfx_data->menu_list + i * gfx_data->menu_entry_len, -+ gfx_data->args_list + i * gfx_data->args_entry_len -+ ); -+ } ++ if(verbose) { ++ for(i = 0; i < 12; i++) { ++ printf("%d: 0x%x\n", i, gfx_data->jmp_table[i]); ++ } + -+ printf("def: >%s<\n", gfx_data->menu_default_entry); -+#endif ++ for(i = 0; i < gfx_data->menu_entries; i++) { ++ printf("\"%s\" -- \"%s\"\n", ++ gfx_data->menu_list + i * gfx_data->menu_entry_len, ++ gfx_data->args_list + i * gfx_data->args_entry_len ++ ); ++ } + ++ printf("default: \"%s\"\n", gfx_data->menu_default_entry); ++ wait_for_key(); ++ } + + /* switch to graphics mode */ + + if(gfx_init(gfx_data)) { -+#if 0 -+ printf("gfx_init failed\n"); -+ getkey(); -+#endif ++ printf("graphics initialization failed\n"); ++ sleep(5); ++ heap = saved_heap; + return; + } + @@ -902,6 +912,7 @@ + gfx_done(gfx_data); + grub_timeout = -1; + ++ heap = saved_heap; + return; + } + @@ -965,7 +976,7 @@ static int get_line_from_config (char *cmdline, int maxlen, int read_from_file) { -@@ -1062,9 +1523,12 @@ +@@ -1062,9 +1557,12 @@ } else { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org