Merge mainline into net
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 22 Sep 2010 18:13:00 +0000 (20:13 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 22 Sep 2010 18:13:00 +0000 (20:13 +0200)
12 files changed:
1  2 
Makefile.util.def
grub-core/Makefile.am
grub-core/Makefile.core.def
grub-core/commands/ls.c
grub-core/commands/probe.c
grub-core/kern/device.c
grub-core/kern/ieee1275/openfw.c
grub-core/loader/i386/multiboot_mbi.c
grub-core/net/i386/pc/pxe.c
include/grub/disk.h
include/grub/err.h
include/grub/ieee1275/ieee1275.h

@@@ -30,9 -21,7 +21,8 @@@ library = 
    common = grub-core/commands/blocklist.c;
    common = grub-core/commands/extcmd.c;
    common = grub-core/commands/ls.c;
 +  common = grub-core/net/net.c;
    common = grub-core/disk/dmraid_nvidia.c;
-   common = grub-core/disk/host.c;
    common = grub-core/disk/loopback.c;
    common = grub-core/disk/lvm.c;
    common = grub-core/disk/mdraid_linux.c;
@@@ -74,10 -74,10 +74,11 @@@ KERNEL_HEADER_FILES += $(top_srcdir)/in
  KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h
  KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm_private.h
  KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/boot.h
 +KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h
+ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h
+ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h
  
  if COND_i386_pc
- KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/memory.h
  KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/loader.h
  KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
  KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pxe.h
@@@ -1377,30 -1431,42 +1431,70 @@@ module = 
    common = hook/datehook.c;
  };
  
 +module = {
 +  name = net;
 +  common = net/net.c;
 +  common = net/ip.c;
 +  common = net/udp.c;
 +  common = net/ethernet.c;
 +  common = net/arp.c;
 +  common = net/interface.c;
 +  common = net/netbuff.c;
 +};
 +
 +module = {
 +  name = tftp;
 +  common = net/tftp.c;
 +};
 +
 +module = {
 +  name = ofnet;
 +  ieee1275 = net/drivers/ieee1275/ofnet.c;
 +  enable = ieee1275;
 +};
 +
 +module = {
 +  name = emunet;
 +  emu = net/drivers/emu/emunet.c;
 +  enable = ieee1275;
 +};
++
+ module = {
+   name = legacycfg;
+   common = commands/legacycfg.c;
+   common = lib/legacy_parse.c;
+   emu = lib/i386/pc/vesa_modes_table.c;
+   enable = i386_pc;
+   enable = emu;
+ };
+ module = {
+   name = test_blockarg;
+   common = tests/test_blockarg.c;
+ };
+ module = {
+   name = xzio;
+   common = io/xzio.c;
+   common = lib/xzembed/xz_dec_bcj.c;
+   common = lib/xzembed/xz_dec_lzma2.c;
+   common = lib/xzembed/xz_dec_stream.c;
+   cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed';
+ };
+ module = {
+   name = testload;
+   common = commands/testload.c;
+ };
+ module = {
+   name = lsapm;
+   common = commands/i386/pc/lsapm.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = keylayouts;
+   common = commands/keylayouts.c;
+   enable = videomodules;
+ };
Simple merge
Simple merge
Simple merge
@@@ -438,3 -424,46 +438,47 @@@ grub_reboot (void
  }
  #endif
  
+ /* Resolve aliases.  */
+ char *
+ grub_ieee1275_canonicalise_devname (const char *path)
+ {
+   struct canon_args
+   {
+     struct grub_ieee1275_common_hdr common;
+     grub_ieee1275_cell_t path;
+     grub_ieee1275_cell_t buf;
+     grub_ieee1275_cell_t inlen;
+     grub_ieee1275_cell_t outlen;
+   }
+   args;
+   char *buf = NULL;
+   grub_size_t bufsize = 64;
+   int i;
+   for (i = 0; i < 2; i++)
+     {
+       grub_free (buf);
+       buf = grub_malloc (bufsize);
+       if (!buf)
+       return NULL;
+       INIT_IEEE1275_COMMON (&args.common, "canon", 3, 1);
+       args.path = (grub_ieee1275_cell_t) path;
+       args.buf = (grub_ieee1275_cell_t) buf;
+       args.inlen = (grub_ieee1275_cell_t) (bufsize - 1);
+       if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
+       return 0;
+       if (args.outlen > bufsize - 1)
+       {
+         bufsize = args.outlen + 2;
+         continue;
+       }
+       return buf;
+     }
+   /* Shouldn't reach here.  */
+   grub_free (buf);
+   return NULL;
+ }
++
@@@ -198,16 -195,12 +199,21 @@@ grub_multiboot_get_mbi_size (void
      + ALIGN_UP (sizeof(PACKAGE_STRING), 4) 
      + grub_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry)
      + elf_sec_entsize * elf_sec_num
-     + 256 * sizeof (struct multiboot_color);
+     + 256 * sizeof (struct multiboot_color)
+ #if GRUB_MACHINE_HAS_VBE
+     + sizeof (struct grub_vbe_info_block)
+     + sizeof (struct grub_vbe_mode_info_block)
+ #endif
+     + ALIGN_UP (sizeof (struct multiboot_apm_info), 4);
 +
 +  FOR_NET_NETWORK_LEVEL_INTERFACES(net)
 +    if (net->dhcp_ack)
 +      {
 +      ret += net->dhcp_acklen;
 +      break;
 +      }
 +
 +  return ret;
  }
  
  /* Fill previously allocated Multiboot mmap.  */
@@@ -225,11 -323,11 +226,11 @@@ grub_pxefs_read (grub_file_t file, cha
        if (curr_file != 0)
          grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &o, pxe_rm_entry);
  
 -      o.server_ip = disk_data->server_ip;
 -      o.gateway_ip = disk_data->gateway_ip;
 +      o.server_ip = data->server_ip;
 +      o.gateway_ip = data->gateway_ip;
        grub_strcpy ((char *)&o.filename[0], data->filename);
        o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT);
-       o.packet_size = grub_pxe_blksize;
+       o.packet_size = data->block_size;
        grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o, pxe_rm_entry);
        if (o.status)
        {
Simple merge
@@@ -55,10 -55,7 +55,11 @@@ typedef enu
      GRUB_ERR_TIMEOUT,
      GRUB_ERR_IO,
      GRUB_ERR_ACCESS_DENIED,
 -    GRUB_ERR_EXTRACTOR
++    GRUB_ERR_EXTRACTOR,
 +    GRUB_ERR_NET_BAD_ADDRESS,
 +    GRUB_ERR_NET_ROUTE_LOOP,
 +    GRUB_ERR_NET_NO_ROUTE,
 +    GRUB_ERR_WAIT
    }
  grub_err_t;
  
@@@ -191,7 -188,8 +194,9 @@@ char *EXPORT_FUNC(grub_ieee1275_get_fil
  int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook)
                                                (struct grub_ieee1275_devalias *
                                                 alias));
 -
 +char *EXPORT_FUNC(grub_ieee1275_get_aliasdevname) (const char *path);
 +void EXPORT_FUNC(grub_ofnet_findcards) (void);
 +void EXPORT_FUNC(grub_ofnet_probecards) (void);
+ char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path);
  #endif /* ! GRUB_IEEE1275_HEADER */