diff options
author | Erwan Velu <erwan.velu@free.fr> | 2009-03-01 11:15:59 +0100 |
---|---|---|
committer | Erwan Velu <erwan.velu@free.fr> | 2009-03-01 11:15:59 +0100 |
commit | a6a42ea881e803995a3103b0af95f75570db9627 (patch) | |
tree | f97b35dd8a9665da4875ea905fcc13a194966802 | |
parent | c73ffb0c9d7b42046a895df80b2443c21d41fef7 (diff) | |
download | syslinux-elf-a6a42ea881e803995a3103b0af95f75570db9627.tar.gz syslinux-elf-a6a42ea881e803995a3103b0af95f75570db9627.tar.xz syslinux-elf-a6a42ea881e803995a3103b0af95f75570db9627.zip |
hdt: Bump version 0.2.1
Adding pxe menu in menu mode
-rw-r--r-- | com32/hdt/Makefile | 1 | ||||
-rw-r--r-- | com32/hdt/hdt-cli-dmi.c | 2 | ||||
-rw-r--r-- | com32/hdt/hdt-cli-kernel.c | 1 | ||||
-rw-r--r-- | com32/hdt/hdt-menu-pxe.c | 99 | ||||
-rw-r--r-- | com32/hdt/hdt-menu.c | 11 | ||||
-rw-r--r-- | com32/hdt/hdt-menu.h | 4 | ||||
-rw-r--r-- | com32/hdt/hdt.h | 2 |
7 files changed, 115 insertions, 5 deletions
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile index 15044d48..a8f87c91 100644 --- a/com32/hdt/Makefile +++ b/com32/hdt/Makefile @@ -44,6 +44,7 @@ all: hdt.c32 $(LIB) hdt.elf: hdt.o hdt-ata.o hdt-menu.o hdt-menu-pci.o hdt-menu-kernel.o \ hdt-menu-disk.o hdt-menu-dmi.o hdt-menu-processor.o hdt-menu-syslinux.o hdt-menu-about.o \ hdt-cli.o hdt-common.o hdt-cli-pci.o hdt-cli-dmi.o hdt-cli-cpu.o hdt-cli-pxe.o hdt-cli-kernel.o\ + hdt-menu-pxe.o\ $(com32)/modules/cpuid.o $(com32)/modules/dmi.o $(topdir)/menu/libmenu/libmenu.a $(LIB) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ diff --git a/com32/hdt/hdt-cli-dmi.c b/com32/hdt/hdt-cli-dmi.c index b3c486dc..3981a8d4 100644 --- a/com32/hdt/hdt-cli-dmi.c +++ b/com32/hdt/hdt-cli-dmi.c @@ -271,7 +271,7 @@ void show_dmi_cpu(struct s_hardware *hardware) { more_printf(" Cpu Model : %u\n",hardware->dmi.processor.signature.model); more_printf(" Cpu Stepping : %u\n",hardware->dmi.processor.signature.stepping); more_printf(" Cpu Minor Stepping : %u\n",hardware->dmi.processor.signature.minor_stepping); - //more_printf(" Voltage %f\n",hardware->dmi.processor.voltage); +// more_printf(" Voltage : %f\n",hardware->dmi.processor.voltage); more_printf(" Status : %s\n",hardware->dmi.processor.status); more_printf(" Upgrade : %s\n",hardware->dmi.processor.upgrade); more_printf(" Cache L1 Handle : %s\n",hardware->dmi.processor.cache1); diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c index 0485ca00..62ca5370 100644 --- a/com32/hdt/hdt-cli-kernel.c +++ b/com32/hdt/hdt-cli-kernel.c @@ -32,7 +32,6 @@ #include <string.h> #include <stdlib.h> #include <errno.h> -#include <syslinux/pxe.h> void main_show_kernel(struct s_hardware *hardware,struct s_cli_mode *cli_mode) { char buffer[1024]; diff --git a/com32/hdt/hdt-menu-pxe.c b/com32/hdt/hdt-menu-pxe.c new file mode 100644 index 00000000..5ab3d8b3 --- /dev/null +++ b/com32/hdt/hdt-menu-pxe.c @@ -0,0 +1,99 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2009 Erwan Velu - All Rights Reserved + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall + * be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * ----------------------------------------------------------------------- +*/ + +#include "hdt-menu.h" + +/* Main Kernel Menu*/ +void compute_PXE(struct s_my_menu *menu,struct s_hardware *hardware) { + char buffer[SUBMENULEN+1]; + char infobar[STATLEN+1]; + + if (hardware->is_pxe_valid==false) return; + + menu->menu = add_menu(" PXE ",-1); + menu->items_count=0; + set_menu_pos(SUBMENU_Y,SUBMENU_X); + + struct s_pxe *p = &hardware->pxe; + + if (hardware->pci_ids_return_code == -ENOPCIIDS) { + snprintf(buffer,sizeof buffer, "PCI Vendor : %d",p->vendor_id); + snprintf(infobar,sizeof infobar,"PCI Vendor : %d",p->vendor_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI Product : %d",p->vendor_id); + snprintf(infobar,sizeof infobar,"PCI Product : %d",p->vendor_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI SubVendor : %d",p->subvendor_id); + snprintf(infobar,sizeof infobar,"PCI SubVendor : %d",p->subvendor_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI SubProduct : %d",p->subproduct_id); + snprintf(infobar,sizeof infobar,"PCI SubProduct : %d",p->subproduct_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI Revision : %d",p->rev); + snprintf(infobar,sizeof infobar,"PCI Revision : %d",p->rev); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI Bus Pos. : %02x:%02x.%02x",p->pci_bus,p->pci_dev, p->pci_func); + snprintf(infobar,sizeof infobar,"PCI Bus Pos. : %02x:%02x.%02x",p->pci_bus,p->pci_dev, p->pci_func); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + } else { + + snprintf(buffer,sizeof buffer, "Manufacturer : %s", p->pci_device->dev_info->vendor_name); + snprintf(infobar,sizeof infobar,"Manufacturer : %s", p->pci_device->dev_info->vendor_name); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "Product : %s", p->pci_device->dev_info->product_name); + snprintf(infobar,sizeof infobar,"Product : %s", p->pci_device->dev_info->product_name); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + } + + snprintf(buffer,sizeof buffer, "MAC Address : %s", p->mac_addr); + snprintf(infobar,sizeof infobar, "MAC Address : %s", p->mac_addr); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "IP Address : %d.%d.%d.%d", p->ip_addr[0], p->ip_addr[1], p->ip_addr[2], p->ip_addr[3]); + snprintf(infobar,sizeof infobar, "IP Address : %d.%d.%d.%d", p->ip_addr[0], p->ip_addr[1], p->ip_addr[2], p->ip_addr[3]); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + printf("MENU: PXE menu done (%d items)\n",menu->items_count); +} diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c index 65129003..0c5bfe58 100644 --- a/com32/hdt/hdt-menu.c +++ b/com32/hdt/hdt-menu.c @@ -140,6 +140,7 @@ void compute_submenus(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware) compute_disks(hdt_menu,hardware->disk_info); #ifdef WITH_PCI compute_PCI(hdt_menu,hardware); + compute_PXE(&(hdt_menu->pxe_menu),hardware); compute_kernel(&(hdt_menu->kernel_menu),hardware); #endif compute_syslinuxmenu(&(hdt_menu->syslinux_menu)); @@ -205,9 +206,15 @@ if (hardware->is_dmi_valid) { } add_item("","",OPT_SEP,"",0); #ifdef WITH_PCI - add_item("<K>ernel Modules","Kernel Modules Menu",OPT_SUBMENU,NULL,hdt_menu->kernel_menu.menu); - hdt_menu->main_menu.items_count++; + if (hardware->modules_pcimap_return_code != -ENOMODULESPCIMAP) { + add_item("<K>ernel Modules","Kernel Modules Menu",OPT_SUBMENU,NULL,hdt_menu->kernel_menu.menu); + hdt_menu->main_menu.items_count++; + } #endif + if (hardware->is_pxe_valid == true) { + add_item("P<X>E","PXE Information Menu",OPT_SUBMENU,NULL,hdt_menu->pxe_menu.menu); + hdt_menu->main_menu.items_count++; + } add_item("<S>yslinux","Syslinux Information Menu",OPT_SUBMENU,NULL,hdt_menu->syslinux_menu.menu); hdt_menu->main_menu.items_count++; add_item("S<w>itch to CLI","Switch to Command Line",OPT_RUN,HDT_SWITCH_TO_CLI,0); diff --git a/com32/hdt/hdt-menu.h b/com32/hdt/hdt-menu.h index 9c614595..725da458 100644 --- a/com32/hdt/hdt-menu.h +++ b/com32/hdt/hdt-menu.h @@ -70,6 +70,7 @@ struct s_hdt_menu { struct s_my_menu battery_menu; struct s_my_menu syslinux_menu; struct s_my_menu about_menu; + struct s_my_menu pxe_menu; int total_menu_count; // sum of all menus we have }; @@ -105,6 +106,9 @@ void compute_syslinuxmenu(struct s_my_menu *menu); // About menu void compute_aboutmenu(struct s_my_menu *menu); +//PXE menu +void compute_PXE(struct s_my_menu *menu,struct s_hardware *hardware); + int start_menu_mode(struct s_hardware *hardware, char *version_string); void setup_menu(char *version); void compute_main_menu(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware); diff --git a/com32/hdt/hdt.h b/com32/hdt/hdt.h index a9436b1f..ba847d54 100644 --- a/com32/hdt/hdt.h +++ b/com32/hdt/hdt.h @@ -32,7 +32,7 @@ #define PRODUCT_NAME "Hardware Detection Tool" #define AUTHOR "Erwan Velu" #define CONTACT "erwan(dot)velu(point)free(dot)fr" -#define VERSION "0.2.0" +#define VERSION "0.2.1" #define ATTR_PACKED __attribute__((packed)) |