From 571cdb24787a1c9d5c73f6c831d5f5d8c9c130e6 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Sun, 29 Nov 2009 15:35:13 +0100 Subject: [PATCH] hdt: Adding gPXE detection Impact: gPXE is now detected HDT is now able to report is gPXE is loaded on this given system --- com32/hdt/hdt-cli-pxe.c | 6 ++++++ com32/hdt/hdt-menu-pxe.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/com32/hdt/hdt-cli-pxe.c b/com32/hdt/hdt-cli-pxe.c index 7c550e3..3a61bc0 100644 --- a/com32/hdt/hdt-cli-pxe.c +++ b/com32/hdt/hdt-cli-pxe.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "hdt-cli.h" #include "hdt-common.h" @@ -76,6 +77,11 @@ void main_show_pxe(int argc __unused, char **argv __unused, } more_printf(" Addresses : %d.%d.%d.%d @ %s\n", p->ip_addr[0], p->ip_addr[1], p->ip_addr[2], p->ip_addr[3], p->mac_addr); + + if (is_gpxe()) + more_printf(" gPXE Detected: Yes\n") + else + more_printf(" gPXE Detected: No\n"); } struct cli_module_descr pxe_show_modules = { diff --git a/com32/hdt/hdt-menu-pxe.c b/com32/hdt/hdt-menu-pxe.c index 930cf27..426bfe0 100644 --- a/com32/hdt/hdt-menu-pxe.c +++ b/com32/hdt/hdt-menu-pxe.c @@ -27,12 +27,14 @@ */ #include "hdt-menu.h" +#include /* Main Kernel menu */ void compute_PXE(struct s_my_menu *menu, struct s_hardware *hardware) { char buffer[SUBMENULEN + 1]; char infobar[STATLEN + 1]; + char gpxe[4]; if (hardware->is_pxe_valid == false) return; @@ -111,5 +113,13 @@ void compute_PXE(struct s_my_menu *menu, struct s_hardware *hardware) add_item(buffer, infobar, OPT_INACTIVE, NULL, 0); menu->items_count++; + if (is_gpxe()) strcat(gpxe,"Yes"); + else strcat (gpxe,"No"); + + snprintf(buffer, sizeof buffer, "gPXE Detected: %s", gpxe); + snprintf(infobar, sizeof infobar, "gPXE Detected: %s", gpxe); + add_item(buffer, infobar, OPT_INACTIVE, NULL, 0); + menu->items_count++; + printf("MENU: PXE menu done (%d items)\n", menu->items_count); } -- 2.7.4