aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-29 15:35:13 +0100
committerErwan Velu <erwan.velu@free.fr>2009-12-04 10:11:15 +0100
commit571cdb24787a1c9d5c73f6c831d5f5d8c9c130e6 (patch)
tree36181a56b495d93ce2dd50cd71b56ed1104c7b61 /com32
parent2221e0b8b5900d4f3d753ee3ee1bd552db187892 (diff)
downloadsyslinux.git-571cdb24787a1c9d5c73f6c831d5f5d8c9c130e6.tar.gz
syslinux.git-571cdb24787a1c9d5c73f6c831d5f5d8c9c130e6.tar.xz
syslinux.git-571cdb24787a1c9d5c73f6c831d5f5d8c9c130e6.zip
hdt: Adding gPXE detection
Impact: gPXE is now detected HDT is now able to report is gPXE is loaded on this given system
Diffstat (limited to 'com32')
-rw-r--r--com32/hdt/hdt-cli-pxe.c6
-rw-r--r--com32/hdt/hdt-menu-pxe.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/com32/hdt/hdt-cli-pxe.c b/com32/hdt/hdt-cli-pxe.c
index 7c550e36..3a61bc02 100644
--- a/com32/hdt/hdt-cli-pxe.c
+++ b/com32/hdt/hdt-cli-pxe.c
@@ -32,6 +32,7 @@
#include <errno.h>
#include <syslinux/pxe.h>
#include <syslinux/config.h>
+#include <sys/gpxe.h>
#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 930cf272..426bfe07 100644
--- a/com32/hdt/hdt-menu-pxe.c
+++ b/com32/hdt/hdt-menu-pxe.c
@@ -27,12 +27,14 @@
*/
#include "hdt-menu.h"
+#include <sys/gpxe.h>
/* 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);
}