diff options
Diffstat (limited to 'com32/hdt/hdt-cli.c')
-rw-r--r-- | com32/hdt/hdt-cli.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index a92d5f5c..5b1da6f5 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -59,6 +59,11 @@ void set_mode(struct s_cli_mode *cli_mode, cli_mode_t mode, struct s_hardware *h snprintf(cli_mode->prompt, sizeof(cli_mode->prompt), "%s> ", CLI_KERNEL); break; + case SYSLINUX_MODE: + cli_mode->mode=mode; + snprintf(cli_mode->prompt, sizeof(cli_mode->prompt), "%s> ", CLI_SYSLINUX); + break; + case PCI_MODE: cli_mode->mode=mode; snprintf(cli_mode->prompt,sizeof(cli_mode->prompt),"%s> ", CLI_PCI); @@ -149,6 +154,10 @@ void start_cli_mode(struct s_hardware *hardware, int argc, char *argv[]) { set_mode(&cli_mode,KERNEL_MODE,hardware); continue; } + if ( !strncmp(cli_line, CLI_SYSLINUX, sizeof(CLI_SYSLINUX) - 1) ) { + set_mode(&cli_mode,SYSLINUX_MODE,hardware); + continue; + } /* All commands before that line are common for all cli modes * the following will be specific for every mode */ switch(cli_mode.mode) { @@ -157,6 +166,7 @@ void start_cli_mode(struct s_hardware *hardware, int argc, char *argv[]) { case HDT_MODE: handle_hdt_commands(cli_line,&cli_mode, hardware); break; case CPU_MODE: handle_cpu_commands(cli_line,&cli_mode, hardware); break; case PXE_MODE: handle_pxe_commands(cli_line,&cli_mode, hardware); break; + case SYSLINUX_MODE: handle_syslinux_commands(cli_line,&cli_mode, hardware); break; case KERNEL_MODE: handle_kernel_commands(cli_line,&cli_mode, hardware); break; case EXIT_MODE: break; /* should not happend */ } @@ -168,6 +178,7 @@ int do_exit(struct s_cli_mode *cli_mode) { case HDT_MODE: return EXIT_MODE; case KERNEL_MODE: case PXE_MODE: + case SYSLINUX_MODE: case PCI_MODE: case DMI_MODE: case CPU_MODE: return HDT_MODE; @@ -179,10 +190,11 @@ return HDT_MODE; void show_cli_help(struct s_cli_mode *cli_mode) { switch (cli_mode->mode) { case HDT_MODE: - printf("Available commands are : %s %s %s %s %s %s %s %s %s\n", + printf("Available commands are : %s %s %s %s %s %s %s %s %s %s\n", CLI_CLEAR, CLI_EXIT,CLI_HELP,CLI_SHOW, CLI_PCI, - CLI_DMI, CLI_PXE, CLI_KERNEL, CLI_CPU); + CLI_DMI, CLI_PXE, CLI_KERNEL, CLI_CPU, CLI_SYSLINUX); break; + case SYSLINUX_MODE: case KERNEL_MODE: case PXE_MODE: case CPU_MODE: @@ -225,6 +237,7 @@ void show_main_help(struct s_hardware *hardware) { more_printf(" %s\n",CLI_DMI); more_printf(" %s\n",CLI_CPU); more_printf(" %s\n",CLI_KERNEL); + more_printf(" %s\n",CLI_SYSLINUX); if (hardware->sv->filesystem == SYSLINUX_FS_PXELINUX) more_printf(" %s\n",CLI_PXE); } @@ -235,6 +248,7 @@ void main_show(char *item, struct s_hardware *hardware, struct s_cli_mode *cli_m if (!strncmp(item,CLI_DMI, sizeof (CLI_DMI))) { main_show_dmi(hardware,cli_mode); return; } if (!strncmp(item,CLI_CPU, sizeof (CLI_CPU))) { main_show_cpu(hardware,cli_mode); return; } if (!strncmp(item,CLI_PXE, sizeof (CLI_PXE))) { main_show_pxe(hardware,cli_mode); return; } + if (!strncmp(item,CLI_SYSLINUX, sizeof (CLI_SYSLINUX))) { main_show_syslinux(hardware,cli_mode); return; } if (!strncmp(item,CLI_KERNEL, sizeof (CLI_KERNEL))) { main_show_kernel(hardware,cli_mode); return; } show_main_help(hardware); } |