Hello community, here is the log from the commit of package lilo checked in at Tue Sep 30 14:11:46 CEST 2008. -------- --- arch/i386/lilo/lilo.changes 2008-09-29 17:17:07.000000000 +0200 +++ /mounts/work_src_done/STABLE/lilo/lilo.changes 2008-09-30 11:46:34.000000000 +0200 @@ -1,0 +2,5 @@ +Tue Sep 30 11:45:54 CEST 2008 - olh@suse.de + +- handle memory for initrd download correctly + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- yaboot-22.8-r1129.tar.bz2 New: ---- yaboot-22.8-r1138.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lilo.spec ++++++ --- /var/tmp/diff_new_pack.m29492/_old 2008-09-30 14:11:33.000000000 +0200 +++ /var/tmp/diff_new_pack.m29492/_new 2008-09-30 14:11:33.000000000 +0200 @@ -21,7 +21,7 @@ Name: lilo ExclusiveArch: ppc ppc64 %ix86 x86_64 -%define yaboot_vers 22.8-r1129 +%define yaboot_vers 22.8-r1138 Group: System/Boot License: BSD 3-Clause Summary: The Linux Loader, a Boot Menu @@ -50,7 +50,7 @@ BuildRequires: gcc-32bit glibc-devel-32bit libgcc42-32bit libmudflap42-32bit %endif Version: 22.8 -Release: 26 +Release: 27 Source0: lilo-ppc-%{version}.tar.bz2 Source1: http://penguinppc.org/projects/yaboot/yaboot-%{yaboot_vers}.tar.bz2 Source86: lilo-%{version}.src.tar.bz2 @@ -212,6 +212,8 @@ %endif %doc %{_mandir}/*/* %changelog +* Tue Sep 30 2008 olh@suse.de +- handle memory for initrd download correctly * Mon Sep 29 2008 olh@suse.de - do not force zImage if root is on iscsi (bnc#417539) yaboot can handle iscsi now ++++++ lilo-ppc-22.8.tar.bz2 ++++++ ++++++ yaboot-22.8-r1129.tar.bz2 -> yaboot-22.8-r1138.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-22.8-r1129/Changelog.SuSE new/yaboot-22.8-r1138/Changelog.SuSE --- old/yaboot-22.8-r1129/Changelog.SuSE 2008-09-26 08:58:07.000000000 +0200 +++ new/yaboot-22.8-r1138/Changelog.SuSE 2008-09-30 11:42:25.000000000 +0200 @@ -1,4 +1,46 @@ ------------------------------------------------------------------------ +r1138 | olh | 2008-09-30 09:42:25 +0000 (Tue, 30 Sep 2008) | 1 line +Changed paths: + M /trunk/yaboot/second/yaboot.c + +read initrd only in chunks for non-network devices +------------------------------------------------------------------------ +r1137 | olh | 2008-09-30 09:35:14 +0000 (Tue, 30 Sep 2008) | 1 line +Changed paths: + M /trunk/yaboot/second/yaboot.c + +increment claim_base for initrd memory in 64k instead of 1MB steps +------------------------------------------------------------------------ +r1136 | olh | 2008-09-30 09:34:26 +0000 (Tue, 30 Sep 2008) | 1 line +Changed paths: + M /trunk/yaboot/second/yaboot.c + +try to claim initrd memory up to 128MB +------------------------------------------------------------------------ +r1135 | olh | 2008-09-30 09:31:28 +0000 (Tue, 30 Sep 2008) | 1 line +Changed paths: + M /trunk/yaboot/second/yaboot.c + +base allocation size on filesize for tftp downloads +------------------------------------------------------------------------ +r1134 | olh | 2008-09-30 09:28:33 +0000 (Tue, 30 Sep 2008) | 1 line +Changed paths: + M /trunk/yaboot/second/yaboot.c + +increment claim_base for initrd memory correctly +------------------------------------------------------------------------ +r1133 | olh | 2008-09-30 08:56:56 +0000 (Tue, 30 Sep 2008) | 1 line +Changed paths: + M /trunk/yaboot/second/yaboot.c + +make claim_base an unsigned long +------------------------------------------------------------------------ +r1132 | olh | 2008-09-30 08:55:36 +0000 (Tue, 30 Sep 2008) | 1 line +Changed paths: + M /trunk/yaboot/second/yaboot.c + +Lindent yaboot.c +------------------------------------------------------------------------ r1129 | olh | 2008-09-26 06:58:07 +0000 (Fri, 26 Sep 2008) | 1 line Changed paths: M /trunk/yaboot/include/file.h diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-22.8-r1129/Makefile new/yaboot-22.8-r1138/Makefile --- old/yaboot-22.8-r1129/Makefile 2008-09-25 15:32:32.000000000 +0200 +++ new/yaboot-22.8-r1138/Makefile 2008-09-25 15:32:32.000000000 +0200 @@ -6,7 +6,7 @@ include Config -VERSION = 22.8-r1129 +VERSION = 22.8-r1138 # Debug mode (spam/verbose) DEBUG = 0 # make install vars diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yaboot-22.8-r1129/second/yaboot.c new/yaboot-22.8-r1138/second/yaboot.c --- old/yaboot-22.8-r1129/second/yaboot.c 2008-09-26 08:58:07.000000000 +0200 +++ new/yaboot-22.8-r1138/second/yaboot.c 2008-09-30 11:42:25.000000000 +0200 @@ -59,7 +59,7 @@ static char *hard_coded_bootpath(char *bootpath) { #ifdef HARD_CODED_BOOTPATH - const char path[] = HARD_CODED_BOOTPATH ; + const char path[] = HARD_CODED_BOOTPATH; prom_printf("original bootpath: '%s'\n using hardcoded bootpath: '%s'\n", bootpath, path); bootpath = malloc(strlen(path) + 1); if (bootpath) @@ -78,8 +78,8 @@ #define _ALIGN(addr,size) (((addr)+size-1)&(~(size-1))) #define MAX_HEADERS 32 -#define SLES9_ZIMAGE_BASE ((4 * 1024 * 1024)) /* the zImage header used in SLES8/9 is not relocatable */ -#define SLES9_ZIMAGE_SIZE ((7 * 1024 * 1024)) /* its a binary blob from 2.4 kernel source ... */ +#define SLES9_ZIMAGE_BASE ((4 * 1024 * 1024)) /* the zImage header used in SLES8/9 is not relocatable */ +#define SLES9_ZIMAGE_SIZE ((7 * 1024 * 1024)) /* its a binary blob from 2.4 kernel source ... */ #define MALLOCADDR ((2 * 1024 * 1024) + (512 * 1024)) #define MALLOCSIZE ((1 * 1024 * 1024) + (512 * 1024)) #define CLAIM_END (128 * 1024 * 1024) /* FIXME: look at /memory/reg */ @@ -219,9 +219,7 @@ for (i = 0; i < 6; i++) if (b->u.n.mac[i]) { sprintf(config_file_name_ether_mac, config_file_name_ether_mac_template, - b->u.n.mac[0], b->u.n.mac[1], - b->u.n.mac[2], b->u.n.mac[3], - b->u.n.mac[4], b->u.n.mac[5]); + b->u.n.mac[0], b->u.n.mac[1], b->u.n.mac[2], b->u.n.mac[3], b->u.n.mac[4], b->u.n.mac[5]); break; } break; @@ -349,10 +347,7 @@ e->e_ident[EI_MAG1] == ELFMAG1 && e->e_ident[EI_MAG2] == ELFMAG2 && e->e_ident[EI_MAG3] == ELFMAG3 && - e->e_ident[EI_CLASS] == ELFCLASS32 && - e->e_ident[EI_DATA] == ELFDATA2MSB && - (e->e_type == ET_EXEC || e->e_type == ET_DYN) && - e->e_machine == EM_PPC); + e->e_ident[EI_CLASS] == ELFCLASS32 && e->e_ident[EI_DATA] == ELFDATA2MSB && (e->e_type == ET_EXEC || e->e_type == ET_DYN) && e->e_machine == EM_PPC); } static int is_elf64(loadinfo_t * loadinfo) @@ -364,9 +359,7 @@ e->e_ident[EI_MAG2] == ELFMAG2 && e->e_ident[EI_MAG3] == ELFMAG3 && e->e_ident[EI_CLASS] == ELFCLASS64 && - e->e_ident[EI_DATA] == ELFDATA2MSB && - (e->e_type == ET_EXEC || e->e_type == ET_DYN) && - e->e_machine == EM_PPC64); + e->e_ident[EI_DATA] == ELFDATA2MSB && (e->e_type == ET_EXEC || e->e_type == ET_DYN) && e->e_machine == EM_PPC64); } static int load_elf32(struct boot_file_t *file, loadinfo_t * loadinfo) @@ -638,11 +631,9 @@ #ifdef COLOR_TEST for (i = 0; i < 16; i++) { prom_printf("\x1b[%d;%dm\x1b[1;47m%s \x1b[2;40m %s\n", - ansi_color_table[i].index, - ansi_color_table[i].value, ansi_color_table[i].name, ansi_color_table[i].name); + ansi_color_table[i].index, ansi_color_table[i].value, ansi_color_table[i].name, ansi_color_table[i].name); prom_printf("\x1b[%d;%dm\x1b[1;37m%s \x1b[2;30m %s\n", - ansi_color_table[i].index, - ansi_color_table[i].value + 10, ansi_color_table[i].name, ansi_color_table[i].name); + ansi_color_table[i].index, ansi_color_table[i].value + 10, ansi_color_table[i].name, ansi_color_table[i].name); } prom_printf("\x1b[1;37m\x1b[2;40m"); #endif /* COLOR_TEST */ @@ -799,8 +790,7 @@ } } prom_printf(" ___________________\n< Permission denied >\n -------------------\n" - " \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n" - " ||----w |\n || ||\n"); + " \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n" " ||----w |\n || ||\n"); prom_sleep(4); prom_interpret("reset-all"); } @@ -998,10 +988,11 @@ struct boot_file_t file; int result; + int chunksize; enum get_params_result gpr; struct boot_param_t params; struct path_description *kernel, *rd; - void *claim_base; + unsigned long claim_base; void *initrd_base; unsigned long initrd_size; kernel_entry_t kernel_entry; @@ -1100,41 +1091,46 @@ } gpr = GET_PARAMS_STOP; } else { -#define INITRD_CHUNKSIZE 0x400000 /* put initrd after the kernels final location */ /* it seems that the B50 has trouble with a location between * real-base and 32M. The kernel crashes at random places in * prom_init, usually in opening display. */ if (64 == _cpu) - claim_base = (void *)loadinfo.memsize; + claim_base = loadinfo.memsize; else - claim_base = (void *)(32 * 1024 * 1024); - for (result = 0; result < 128; result++) { - initrd_base = prom_claim(claim_base, INITRD_CHUNKSIZE, 0); + claim_base = 32 * 1024 * 1024; + if (file.dev_type == TYPE_NET) + chunksize = file.len; + else + chunksize = 4 * 1024 * 1024; + /* try to claim memory up to 128MB */ + while (claim_base + chunksize < 128 * 1024 * 1024) { + initrd_base = prom_claim((void *)claim_base, chunksize, 0); if (initrd_base != (void *)-1) break; - claim_base += (unsigned long)claim_base + (1 * 1024 * 1024); + claim_base += 64 * 1024; } if (initrd_base == (void *)-1) { prom_printf("Claim failed for initrd memory\n"); initrd_base = NULL; } else { - initrd_size = file.fs->read(&file, INITRD_CHUNKSIZE, initrd_base); + initrd_size = file.fs->read(&file, chunksize, initrd_base); if (initrd_size == 0) initrd_base = NULL; - initrd_read = initrd_size; - initrd_more = initrd_base; - while (initrd_read == INITRD_CHUNKSIZE) { /* need to read more? */ - initrd_want = (void *)((unsigned long)initrd_more + INITRD_CHUNKSIZE); - initrd_more = prom_claim(initrd_want, INITRD_CHUNKSIZE, 0); - if (initrd_more != initrd_want) { - prom_printf("Claim failed for initrd memory at %p rc=%p\n", initrd_want, - initrd_more); - break; + if (file.dev_type != TYPE_NET) { + initrd_read = initrd_size; + initrd_more = initrd_base; + while (initrd_read == chunksize) { /* need to read more? */ + initrd_want = (void *)((unsigned long)initrd_more + chunksize); + initrd_more = prom_claim(initrd_want, chunksize, 0); + if (initrd_more != initrd_want) { + prom_printf("Claim failed for initrd memory at %p rc=%p\n", initrd_want, initrd_more); + break; + } + initrd_read = file.fs->read(&file, chunksize, initrd_more); + DEBUG_F(" block at %p rc=%lu\n", initrd_more, initrd_read); + initrd_size += initrd_read; } - initrd_read = file.fs->read(&file, INITRD_CHUNKSIZE, initrd_more); - DEBUG_F(" block at %p rc=%lu\n", initrd_more, initrd_read); - initrd_size += initrd_read; } } file.fs->close(&file); @@ -1162,8 +1158,7 @@ kernel_entry = loadinfo.base + loadinfo.entry - loadinfo.load_loc; DEBUG_F("Kernel entry point = %p\n", kernel_entry); - DEBUG_F("kernel: arg1 = %p,\n" - " arg2 = %08lx,\n" " prom = %p,\n", initrd_base + loadinfo.load_loc, initrd_size, prom); + DEBUG_F("kernel: arg1 = %p,\n" " arg2 = %08lx,\n" " prom = %p,\n", initrd_base + loadinfo.load_loc, initrd_size, prom); DEBUG_F("Entering kernel...\n"); @@ -1276,7 +1271,7 @@ prom_printf("brokenfirmware did not claim executable memory, fixed it myself\n"); sles9_base = prom_claim((void *)SLES9_ZIMAGE_BASE, SLES9_ZIMAGE_SIZE, 0); - if (sles9_base == (void*) - 1) + if (sles9_base == (void *)-1) sles9_base = NULL; DEBUG_F("Allocated %08x bytes @ %p for SLES8/9 install file\n", SLES9_ZIMAGE_SIZE, sles9_base); @@ -1284,17 +1279,18 @@ addr = SLES9_ZIMAGE_BASE + SLES9_ZIMAGE_SIZE; else addr = 64 * 1024; - for ( ; addr < CLAIM_END - MALLOCSIZE; addr += 64*1024) { + for (; addr < CLAIM_END - MALLOCSIZE; addr += 64 * 1024) { /* overlap check */ - if ((addr < (unsigned long)_end || addr + MALLOCSIZE < (unsigned long)_end) && (addr >= (unsigned long)_start || addr + MALLOCSIZE >= (unsigned long)_start)) + if ((addr < (unsigned long)_end || addr + MALLOCSIZE < (unsigned long)_end) + && (addr >= (unsigned long)_start || addr + MALLOCSIZE >= (unsigned long)_start)) continue; /* Allocate some memory for malloc'ator */ - malloc_base = prom_claim((void*)addr , MALLOCSIZE, 0); - if (malloc_base && malloc_base != (void*) -1) + malloc_base = prom_claim((void *)addr, MALLOCSIZE, 0); + if (malloc_base && malloc_base != (void *)-1) break; } if (malloc_base == (void *)-1) { - prom_printf("Can't claim malloc buffer (%x bytes between %08x and %08x)\n", MALLOCSIZE, 64*1024, CLAIM_END - MALLOCSIZE); + prom_printf("Can't claim malloc buffer (%x bytes between %08x and %08x)\n", MALLOCSIZE, 64 * 1024, CLAIM_END - MALLOCSIZE); goto exit; } malloc_init(malloc_base, MALLOCSIZE); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de