aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt
diff options
context:
space:
mode:
Diffstat (limited to 'com32/hdt')
-rw-r--r--com32/hdt/Makefile7
-rw-r--r--com32/hdt/floppy/hdt.cfg4
-rw-r--r--com32/hdt/hdt-cli-cpu.c2
-rw-r--r--com32/hdt/hdt-cli-hdt.c9
-rw-r--r--com32/hdt/hdt-cli-kernel.c2
-rw-r--r--com32/hdt/hdt-cli-pci.c4
-rw-r--r--com32/hdt/hdt-cli-pxe.c6
-rw-r--r--com32/hdt/hdt-cli.c29
-rw-r--r--com32/hdt/hdt-cli.h8
-rw-r--r--com32/hdt/hdt-common.c30
-rw-r--r--com32/hdt/hdt-common.h4
-rw-r--r--com32/hdt/hdt-menu.c7
12 files changed, 53 insertions, 59 deletions
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
index 8cd96f2c..24e63c29 100644
--- a/com32/hdt/Makefile
+++ b/com32/hdt/Makefile
@@ -30,7 +30,7 @@ VERSION = $(shell $(SED) -n 's/\#define VERSION \"\(.*\)\"/\1/p' hdt.h)
CODENAME = $(shell $(SED) -n 's/\#define CODENAME \"\(.*\)\"/\1/p' hdt.h)
VERSION_C32 = $(shell echo $(VERSION) | $(SED) -e 's/-/_/g' | $(SED) -e 's/\./_/g')
-MEMTEST_URL = http://memtest.org/download/4.00/memtest86+-4.00.bin
+MEMTEST_URL = http://memtest.org/download/4.10/memtest86+-4.10.bin
MEMTEST = memtest.bin
KERNEL_VERSION ?= $(shell uname -r)
@@ -43,7 +43,6 @@ ISOLINUX_DIR ?= isolinux
FLOPPY_DIR ?= floppy
PCI_IDS_FILE ?= $(PWD)/$(FLOPPY_DIR)/pci.ids
GZ_PCI_IDS_FILE ?= $(PCI_IDS_FILE).gz
-REBOOT_COM32 ?= $(com32)/modules/reboot.c32
MENU_COM32 ?= $(com32)/menu/menu.c32
ART_DIR ?= art/
QEMU ?= qemu-kvm
@@ -56,7 +55,7 @@ hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
memtest:
-[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST)
-hdt.img: hdt.c32 $(FLOPPY_DIR)/hdt.cfg $(FLOPPY_DIR)/mtools.conf $(topdir)/mtools/syslinux $(REBOOT_COM32) $(MENU_COM32) memtest
+hdt.img: hdt.c32 $(FLOPPY_DIR)/hdt.cfg $(FLOPPY_DIR)/mtools.conf $(topdir)/mtools/syslinux $(MENU_COM32) memtest
rm -f hdt*.img
$(SED) -e 's/%VERSION%/$(VERSION)/g' $(FLOPPY_DIR)/hdt.cfg |\
$(SED) -e 's/%CODENAME%/$(CODENAME)/g' > $(FLOPPY_DIR)/syslinux.cfg
@@ -68,7 +67,6 @@ hdt.img: hdt.c32 $(FLOPPY_DIR)/hdt.cfg $(FLOPPY_DIR)/mtools.conf $(topdir)/mtool
-[ -f $(MODULES_PCIMAP_FILE) ] && cat $(MODULES_PCIMAP_FILE) | $(GZIPPROG) - -f | MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) - a:modules.pcimap
MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) hdt.c32 a:
MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(MENU_COM32) a:
- MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(REBOOT_COM32) a:
@ [ -f $(GZ_PCI_IDS_FILE) ] && MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(GZ_PCI_IDS_FILE) a:pci.ids || printf "\nThe $(GZ_PCI_IDS_FILE) file is missing and can be downloaded from http://pciids.sourceforge.net and gzipped in\nthe ./com32/hdt/$(FLOPPY_DIR) directory of the extracted Syslinux source.\n\n"
MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(FLOPPY_DIR)/syslinux.cfg a:
MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(FLOPPY_DIR)/$(MEMTEST) a:
@@ -89,7 +87,6 @@ hdt.iso: hdt.c32 $(topdir)/core/isolinux.bin $(FLOPPY_DIR)/hdt.cfg memtest
$(SED) -e 's/%VERSION%/$(VERSION)/g' $(FLOPPY_DIR)/hdt.cfg |\
$(SED) -e 's/%CODENAME%/$(CODENAME)/g' > $(ISO_DIR)/$(ISOLINUX_DIR)/isolinux.cfg
cp hdt.c32 $(ISO_DIR)/$(ISOLINUX_DIR)
- cp $(REBOOT_COM32) $(ISO_DIR)/$(ISOLINUX_DIR)
cp $(FLOPPY_DIR)/$(MEMTEST) $(ISO_DIR)/$(ISOLINUX_DIR)
cp $(MENU_COM32) $(ISO_DIR)/$(ISOLINUX_DIR)
cp -av $(ART_DIR)/backgnd.png $(ISO_DIR)/$(ISOLINUX_DIR)
diff --git a/com32/hdt/floppy/hdt.cfg b/com32/hdt/floppy/hdt.cfg
index 27d11bac..1350521a 100644
--- a/com32/hdt/floppy/hdt.cfg
+++ b/com32/hdt/floppy/hdt.cfg
@@ -71,8 +71,8 @@ APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids
MENU SEPARATOR
LABEL memtest
-MENU LABEL Memtest86+ 4.00
+MENU LABEL Memtest86+ 4.10
TEXT HELP
- Starts Memtest86+ 4.00
+ Starts Memtest86+ 4.10
ENDTEXT
LINUX memtest.bin
diff --git a/com32/hdt/hdt-cli-cpu.c b/com32/hdt/hdt-cli-cpu.c
index 170de9a3..de0c9cde 100644
--- a/com32/hdt/hdt-cli-cpu.c
+++ b/com32/hdt/hdt-cli-cpu.c
@@ -84,7 +84,7 @@ static void show_flag(char *buffer, bool flag, char *flag_name, bool flush)
if ((((strlen(buffer) + strlen(flag_name)) > 66) && flag) || flush) {
snprintf(output_buffer, sizeof output_buffer, "Flags : %s\n",
buffer);
- more_printf(output_buffer);
+ more_printf("%s", output_buffer);
memset(buffer, 0, sizeof(buffer));
if (flush)
return;
diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c
index f52bcae0..65068232 100644
--- a/com32/hdt/hdt-cli-hdt.c
+++ b/com32/hdt/hdt-cli-hdt.c
@@ -30,6 +30,7 @@
#include <string.h>
#include <stdlib.h>
#include <syslinux/config.h>
+#include <syslinux/reboot.h>
#include "hdt-menu.h"
#include "hdt-cli.h"
@@ -244,11 +245,9 @@ void main_show_hdt(int argc __unused, char **argv __unused,
static void do_reboot(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
- /* Use specific syslinux call if needed */
- if (issyslinux())
- return runsyslinuxcmd(hardware->reboot_label);
- else
- return csprint(hardware->reboot_label, 0x07);
+ (void) hardware;
+ /* Let's call the internal rebooting call */
+ syslinux_reboot(1);
}
/* Default hdt mode */
diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c
index aaa177ef..89d013b4 100644
--- a/com32/hdt/hdt-cli-kernel.c
+++ b/com32/hdt/hdt-cli-kernel.c
@@ -82,7 +82,7 @@ void main_show_kernel(int argc __unused, char **argv __unused,
}
if (found == true) {
strncat(buffer, "\n", 1);
- more_printf(buffer);
+ more_printf("%s", buffer);
}
}
diff --git a/com32/hdt/hdt-cli-pci.c b/com32/hdt/hdt-cli-pci.c
index 42571cfc..07c079d5 100644
--- a/com32/hdt/hdt-cli-pci.c
+++ b/com32/hdt/hdt-cli-pci.c
@@ -205,8 +205,8 @@ static void show_pci_devices(int argc __unused, char **argv __unused,
pci_device->product,
pci_device->sub_vendor, pci_device->sub_product);
- more_printf(first_line);
- more_printf(second_line);
+ more_printf("%s", first_line);
+ more_printf("%s", second_line);
more_printf("\n");
} else if (nopciids == true) {
if (nomodulesfile == true) {
diff --git a/com32/hdt/hdt-cli-pxe.c b/com32/hdt/hdt-cli-pxe.c
index faba0436..d906b947 100644
--- a/com32/hdt/hdt-cli-pxe.c
+++ b/com32/hdt/hdt-cli-pxe.c
@@ -65,14 +65,14 @@ void main_show_pxe(int argc __unused, char **argv __unused,
snprintf(buffer, sizeof(buffer),
" PCI Bus pos. : %02x:%02x.%02x\n", p->pci_bus,
p->pci_dev, p->pci_func);
- more_printf(buffer);
+ more_printf("%s", buffer);
} else {
snprintf(buffer, sizeof(buffer), " Manufacturer : %s \n",
p->pci_device->dev_info->vendor_name);
- more_printf(buffer);
+ more_printf("%s", buffer);
snprintf(buffer, sizeof(buffer), " Product : %s \n",
p->pci_device->dev_info->product_name);
- more_printf(buffer);
+ more_printf("%s", buffer);
}
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);
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c
index 91c8e8f9..8b5335eb 100644
--- a/com32/hdt/hdt-cli.c
+++ b/com32/hdt/hdt-cli.c
@@ -87,7 +87,7 @@ static void autocomplete_add_token_to_list(const char *token)
{
struct autocomplete_list *new = malloc(sizeof(struct autocomplete_list));
- strncpy(new->autocomplete_token, token, sizeof(new->autocomplete_token));
+ strlcpy(new->autocomplete_token, token, sizeof(new->autocomplete_token));
new->next = NULL;
autocomplete_backlog++;
@@ -273,13 +273,13 @@ static void expand_aliases(char *line __unused, char **command, char **module,
*argc = 1;
*argv = malloc(*argc * sizeof(char *));
argv[0] = malloc((sizeof(*command) + 1) * sizeof(char));
- strncpy(argv[0], *command, sizeof(*command) + 1);
+ strlcpy(argv[0], *command, sizeof(*command) + 1);
dprintf("CLI DEBUG: ALIAS %s ", *command);
- strncpy(*command, CLI_SET, sizeof(CLI_SET)); /* set */
+ strlcpy(*command, CLI_SET, sizeof(CLI_SET)); /* set */
*module = malloc(sizeof(CLI_MODE) * sizeof(char));
- strncpy(*module, CLI_MODE, sizeof(CLI_MODE)); /* mode */
+ strlcpy(*module, CLI_MODE, sizeof(CLI_MODE)); /* mode */
dprintf("--> %s %s %s\n", *command, *module, argv[0]);
goto out;
@@ -291,7 +291,7 @@ static void expand_aliases(char *line __unused, char **command, char **module,
if (!strncmp(*command, hdt_aliases[i].aliases[j],
sizeof(hdt_aliases[i].aliases[j]))) {
dprintf("CLI DEBUG: ALIAS %s ", *command);
- strncpy(*command, hdt_aliases[i].command,
+ strlcpy(*command, hdt_aliases[i].command,
sizeof(hdt_aliases[i].command) + 1);
dprintf("--> %s\n", *command);
goto out; /* Don't allow chaining aliases */
@@ -363,14 +363,14 @@ static void parse_command_line(char *line, char **command, char **module,
if (token_found == 0) {
/* Main command to execute */
*command = malloc((token_len + 1) * sizeof(char));
- strncpy(*command, pch, token_len);
+ strlcpy(*command, pch, token_len);
(*command)[token_len] = '\0';
dprintf("CLI DEBUG: command = %s\n", *command);
args_pos += args_len;
} else if (token_found == 1) {
/* Module */
*module = malloc((token_len + 1) * sizeof(char));
- strncpy(*module, pch, token_len);
+ strlcpy(*module, pch, token_len);
(*module)[token_len] = '\0';
dprintf("CLI DEBUG: module = %s\n", *module);
args_pos += args_len;
@@ -392,7 +392,7 @@ static void parse_command_line(char *line, char **command, char **module,
while (pch != NULL) {
dprintf("CLI DEBUG: argv[%d] = %s\n", argc_iter, pch);
argv[argc_iter] = malloc(sizeof(pch) * sizeof(char));
- strncpy(argv[argc_iter], pch, sizeof(pch));
+ strlcpy(argv[argc_iter], pch, sizeof(pch));
argc_iter++;
pch = strtok(NULL, CLI_SPACE);
/*
@@ -711,7 +711,6 @@ static void exec_command(char *line, struct s_hardware *hardware)
}
}
-out:
/* Let's not forget to clean ourselves */
if (command != NULL)
free(command);
@@ -777,6 +776,10 @@ void start_auto_mode(struct s_hardware *hardware)
void print_history(int argc, char **argv, struct s_hardware * hardware)
{
+ (void)argc;
+ (void)argv;
+ (void)hardware;
+
reset_more_printf();
for (int i = 1; i <= MAX_HISTORY_SIZE; i++) {
if (i == hdt_cli.history_pos) {
@@ -911,7 +914,7 @@ void start_cli_mode(struct s_hardware *hardware)
/* Let's make that future position the one we use */
memset(INPUT, 0, sizeof(INPUT));
- strncpy(INPUT, hdt_cli.history[future_history_pos], sizeof(INPUT));
+ strlcpy(INPUT, hdt_cli.history[future_history_pos], sizeof(INPUT));
/* Clear the line */
clear_line();
@@ -952,7 +955,7 @@ void start_cli_mode(struct s_hardware *hardware)
/* Let's make that future position the one we use */
memset(INPUT, 0, sizeof(INPUT));
- strncpy(INPUT, hdt_cli.history[future_history_pos], sizeof(INPUT));
+ strlcpy(INPUT, hdt_cli.history[future_history_pos], sizeof(INPUT));
/* Clear the line */
clear_line();
@@ -972,7 +975,7 @@ void start_cli_mode(struct s_hardware *hardware)
move_cursor_to_column(0);
reset_prompt();
printf("%s", autocomplete_last_seen->autocomplete_token);
- strncpy(INPUT,
+ strlcpy(INPUT,
autocomplete_last_seen->autocomplete_token,
sizeof(INPUT));
hdt_cli.cursor_pos = strlen(INPUT);
@@ -1086,7 +1089,7 @@ void start_cli_mode(struct s_hardware *hardware)
char key[2];
int trailing_chars = strlen(INPUT) - hdt_cli.cursor_pos;
memset(temp_command, 0, sizeof(temp_command));
- strncpy(temp_command, INPUT, hdt_cli.cursor_pos);
+ strlcpy(temp_command, INPUT, hdt_cli.cursor_pos);
sprintf(key, "%c", current_key);
strncat(temp_command, key, 1);
strncat(temp_command,
diff --git a/com32/hdt/hdt-cli.h b/com32/hdt/hdt-cli.h
index 814a03a9..13291092 100644
--- a/com32/hdt/hdt-cli.h
+++ b/com32/hdt/hdt-cli.h
@@ -30,16 +30,10 @@
#define DEFINE_HDT_CLI_H
#include <stdio.h>
#include <getkey.h>
+#include <dprintf.h>
#include "hdt-common.h"
-#define DEBUG 0
-#if DEBUG
-# define dprintf printf
-#else
-# define dprintf(f, ...) ((void)0)
-#endif
-
#define MAX_LINE_SIZE 256
#define CLI_SPACE " "
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index b1170477..ded079ed 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -78,31 +78,27 @@ void detect_parameters(const int argc, const char *argv[],
} else if (!strncmp(argv[i], "verbose", 7)) {
quiet = false;
} else if (!strncmp(argv[i], "modules_pcimap=", 15)) {
- strncpy(hardware->modules_pcimap_path, argv[i] + 15,
+ strlcpy(hardware->modules_pcimap_path, argv[i] + 15,
sizeof(hardware->modules_pcimap_path));
convert_isolinux_filename(hardware->modules_pcimap_path, hardware);
} else if (!strncmp(argv[i], "pciids=", 7)) {
- strncpy(hardware->pciids_path, argv[i] + 7,
+ strlcpy(hardware->pciids_path, argv[i] + 7,
sizeof(hardware->pciids_path));
convert_isolinux_filename(hardware->pciids_path, hardware);
} else if (!strncmp(argv[i], "modules_alias=", 14)) {
- strncpy(hardware->modules_alias_path, argv[i] + 14,
+ strlcpy(hardware->modules_alias_path, argv[i] + 14,
sizeof(hardware->modules_alias_path));
convert_isolinux_filename(hardware->modules_alias_path, hardware);
} else if (!strncmp(argv[i], "memtest=", 8)) {
- strncpy(hardware->memtest_label, argv[i] + 8,
+ strlcpy(hardware->memtest_label, argv[i] + 8,
sizeof(hardware->memtest_label));
convert_isolinux_filename(hardware->memtest_label, hardware);
- } else if (!strncmp(argv[i], "reboot=", 7)) {
- strncpy(hardware->reboot_label, argv[i] + 7,
- sizeof(hardware->reboot_label));
- convert_isolinux_filename(hardware->reboot_label, hardware);
} else if (!strncmp(argv[i], "vesa", 4)) {
vesamode = true;
max_console_lines = MAX_CLI_LINES;
/* If the user defines a background image */
if (!strncmp(argv[i], "vesa=", 5)) {
- strncpy(hardware->vesa_background, argv[i] + 5,
+ strlcpy(hardware->vesa_background, argv[i] + 5,
sizeof(hardware->vesa_background));
}
} else if (!strncmp(argv[i], "novesa", 6)) {
@@ -205,15 +201,13 @@ void init_hardware(struct s_hardware *hardware)
memset(hardware->modules_alias_path, 0,
sizeof hardware->modules_alias_path);
memset(hardware->memtest_label, 0, sizeof hardware->memtest_label);
- memset(hardware->reboot_label, 0, sizeof hardware->reboot_label);
memset(hardware->auto_label, 0, sizeof hardware->auto_label);
memset(hardware->vesa_background, 0, sizeof hardware->vesa_background);
strcat(hardware->pciids_path, "pci.ids");
strcat(hardware->modules_pcimap_path, "modules.pcimap");
strcat(hardware->modules_alias_path, "modules.alias");
strcat(hardware->memtest_label, "memtest");
- strcat(hardware->reboot_label, "reboot.c32");
- strncpy(hardware->vesa_background, CLI_DEFAULT_BACKGROUND,
+ strlcpy(hardware->vesa_background, CLI_DEFAULT_BACKGROUND,
sizeof(hardware->vesa_background));
}
@@ -310,11 +304,11 @@ int detect_vesa(struct s_hardware *hardware)
mode_ptr = GET_PTR(gi->video_mode_ptr);
oem_ptr = GET_PTR(gi->oem_vendor_name_ptr);
- strncpy(hardware->vesa.vendor, oem_ptr, sizeof(hardware->vesa.vendor));
+ strlcpy(hardware->vesa.vendor, oem_ptr, sizeof(hardware->vesa.vendor));
oem_ptr = GET_PTR(gi->oem_product_name_ptr);
- strncpy(hardware->vesa.product, oem_ptr, sizeof(hardware->vesa.product));
+ strlcpy(hardware->vesa.product, oem_ptr, sizeof(hardware->vesa.product));
oem_ptr = GET_PTR(gi->oem_product_rev_ptr);
- strncpy(hardware->vesa.product_revision, oem_ptr,
+ strlcpy(hardware->vesa.product_revision, oem_ptr,
sizeof(hardware->vesa.product_revision));
hardware->vesa.major_version = (gi->version >> 8) & 0xff;
@@ -562,13 +556,13 @@ void cpu_detect(struct s_hardware *hardware)
/* Old processors doesn't manage the identify commands
* Let's use the dmi value in that case */
if (strlen(remove_spaces(hardware->cpu.model)) == 0)
- strncpy(hardware->cpu.model, hardware->dmi.processor.version,
+ strlcpy(hardware->cpu.model, hardware->dmi.processor.version,
sizeof(hardware->cpu.model));
/* Some CPUs like to put many spaces in the model name
* That makes some weird display in console/menu
* Let's remove that mulitple spaces */
- strncpy(hardware->cpu.model,del_multi_spaces(hardware->cpu.model),sizeof(hardware->cpu.model));
+ strlcpy(hardware->cpu.model,del_multi_spaces(hardware->cpu.model),sizeof(hardware->cpu.model));
hardware->cpu_detection = true;
}
@@ -660,7 +654,7 @@ char *del_multi_spaces(char *p)
/* Let's copy to the current position
* the content from the second space*/
- strncpy(p, p + 1, strlen(p + 1));
+ strlcpy(p, p + 1, strlen(p + 1));
/* The string is 1 char smaller */
*(p + strlen(p) - 1) = '\0';
diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h
index 21b7e5b9..3aa5a506 100644
--- a/com32/hdt/hdt-common.h
+++ b/com32/hdt/hdt-common.h
@@ -61,6 +61,9 @@
#define HDT_RETURN_TO_CLI 100
#define MAX_VESA_MODES 255
+/* This value is used for rebooting from the menu mode */
+#define HDT_REBOOT "hdt_reboot"
+
/* The maximum number of commands we can process */
#define MAX_NB_AUTO_COMMANDS 255
/* The maximum size of a command */
@@ -206,7 +209,6 @@ struct s_hardware {
char modules_alias_path[255];
char pciids_path[255];
char memtest_label[255];
- char reboot_label[255];
char auto_label[AUTO_COMMAND_SIZE];
char vesa_background[255];
};
diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c
index 1d00ab80..0fc6fb1a 100644
--- a/com32/hdt/hdt-menu.c
+++ b/com32/hdt/hdt-menu.c
@@ -28,6 +28,7 @@
#include <unistd.h>
#include <memory.h>
+#include <syslinux/reboot.h>
#include "hdt-menu.h"
int start_menu_mode(struct s_hardware *hardware, char *version_string)
@@ -61,6 +62,10 @@ int start_menu_mode(struct s_hardware *hardware, char *version_string)
(curr->data, HDT_SWITCH_TO_CLI, sizeof(HDT_SWITCH_TO_CLI))) {
return HDT_RETURN_TO_CLI;
}
+ if (!strncmp
+ (curr->data, HDT_REBOOT, sizeof(HDT_REBOOT))) {
+ syslinux_reboot(1);
+ }
strcpy(cmd, curr->data);
/* Use specific syslinux call if needed */
@@ -279,7 +284,7 @@ void compute_main_menu(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware)
HDT_SWITCH_TO_CLI, 0);
add_item("<A>bout", "About Menu", OPT_SUBMENU, NULL,
hdt_menu->about_menu.menu);
- add_item("<R>eboot", "Reboot", OPT_RUN, hardware->reboot_label, 0);
+ add_item("<R>eboot", "Reboot", OPT_RUN, HDT_REBOOT, 0);
add_item("E<x>it", "Exit", OPT_EXITMENU, NULL, 0);
hdt_menu->main_menu.items_count++;