summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames <james.mckenzie@citrix.com>2012-11-16 23:10:27 +0000
committerJames <james.mckenzie@citrix.com>2012-11-16 23:10:27 +0000
commit548fc951e98dd1553204e3f45db3f5cc70813c4b (patch)
tree5f59cc634104bacc50cf081648a07adf3ce9acc1
parentfd009cf68391bdcfa71dcdda31bfb24665c7621d (diff)
downloadgrub-1.99-pq-548fc951e98dd1553204e3f45db3f5cc70813c4b.tar.gz
grub-1.99-pq-548fc951e98dd1553204e3f45db3f5cc70813c4b.tar.bz2
grub-1.99-pq-548fc951e98dd1553204e3f45db3f5cc70813c4b.zip
fish
-rw-r--r--master/jmm/efi-sni-bis31
-rw-r--r--master/jmm/networking-bis57
-rw-r--r--master/series1
3 files changed, 56 insertions, 33 deletions
diff --git a/master/jmm/efi-sni-bis b/master/jmm/efi-sni-bis
index c035e53..9480dc8 100644
--- a/master/jmm/efi-sni-bis
+++ b/master/jmm/efi-sni-bis
@@ -31,7 +31,7 @@ index 2cdcc7b..e297c4f 100644
x86_efi = kern/efi/init.c;
x86_efi = kern/efi/mm.c;
diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
-index a83bf2e..0c2a88c 100644
+index a83bf2e..a8fd647 100644
--- a/grub-core/kern/efi/init.c
+++ b/grub-core/kern/efi/init.c
@@ -20,6 +20,7 @@
@@ -50,19 +50,20 @@ index a83bf2e..0c2a88c 100644
}
void
-@@ -133,6 +135,11 @@ grub_efi_set_prefix (void)
+@@ -132,6 +134,12 @@ grub_efi_set_prefix (void)
+ image = grub_efi_get_loaded_image (grub_efi_image_handle);
if (image)
{
- if (!device)
++ if (!device) {
+ device = grub_efinet_get_device_name (image->device_handle);
-+ /* If we net booted - hard code the prefix */
-+ if (device && !path)
-+ path = grub_strdup("/grub/");
-+ if (!device)
++ /* If we net booted - hard code the prefix */
++ if (device)
++ path = grub_strdup("/grub/");
++ }
+ if (!device)
device = grub_efidisk_get_device_name (image->device_handle);
else if (device[0] == ',' || !device[0])
- {
-@@ -187,6 +194,7 @@ grub_efi_set_prefix (void)
+@@ -187,6 +195,7 @@ grub_efi_set_prefix (void)
void
grub_efi_fini (void)
{
@@ -114,10 +115,10 @@ index 5dd5ada..74bbd47 100644
goto fail;
diff --git a/grub-core/net/efi/efinet.c b/grub-core/net/efi/efinet.c
new file mode 100644
-index 0000000..684df98
+index 0000000..ca7ff09
--- /dev/null
+++ b/grub-core/net/efi/efinet.c
-@@ -0,0 +1,544 @@
+@@ -0,0 +1,548 @@
+/* efinet.c - EFI network access using SNI. */
+/*
+ * GRUB -- GRand Unified Bootloader
@@ -448,11 +449,15 @@ index 0000000..684df98
+ struct grub_sni_data *d = NULL;
+
+
++ if (name && grub_strncmp(name,"sni",3)) {
++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device");
++ }
++
+ if (name)
+ {
+ num = get_unit_number (name);
+ if (num < 0)
-+ return grub_errno;
++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device");
+ net->name = grub_strdup (name);
+ }
+ else
@@ -467,7 +472,7 @@ index 0000000..684df98
+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device");
+
+
-+ grub_printf("DEVICE PATH to %s:",name);
++ grub_printf("DEVICE PATH to `%s'...\n",name);
+ grub_efi_print_device_path(d->device_path);
+ grub_printf("\n");
+
diff --git a/master/jmm/networking-bis b/master/jmm/networking-bis
index 2752895..1045b4a 100644
--- a/master/jmm/networking-bis
+++ b/master/jmm/networking-bis
@@ -69,10 +69,10 @@ index 7714011..c3dbe12 100644
diff --git a/grub-core/fs/tftp.c b/grub-core/fs/tftp.c
new file mode 100644
-index 0000000..941c907
+index 0000000..01dbcb6
--- /dev/null
+++ b/grub-core/fs/tftp.c
-@@ -0,0 +1,504 @@
+@@ -0,0 +1,508 @@
+/* tftp.c - tftp filesystem */
+/*
+ * GRUB -- GRand Unified Bootloader
@@ -116,6 +116,8 @@ index 0000000..941c907
+#define TFTP_OP_ACK 4
+#define TFTP_OP_ERROR 5
+
++GRUB_MOD_LICENSE ("GPLv2+");
++
+static grub_dl_t my_mod;
+
+typedef struct __attribute__ ((packed))
@@ -225,7 +227,9 @@ index 0000000..941c907
+ }
+ if (!fd->buf)
+ {
++#if 0
+ grub_printf ("failed to realloc %d bytes\n", fd->buf_size);
++#endif
+ grub_millisleep (5000);
+ }
+
@@ -578,7 +582,7 @@ index 0000000..941c907
+ grub_fs_unregister (&grub_fs_tftp);
+}
diff --git a/grub-core/kern/device.c b/grub-core/kern/device.c
-index 3db14f5..13e4dee 100644
+index 3db14f5..2f02b83 100644
--- a/grub-core/kern/device.c
+++ b/grub-core/kern/device.c
@@ -30,6 +30,7 @@ grub_device_t
@@ -589,7 +593,7 @@ index 3db14f5..13e4dee 100644
grub_device_t dev = 0;
if (! name)
-@@ -48,7 +49,12 @@ grub_device_open (const char *name)
+@@ -48,15 +49,22 @@ grub_device_open (const char *name)
/* Try to open a disk. */
disk = grub_disk_open (name);
@@ -603,7 +607,9 @@ index 3db14f5..13e4dee 100644
goto fail;
dev->disk = disk;
-@@ -57,6 +63,8 @@ grub_device_open (const char *name)
+- dev->net = 0; /* FIXME */
++ dev->net = net;
+
return dev;
fail:
@@ -623,10 +629,10 @@ index 3db14f5..13e4dee 100644
diff --git a/grub-core/kern/net.c b/grub-core/kern/net.c
new file mode 100644
-index 0000000..49eecb5
+index 0000000..b0b6b5d
--- /dev/null
+++ b/grub-core/kern/net.c
-@@ -0,0 +1,1409 @@
+@@ -0,0 +1,1422 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2002,2003,2004,2006,2007,2008 Free Software Foundation, Inc.
@@ -665,8 +671,10 @@ index 0000000..49eecb5
+
+grub_udp_socket_t *udp_listeners = NULL;
+
++#if 0
+#undef grub_dprintf
+#define grub_dprintf(a,b...) grub_printf(b)
++#endif
+
+/*BYTE SEX*/
+static inline grub_uint16_t
@@ -1451,14 +1459,14 @@ index 0000000..49eecb5
+
+ opt++;
+
-+ memcpy (a, opt, GRUB_IPV4_ALEN);
++ grub_memcpy (a, opt, GRUB_IPV4_ALEN);
+}
+
+static grub_uint8_t *
+dhcp_add_generic_options (grub_uint8_t * optr, int dhcp_type)
+{
+ grub_uint8_t *lptr;
-+ memcpy (optr, &dhcp_magic_cookie, DHCP_MAGIC_COOKIE_LEN);
++ grub_memcpy (optr, &dhcp_magic_cookie, DHCP_MAGIC_COOKIE_LEN);
+ optr += DHCP_MAGIC_COOKIE_LEN;
+
+ *(optr++) = DHCP_OPTION_TAG_DHCP;
@@ -1506,9 +1514,9 @@ index 0000000..49eecb5
+/* May the lord be praised we finally have an ACK */
+/* Set all the rubbish */
+
-+ memcpy (net->dhcp_file, &an->file, sizeof (net->dhcp_file));
-+ memcpy (&net->tftp_addr, &an->siaddr, GRUB_IPV4_ALEN);
-+ memcpy (&net->my_addr, &an->yiaddr, GRUB_IPV4_ALEN);
++ grub_memcpy (net->dhcp_file, &an->file, sizeof (net->dhcp_file));
++ grub_memcpy (&net->tftp_addr, &an->siaddr, GRUB_IPV4_ALEN);
++ grub_memcpy (&net->my_addr, &an->yiaddr, GRUB_IPV4_ALEN);
+
+ dhcp_find_ip_option (an, len, DHCP_OPTION_SUBNET, &net->my_mask);
+ dhcp_find_ip_option (an, len, DHCP_OPTION_ROUTER, &net->my_router);
@@ -1544,7 +1552,7 @@ index 0000000..49eecb5
+
+ *(optr++) = DHCP_OPTION_REQUESTED_IP_ADDR;
+ *(optr++) = GRUB_IPV4_ALEN;
-+ memcpy (optr, &off->yiaddr, GRUB_IPV4_ALEN);
++ grub_memcpy (optr, &off->yiaddr, GRUB_IPV4_ALEN);
+ optr += 4;
+
+ *(optr++) = DHCP_OPTION_END;
@@ -1573,7 +1581,7 @@ index 0000000..49eecb5
+
+ dis->flags = grub_net_htons (DHCP_FLAGS_BROADCAST);
+
-+ memcpy (dis->chaddr, &net->my_eth_addr, GRUB_ETH_ALEN);
++ grub_memcpy (dis->chaddr, &net->my_eth_addr, GRUB_ETH_ALEN);
+
+ optr = dhcp_add_generic_options (dis->options, DHCP_MSG_TYPE_DISCOVER);
+ *(optr++) = DHCP_OPTION_END;
@@ -1788,11 +1796,13 @@ index 0000000..49eecb5
+{
+ grub_net_t net;
+ grub_net_dev_t dev;
++ grub_fs_t fs=find_tftp_fs();
+
-+ grub_dprintf ("net", "opening `%s'...\n", name);
++ if (!fs)
++ return 0;
+
+ if (net_blocked)
-+ return 0;
++ return NULL;
+
+ if (name && !grub_strcmp (name, "net"))
+ {
@@ -1808,6 +1818,7 @@ index 0000000..49eecb5
+ return net->has_failed ? NULL:net;
+ }
+ }
++
+ for (dev = grub_net_dev_list; dev; dev = dev->next)
+ {
+ int ret;
@@ -1816,7 +1827,7 @@ index 0000000..49eecb5
+
+ net = (grub_net_t) grub_malloc (sizeof (*net));
+ if (!net)
-+ return 0;
++ return NULL;
+
+
+ net->name = NULL;
@@ -1824,13 +1835,15 @@ index 0000000..49eecb5
+ net->is_running = 0;
+ net->is_up = 0;
+ net->has_failed = 0;
-+ net->fs = find_tftp_fs();
++ net->fs = fs;
+ grub_memcpy (&net->my_addr, &ip_broadcast, GRUB_IPV4_ALEN);
+
+ /*Try opening the name with this device sets net->name */
+ ret=dev->open (name, net);
+
-+ grub_dprintf ("net", "opening `%s' gave %d.\n", name, ret);
++#if 0
++ grub_dprintf ("net", "opening `%s' gave %d.\n", name, ret);
++#endif
+
+ if (ret!=GRUB_ERR_NONE) { /*There was a problem*/
+
@@ -1879,10 +1892,12 @@ index 0000000..49eecb5
+
+fail:
+
++#if 0
+ if (!net)
+ {
+ grub_dprintf ("net", "opening `%s' failed.\n", name);
+ }
++#endif
+
+ return net;
+}
@@ -1904,7 +1919,11 @@ index 0000000..49eecb5
+void
+grub_net_close (grub_net_t net)
+{
++#if 0
+ grub_dprintf ("net", "closing `%s'.\n", net->name);
++#else
++ (void) net;
++#endif
+
+ /* we don't actually close the network device as we're bound to want it later */
+}
diff --git a/master/series b/master/series
index 8a47714..15baf15 100644
--- a/master/series
+++ b/master/series
@@ -54,7 +54,6 @@ jmm/efi-load-drivers-bis
jmm/networking-bis
#jmm/efi-sni
jmm/efi-sni-bis
-no-prefix-bail
endstop
#
#