Commit 30f25347 authored by Mike Hibler's avatar Mike Hibler
Browse files

Move bootinfo command out of pc/BIOS specific area.

parent ff64883e
Pipeline #970 skipped
......@@ -749,9 +749,7 @@ module = {
module = {
name = bootinfo;
i386_pc = commands/i386/pc/bootinfo.c;
enable = i386_pc;
common = commands/bootinfo.c;
};
module = {
......
......@@ -24,7 +24,6 @@
#include <grub/misc.h>
#include <grub/time.h>
#include <grub/term.h>
#include <grub/machine/pxe.h>
#include <grub/machine/memory.h>
#include <grub/mm.h>
#include <grub/device.h>
......@@ -600,8 +599,7 @@ grub_cmd_bootinfo (struct grub_extcmd_context *ctxt,
grub_net_network_level_address_t biserver;
struct recv_data *bdata;
in_addr_t bootinfo_ip;
char *dhcpdata;
grub_size_t dhcplen;
struct grub_net_network_level_interface *net;
int rc = 0;
char *bootinfo_name = NULL;
char buf[32];
......@@ -641,15 +639,16 @@ grub_cmd_bootinfo (struct grub_extcmd_context *ctxt,
}
/* Extract our IP address from the cached DHCP data */
dhcpdata = grub_pxe_get_cached(GRUB_PXENV_PACKET_TYPE_DHCP_ACK);
if (dhcpdata == NULL) {
rc = grub_error(GRUB_ERR_IO, "failed to get cached IP info");
goto out;
}
dhcplen = GRUB_PXE_BOOTP_SIZE;
if (bootinfo_ip == 0) {
bootinfo_ip = find_bootinfo_ip(dhcpdata, dhcplen);
FOR_NET_NETWORK_LEVEL_INTERFACES(net) {
if (net->dhcp_ack) {
bootinfo_ip =
find_bootinfo_ip(net->dhcp_ack,
net->dhcp_acklen);
break;
}
}
if (bootinfo_ip == 0) {
rc = grub_error(GRUB_ERR_BUG,
"Unable to find bootinfo address");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment