]> git.ozlabs.org Git - yaboot.git/commitdiff
Merge branch 'netboot'
authorTony Breeds <tony@bakeyournoodle.com>
Fri, 16 Jul 2010 04:56:12 +0000 (14:56 +1000)
committerTony Breeds <tony@bakeyournoodle.com>
Fri, 16 Jul 2010 04:56:12 +0000 (14:56 +1000)
1  2 
second/yaboot.c

diff --combined second/yaboot.c
index e91b6c7bf5efa0943da4e606866ed020480cba7a,66f288b82aea9eaff21c59ed1fd3bf52c26224b5..5df07608dacb297eda7352fa03c55013ec3d2f64
@@@ -300,6 -300,7 +300,7 @@@ void print_message_file(char *filename
          }
  
       strncpy(msgpath, filename, sizeof(msgpath));
+      msgfile = boot; /* Copy all the original paramters */
       if (!parse_device_path(msgpath, defdev, defpart, "/etc/yaboot.msg", &msgfile)) {
          prom_printf("%s: Unable to parse\n", msgpath);
          goto done;
@@@ -470,6 -471,8 +471,8 @@@ static int load_my_config_file(struct b
       int minlen;
  
       packet = prom_get_netinfo();
+      if (!packet)
+           goto out;
  
       /*
        * First, try to match on mac address with the hardware type
@@@ -988,6 -991,7 +991,7 @@@ int get_params(struct boot_param_t* par
       if (!label && password)
          check_password ("To boot a custom image you must enter the password.");
  
+      params->kernel = boot; /* Copy all the original paramters */
       if (!parse_device_path(imagepath, defdevice, defpart,
                            "/vmlinux", &params->kernel)) {
          prom_printf("%s: Unable to parse\n", imagepath);
                 strncpy(initrdpath, p, 1024);
  
               DEBUG_F("Parsing initrd path <%s>\n", initrdpath);
+              params->rd = boot; /* Copy all the original paramters */
               if (!parse_device_path(initrdpath, defdevice, defpart,
                                      "/root.bin", &params->rd)) {
                    prom_printf("%s: Unable to parse\n", imagepath);
          if (p && *p) {
               DEBUG_F("Parsing sysmap path <%s>\n", p);
               strncpy(sysmappath, p, 1024);
+              params->sysmap = boot; /* Copy all the original paramters */
               if (!parse_device_path(sysmappath, defdevice, defpart,
                                      "/boot/System.map", &params->sysmap)) {
                    prom_printf("%s: Unable to parse\n", imagepath);
@@@ -1047,6 -1053,7 +1053,6 @@@ yaboot_text_ui(void
       void                *sysmap_base;
       unsigned long    sysmap_size;
       kernel_entry_t      kernel_entry;
 -     struct bi_record*        birec;
       char*               loc=NULL;
       loadinfo_t          loadinfo;
       void                *initrd_more,*initrd_want;
          flush_icache_range ((long)loadinfo.base, (long)loadinfo.base+loadinfo.memsize);
          DEBUG_F(" done\n");
  
 -        if (flat_vmlinux) {
 -             /*
 -              * Fill new boot infos (only if booting a vmlinux).
 -              *
 -              * The birec is low on memory, probably inside the malloc pool,
 -              * so we don't write it earlier. At this point, we should not
 -              * use anything coming from the malloc pool.
 -              */
 -             birec = (struct bi_record *)_ALIGN(loadinfo.filesize+(1<<20)-1,(1<<20));
 -
 -             /* We make sure it's mapped. We map only 64k for now, it's
 -              * plenty enough we don't claim since this precise memory
 -              * range may already be claimed by the malloc pool.
 -              */
 -             prom_map (birec, birec, 0x10000);
 -             DEBUG_F("birec at %p\n", birec);
 -             DEBUG_SLEEP;
 -
 -             birec->tag = BI_FIRST;
 -             birec->size = sizeof(struct bi_record);
 -             birec = (struct bi_record *)((ulong)birec + birec->size);
 -
 -             birec->tag = BI_BOOTLOADER_ID;
 -             sprintf( (char *)birec->data, "yaboot");
 -             birec->size = sizeof(struct bi_record) + strlen("yaboot") + 1;
 -             birec = (struct bi_record *)((ulong)birec + birec->size);
 -
 -             birec->tag = BI_MACHTYPE;
 -             birec->data[0] = _machine;
 -             birec->size = sizeof(struct bi_record) + sizeof(ulong);
 -             birec = (struct bi_record *)((ulong)birec + birec->size);
 -
 -             if (sysmap_base) {
 -                  birec->tag = BI_SYSMAP;
 -                  birec->data[0] = (ulong)sysmap_base;
 -                  birec->data[1] = sysmap_size;
 -                  birec->size = sizeof(struct bi_record) + sizeof(ulong)*2;
 -                  birec = (struct bi_record *)((ulong)birec + birec->size);
 -             }
 -             birec->tag = BI_LAST;
 -             birec->size = sizeof(struct bi_record);
 -             birec = (struct bi_record *)((ulong)birec + birec->size);
 -          }
 -
            /* compute the kernel's entry point. */
          kernel_entry = loadinfo.base + loadinfo.entry - loadinfo.load_loc;
  
@@@ -1475,7 -1526,8 +1481,7 @@@ load_elf64(struct boot_file_t *file, lo
          goto bail;
       }
  
 -     /* leave some room (1Mb) for boot infos */
 -     loadinfo->memsize = _ALIGN(loadinfo->memsize,(1<<20)) + 0x100000;
 +     loadinfo->memsize = _ALIGN(loadinfo->memsize,(1<<20));
       /* Claim OF memory */
       DEBUG_F("Before prom_claim, mem_sz: 0x%08lx\n", loadinfo->memsize);